DISCLAIMER
This project may brick you phone. Use at your own risk.
What's New in v3
Background
This is a project for developers who need a quick fixing and nandroid backup/restore environment for LG-D838 that still cannot install custom recovery currently. If you want to test, hack or modify system apks and/or Xposed modules but are afraid of bricking, you may try this project. Without this project, although you can recover the phone by flashing official firmware, reconstructing user settings and data is time-consuming. Normal ADB might be a solution for fixing, but you may not have enough time to fix problems before system hang up or goes into boot loop. And normal ADB cannot do nandroid backup/restore.
The Early-ADB sits in the early stage of Linux init process, right after "/system" mounted, far before Android stuffs starting. This way keeps the Early-ADB alive even if the Android stuffs such as apks or jars crash. Therefore, you can fix problems of Android stuffs by ADB through PC console.
The newly added backup/restore functions make it easier to backup and restore /system, /data and /cache partition with archive format compatible with CWM recovery.
More Information
See post #2 for more background information. And welcome to provide any technical information for FURTHER DEVELOPMENT section in post #2.
How It Works
The project hijacks e2fsck to interrupt Linux init process and redirect to its custom ADB daemon, the Early-ADB, so that you can access ADB by PC console in the early stage if required. The hijack concept comes from 2nd-init and Safestrap. While installing this project, the installer backup original e2fsck and replace it with a script. On each boot up, this script determine to go for original e2fsck as normal boot or go for Early-ADB by checking the Volume-Up key.
Basic Q&A
See post #3 for basic Q&A.
Installation
Uninstallation
How To Use
Limitations And Known Issues
Download
v3: EarlyADB.v3.zip
v2: EarlyADB.v2.zip, obstacle due to SELinux problem. Download it only for research purpose.
v1: EarlyADB.v1.zip, mirror
eladbd daemon source: eladb_mod.zip, modified from https://source.android.com/source/downloading.html branch android-4.4.2_r2, only modified part is included in the zip.
Changelog
v3 (2014/05/21)
v2 (2014/05/18)
v1 (2014/05/11)
Thanks
Savoca of directing me to Safestrap and 2nd-init concepts
Hashcode with Safestrap project for concept of hijacking e2fsck
XDA:DevDB Information
Early-ADB, Tool/Utility for the LG G Pro 2
Contributors
pcfree
Version Information
Status: Testing
Created 2014-05-11
Last Updated 2014-05-21
This project may brick you phone. Use at your own risk.
What's New in v3
- I don't quiet understand SELinux, so the v2 did not process SELinux contexts while restoring "system", "data" and "cache" partitions. Now v3 fix it. If you'd ever restored them by v2, run v3 sub-menu "Tools"->"Restore SELinux security contexts" to fix it.
- Add backup boot.img and "sdcard/Android/data".
- Add "Wipe Dalvik cache".
- Add functionality to fix common boot-loop problems including "Switch runtime to Dalvik from Art", "Disable Xposed", and "Fix build.prop permission".
What's New in v2
- The major functionality added from v1 is to support nandroid backup/restore for "system", "data" and "cache" partitions to/from internal sdcard by using the supplied "ea-menu" shell script.
- The "ea-menu" also support partition management such as mount, unmout, ro and rw.
Background
This is a project for developers who need a quick fixing and nandroid backup/restore environment for LG-D838 that still cannot install custom recovery currently. If you want to test, hack or modify system apks and/or Xposed modules but are afraid of bricking, you may try this project. Without this project, although you can recover the phone by flashing official firmware, reconstructing user settings and data is time-consuming. Normal ADB might be a solution for fixing, but you may not have enough time to fix problems before system hang up or goes into boot loop. And normal ADB cannot do nandroid backup/restore.
The Early-ADB sits in the early stage of Linux init process, right after "/system" mounted, far before Android stuffs starting. This way keeps the Early-ADB alive even if the Android stuffs such as apks or jars crash. Therefore, you can fix problems of Android stuffs by ADB through PC console.
The newly added backup/restore functions make it easier to backup and restore /system, /data and /cache partition with archive format compatible with CWM recovery.
More Information
See post #2 for more background information. And welcome to provide any technical information for FURTHER DEVELOPMENT section in post #2.
How It Works
The project hijacks e2fsck to interrupt Linux init process and redirect to its custom ADB daemon, the Early-ADB, so that you can access ADB by PC console in the early stage if required. The hijack concept comes from 2nd-init and Safestrap. While installing this project, the installer backup original e2fsck and replace it with a script. On each boot up, this script determine to go for original e2fsck as normal boot or go for Early-ADB by checking the Volume-Up key.
Basic Q&A
See post #3 for basic Q&A.
Installation
- Make sure you have backup your user data. Make sure your D838 is rooted. Make sure you have turned on USB Debugging option in your D838.
- Prepare Windows ADB utility. Currently the Early-ADB installer script is only for Windows command prompt.
- Download "EarlyADB.v1.zip" in the download link below, and extract it into the Windows ADB folder. Please do not process the extracted "packs.zip". Keep it unchange.
- Connect the D838 phone to your Windows PC through USB cable.
- In your Windows PC, open a command prompt and "cd" to your ADB directory. Type "install" to run the Early-ADB installer.
Uninstallation
- Walk through the same steps as above Installation 1 to 4.
- In your Windows PC, open a command prompt and "cd" to your ADB directory. Type "unins" to run the Early-ADB uninstaller.
How To Use
- Power on or reboot your D838.
- When you see LG logo, press and hold Volume-Up key. After seeing the screen dims obviously, you can release the Volume-Up key. Now early-ADB daemon is running and Linux init is hold.
- Connect D838 to any PC with adb through USB cable.
- By using adb shell, run "ea-menu" to backup/restore to/fram internal sdcard, or fix problems manually.
- To leave Early-ADB daemon, press and hold power button for at least 8 seconds to reboot the phone.
- The internal sdcard is not a safe place for nandroid backup files. Remember to copy them to external sdcard.
Limitations And Known Issues
- Only "/system", "/data" and "/cache" are mounted. Manually mount other partitions if required.
- The Early-ADB daemon sits in early init stage that many services are not ready to use and some normal adb functionalities cannot work. For examples, you cannot reboot by software commands. You cannot get model name from getprop command. However, you can "push" and "pull" files and access "/system" and "/data" to fix many crash problems.
- Don't expect this project as a brick protection. If you destory bootloader, this project can do nothing.
- Don't do OTA upgrade. Any system files modification may (or may not, it depends) result in brick.
- The Google Music media files are prevented from backup by Early-ADB. Backup them by yourself, otherwise if you recover data partition, you will lose them.
Download
v3: EarlyADB.v3.zip
v2: EarlyADB.v2.zip, obstacle due to SELinux problem. Download it only for research purpose.
v1: EarlyADB.v1.zip, mirror
eladbd daemon source: eladb_mod.zip, modified from https://source.android.com/source/downloading.html branch android-4.4.2_r2, only modified part is included in the zip.
Changelog
v3 (2014/05/21)
- BUGFIX: Restore SELinux security contexts if restoring /system, /data or /cache partition.
- Add backup/restore kernel (boot.img)
- Add backup/restore /sdcard/Android/data contents
- Add Tools sub-menu to "Wipe Dalvik cache".
- In Tools sub-menu, add fix to common boot-loop problems including "Switch runtime to Dalvik from Art", "Disable Xposed" and "Fix build.prop permission".
- In Tools sub-menu, add fix to v2 bug "Restore SELinux security contexts".
- Reduce package size by minimizing installer busybox.
- Auto mount partitions for backup/restore operations.
- Ask user to confirm restore operation.
v2 (2014/05/18)
- Run early then v1, right after /system mounted.
- Default mount system, data and cache partitions.
- Add "ea-menu" to run from adb shell, so you can do nandroid backup/restore for system, data and cache partitions.
- Introduce new "SAFE" mount concept by mounting partitions in non-standard /mnt/system, /mnt/data, and /mnt/cache to prevent from accessing accidentally by other unknown background services while restoring.
- Build busybox from source code 1.22.1 (source available from http://www.busybox.net)
- Build pigz 2.3.1 for using by nandroid backup/restore (source available from http://zlib.net/pigz/)
- Build static verion of mksh, so that in SAFE mount we don't have to rely on system partition for shell. (source available from https://source.android.com/source/downloading.html branch android-4.4.2_r2 )
v1 (2014/05/11)
- Initial testing release
Thanks
Savoca of directing me to Safestrap and 2nd-init concepts
Hashcode with Safestrap project for concept of hijacking e2fsck
XDA:DevDB Information
Early-ADB, Tool/Utility for the LG G Pro 2
Contributors
pcfree
Version Information
Status: Testing
Created 2014-05-11
Last Updated 2014-05-21