Android

From miki
Jump to navigation Jump to search

Links

On this wiki

How-To

Sync phones

For instance to sync old and new phones.

Contacts
  • Sync via Google Account.
Calendar
  • Sync via Google Account.
Color Notes
  • Sync via Google Account.
SMS/MMS/Call logs
  • Use SMS Backup & Restore app.
Photos
  • Sync via samba share (using for instance ES Explorer app).

Backup with Helium (ClockWorkMod Carbon)

Do not use backup to Internal SD since the internal files cannot be exported. Copying these files from another phone, or as a backup restore, does not work. This method of backup save/restore is not supported, as indicated in the Helium Wiki.

Instead to do the backup:

  • Start Helium.
  • Start the PC server.
  • Connect via the PC, select the set of applications and start the backup.
Advices and troubleshooting
  • Exclude MoboPlayer. Backup fails when the app is selected.
  • Exclude GBoard. Huge size for little gains.
  • Exclude Translate. Huge size for little gains.

Privacy

Upgrade the device

Odin

Flashing tool on Windows. Meaning of BL, AP... [1]:

  • BL means Boot Loader.
  • AP means Android Partition. Was PDA before.
  • CP means Core Processor.
  • CSC means Consumer Software Customization. This specifies the features your Android device gets according to its geographical location and carrier.

Upgrade Samsung Alpha

I used Odin on Windows. Probably it was possible to do it on Linux via Heimdall.

  • Download the latest firmware for Samsung Alpha:
  • Install Samsung device drivers.
  • Download and start Odin
  • Extract (unzip) the firmware file
  • Open Odin v3.12.7
  • Reboot Phone in Download Mode (press and hold Home + Power + Volume Down buttons)
  • Connect phone and wait until you get a blue sign in Odin
  • Add the firmware file to AP / PDA
  • Make sure re-partition is NOT ticked
  • Click the start button, sit back and wait few minutes

If we rooted the device, we get a FAILED message in Odin. Now we follow this guide:

  • Follow the same procedure as above, but flash the CF-Auto-Root image for rooting the device (add the file to AP / PDA in Odin).

Root the device

Root Samsung Alpha

From this guide:

  • Download the CF-Auto-Root files corresponding to the current build.
  • In my case, I have a Samsung Alpha G850F, with firmware G850FXXS2CQD3. Pick the file corresponding to that build number.
  • From downloaded file, extract the files cache.img and recovery.img.
  • Install heimdall and heimdall-gui, then run sudo heimdall-frontend.
  • Power off the phone. Press Volume down, Menu and Power button. Press Volume Up to proceed at warning message.
  • Go to Utilities tab, click Detect to make sure device is detected.
  • In the same tab, click Save As then Download to start downloading the PIT. Save the file locally, next to the other .img files.
  • Go to the Flash tab, click Browse, and open the PIT file that was saved previously.
  • Click Add to add a partition file, and select RECOVERY as Partition Name, and select the file recovery.img as the File.
  • Click Add to add a partition file, and select CACHE as Partition Name, and select the file cache.img as the File.
  • Select No Reboot.
  • Click Start. On Success, you should get a message Flashing successful or similar. If not, and instead get a detaching device from interface or such, restart the process, but don't reboot the mobile phone.
  • While pressing Volume Up, unplug the Usb cable, then keep pressing on Volume Up + Power button to force an emergency restart.
  • Wait for device to update.

BusyBox

BusyBox is often cited as requirement to Deodex, etc. So let's install it. We need the busy box app and busybox commands.

  • Install BusyBox [2].

Deodexing

That* was a bloody step. All instructions were very messy, hidden in lengthy forums, where authors just keep saying incomplete information. Finally the most helpful ressources:

  • [3] The initial forum about deodexing. But
  • Windows based.
  • Incomplete instructions on how to extract the file.
  • referenced program failed to deodex some files.
  • Obscure instructions for flashing back.
  • More guidance on deodexing 5.0.2
  • Here they explain how to flash files back. But instructions was not correct for my phone.

First extract the files using ADB.

  • Plug phone in USB.
adb pull /system system
adb pull /system/priv-app priv-app
adb pull /system/app app
adb pull /system/framework framework
adb pull /system/bin bin
adb pull /system/build.prop Build.prop

Then Deodex files with svadev tool.

  • Use version 5.5.
  • Requires jre 64-bit 8.
This process will create new folders `app`, `framework` and `priv-app`, and also some folders `dex` and `odex`.
Process failed on file `./priv-app/SamsungLinkPlatform/arm/SamsungLinkPlatform.odex.xz`

