Android - midenok/hardware GitHub Wiki

Backup app (f.ex Swype) settings on unrooted device:

adb backup -noapk com.swype.android.inputmethod

Restore these settings on (possibly another) device:

adb restore ./backup.ab

Remove app

adb shell
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
rm /system/app/your_app
rm /data/data/your_app
remove any entries in /data/system/packages.xml
remove any entries in /data/system/packages.list
edit AndroidManifest.xml and get rid of android:sharedUserId="android.uid.shared"

Undeleting files

  1. First of all! Stop creating new files, close all apps. If you will need to run something, better DELETE first some needless files as much as possible to free more space and get more chances to keep your deleted files intact. Of course you will have to know what partition you need to free. High chances its the one that is mounted as /data (your local and deleted files are in /data/media or something like that).
  2. Copy your partition with dd to micro SD card by 4Gb pieces:
dd if=/dev/dm-0 of=/sdcard/x1...n bs=1048576 count=4095
  1. Move all pieces to linux system, concatenate with cat.
  2. Use testdisk to recover. This is most versatile tool for extfs undelete. It allows to undel from specific directory and undeletes even broken files and works really fast (apart from heuristic scanners). So you will be sure that everything that is possible is undeleted or overwritten.

My answer is here.

Check if device encrypted

adb shell getprop ro.crypto.state

Dump firmware

adb root
adb shell su -c setenforce 0
adb shell 'dd if=/dev/block/mmcblk0 2>/dev/null' > mmcblk0.img

Some partitions

adb shell 'dd if=/dev/block/platform/msm_sdcc.1/by-name/XXXXXX 2>/dev/null' > XXXXXX.img

Some flash script (sec_offline_update_image.cmd)

fastboot oem backup_config
fastboot oem start_partitioning
fastboot flash /tmp/partition.tbl .\partition.tbl
fastboot oem partition /tmp/partition.tbl
fastboot erase system
fastboot erase cache
fastboot erase spare
fastboot erase data
fastboot erase userdata
fastboot erase APD
fastboot erase ADF
fastboot oem stop_partitioning
fastboot flash dnx .\sec-dnx_fwr.bin
fastboot flash ifwi .\sec-ifwi-prod.bin
fastboot flash boot .\boot_sign.bin
fastboot flash recovery .\recovery_sign.bin
fastboot flash fastboot .\droidboot_sign.bin
fastboot flash splashscreen .\splash_sign.bin
fastboot flash APD .\APD.img
fastboot flash system .\system.img
fastboot reboot-bootloader

Links