2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-10-31 09:20:23 +00:00

add services.jar deodex'ing instructions

This commit is contained in:
Christopher Roy Bratusek 2018-08-25 19:36:36 +02:00
parent 3889803d3f
commit 862e21bc2a
2 changed files with 102 additions and 4 deletions

View File

@ -92,11 +92,14 @@ NanoDroid officially supports the following Android versions:
* 7.1 / SDK 25 (Nougat)
* 8.0 / SDK 26 (Oreo)
* Patchers works, if you've previously manually deodexed services.jar
* [> Deodex Instructions](doc/DeodexServices.md)
* 8.1 / SDK 27 (Oreo)
* Patchers works, if you've previously manually deodexed services.jar
* [> Deodex Instructions](doc/DeodexServices.md)
* 9.0 / SDK 28 (Pie)
* Google Sync Adapters are not (yet) available
* Patchers works, if you've previously manually deodexed services.jar
* [> Deodex Instructions](doc/DeodexServices.md)
earlier versions will never officially be supported (you may still report bugs, though).
@ -192,8 +195,9 @@ Extra packages, always flash through TWRP.
* **NanoDroid-patcher**: includes
* on-device framework-patcher for signature spoofing support
* optionally can patch user interface for it into Developer Settings
* creates the file `/data/adb/.nanodroid-patcher` after successful patching
* requires an deodexed ROM
* [> Deodex Instructions](doc/DeodexServices.md)
* creates the file `/data/adb/NanoDroid_Patched` after successful patching
* installs an addon.d script for automatic re-patching after ROM update
* addon.d support files reside in `/data/adb/nanodroid-patcher/`
* **NanoDroid-setupwizard**: includes
@ -217,8 +221,10 @@ Extra packages, always flash through TWRP.
Misc. Script for use from PC/Notebook, while device is in TWRP, they are found in this repository
* **framework-patcher**
* on-pc framework-patcher for signature spoofing support
* creates the file `/data/adb/.nanodroid-patcher` after successful patching
* on-device framework-patcher for signature spoofing support
* requires an deodexed ROM
* [> Deodex Instructions](doc/DeodexServices.md)
* creates the file `/data/adb/NanoDroid_Patched` after successful patching
* invoke like `framework-patcher [ver]`
* where [ver] is your Android version (6.0, 7.1, ...)
* the original, unpatched `services.jar` is backed up to `/sdcard/nanodroid_backups`

92
doc/DeodexServices.md Normal file
View File

@ -0,0 +1,92 @@
# Deodex services.jar
## VDEX
If you can see `/system/framework/oat/[arch]/services.vdex` you should follow theese instructions.
the instructions are basically simple, though plenty commands:
* connect phone with PC while in TWRP, mount `/system` **read-write**
* get latest `vdexExtractor` (best self-compiled from git)
* zip/unzip utilities for commandline (or some UI tool)
* common sense on using commandline (or some UI tool instead)
```
adb pull /system/framework framework
cp framework/services.jar services.jar-backup
```
now deodex `boot-core-libart.vdex` and `services.vdex`, where [arch] is the device architecture (arm, arm64, x86 or x86_64):
```
vdexExtractor -i framework/oat/[arch]/services.vdex --ignore-crc-error
```
this will create the following file:
* framework/oat/[arch]/services.apk_classes.dex
if it's properly been created rename it to classes.dex and add it to `services.jar`
```
mv framework/oat/[arch]/services.apk_classes.dex classes.dex
zip -d framework/services.jar classes.dex
zip -j framework/services.jar classes.dex
```
next install the new `services.jar` to device:
```
adb push framework/services.jar /system/framework
adb shell
chmod 0644 /system/framework/services.jar
chown root:root /system/framework/services.jar
```
unmount `/system` and flash the NanoDroid-Patcher.
If something goes wrong you still have the unpatched `services.jar`, as we created a copy named `services.jar-backup`.
## ODEX
If you can see `/system/framework/oat/[arch]/services.odex` you should follow theese instructions.
the instructions are basically simple, though plenty commands:
* connect phone with PC while in TWRP, mount `/system` **read-write**
* get latest `baksmali.jar` and `smali.jar` (2.2.4+, best self-built from git)
* zip/unzip utilities for commandline (or some UI tool)
* common sense on using commandline (or some UI tool instead)
```
adb pull /system/framework framework
cp framework/services.jar services.jar-backup
```
check if `framework/services.jar` contains a `classes.dex` (open as zip file), if not, I can't help you right now, I have **not yet** looked into how to deodexed VDEX files. If it does contain `classes.dex`, continue as follows:
```
mkdir services-old
unzip -d services-old framework/services.jar
java -jar baksmali.jar x services-old/classes.dex -b framework/core-oj.jar -o services-new
java -jar smali.jar a services-new -o classes.dex
```
if a new classes.dex was successfully created in the services-new directory, re-package it into the services.jar we previously pulled:
```
zip -d framework/services.jar classes.dex
zip -j framework/services.jar classes.dex
```
next install the new `services.jar` to device:
```
adb push framework/services.jar /system/framework
adb shell
chmod 0644 /system/framework/services.jar
chown root:root /system/framework/services.jar
```
unmount `/system` and flash the NanoDroid-Patcher.
If something goes wrong you still have the unpatched `services.jar`, as we created a copy named `services.jar-backup`.