Then Copy back `SamsungLinkPlatform.odex.xz` to deodexed system files.

  • Also remove folder `dex` and `odex`.

Then Copy the folders `app`, `framework` and `priv-app` to phone SDCARD root.

adb shell
su
stop
mount -o rw,remount /system/ /system/

cp -r /sdcard/system-deodexed/app/* /system/app/
find /system/app/ -name "*odex*" | xargs rm

cp -r /sdcard/system-deodexed/framework/* /system/framework/
find /system/framework/ -name "*odex*" | xargs rm

cp -r /sdcard/system-deodexed/priv-app/* /system/priv-app/
find /system/framework/ -name "*odex*" | xargs rm

cp /sdcard/system-deodexed/priv-app/SamsungLinkPlatform/arm/SamsungLinkPlatform.odex.xz /system/priv-app/SamsungLinkPlatform/arm/
find /system/priv-app/ -name "*odex*"
mount -o ro,remount /system/ /system/
reboot

Install TWRP

TWRP is a MUST-HAVE application for anyone tinkering with the firmware, to ease recovery in case of failure / soft brick, or to install new customizations (as zip file).

Reference:

We flash via App:

  • Install TWRP App.
  • Select image (.img), select *Flash to Recovery*.
  • TODO: Should have backed up original recovery first. Do it on Isa's phone, or can we recover one from original ROM?

Alternative: Command-line instructions to flash

adb reboot bootloader
fastboot flash recovery twrp-2.8.x.x-xxx.img
fastboot reboot

Install Xposed

First we need to know which CPU we have:

  • Install google app *CPU Z*
  • --> Exynos (octa core, ARM architecture).

Some forums on installing Xposed:

The post giving specific instruction for the Alpha G850F!
This is custom ZIP files for Samsung. Refer to link below for APK.
  • Download `xposed-v75-sdk21-arm-arter97-exynos_requestConcurrentGC.zip`.
This is generic APK (to install), and generic ZIP files (DO NOT install)
  • Download`XposedInstaller_3.1.5.apk`.
  • Copy XposedInstaller_3.1.5.apk and xposed-v75-sdk21-arm-arter97-exynos_requestConcurrentGC.zip to /sdcard on phone.
  • Install APK.
  • Reboot and launch TWRP (*VolUp-Home-Power* button).
  • ==> Error: *Firmware must be deodexed* !?!
  • ==> We look into .zip file, in META-INF folder we find a script with that error message:
  • It looks for a folder `/system/firmware/arm`. Let's delete it!
  • Looking into folder, we have two files:
boot.art
boot.oat
  • Let's remove all empty arm dir
adb shell
su
stop
mount -o rw,remount /system/ /system/

rm -rf /system/framework/arm
find /system/app -name arm|xargs rmdir
find /system/framework -name arm|xargs rmdir
find /system/priv-app -name arm|xargs rmdir

mount -o ro,remount /system/ /system/
reboot
  • Then go in TWRP recovery, install the zip file, clean dalvik/cache, reboot.
  • Pray.

Install Xposed modules

Open Xposed app, install modules, enable modules...

Backup

System - TWRP

Use TWRP application to install custom recovery partition, and create/restore backups.

Export backups to PC

Using adb:

  • Boot into TWRP recovery.
adb devices                  # Just to verify devices is detected
adb pull /sdcard/TWRP TWRP

To push back the backups:

adb push TWRP /sdcard/TWRP

We can also copy via termux, but it requires root access, and moving file around, which is less convenient.

Troubleshooting

Frozen widget

  • Try restarting the launcher. On Samsung, Force stop TouchWiz in the application manager (TouchWiz is apparently Samsung's custom launcher).

Enable developer mode

  • On Samsung, go to SettingsAbout devicetap 7x on Build number. [5]

Get android log

  • Enable USB debugging phone (see developer settings)
  • Connect phone to USB
  • Run
adb logcat

WiFi troubleshooting

Popup : Currently unable to download. Please try again later

Got the message for years when leaving plane mode. Turn out to be an MMS message that I couldn't download [6]. To fix, find the culprit MMS (the one with a Download button), and delete it!

Samsung Email: "Loading messages..." popup when trying to reply to a message

This is a issue due to an update of Android System WebView released on December 5th 2017 [7], [8].

Fix:

  • Go to Application Manager → all → Android System WebView, then select Uninstall update (but might come back at next udpate), or Disable (which might have side-effect on other applications).

Some users reported side-effects of the fix:

  • Instagram pictures not updating.

Alternatives to Samsung Emails: