2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-10-31 09:20:23 +00:00
- simplify code
- don't deodex services.jar if it's already deodexed
This commit is contained in:
Christopher Roy Bratusek 2018-08-25 22:33:20 +02:00
parent 5c61d31398
commit 9ac49915eb
2 changed files with 23 additions and 21 deletions

View File

@ -55,7 +55,9 @@
* bundle baksmali and smali * bundle baksmali and smali
* not yet used / working * not yet used / working
* if ROM's odex method is VDEX, try to automatically deodex it * if ROM's odex method is VDEX, try to automatically deodex it
* if services.jar contains classes.dex, Patcher will skip deodex process
* bundle vdexExtractor for arm and x86 * bundle vdexExtractor for arm and x86
* simplify code
* remove old code * remove old code
### Updates ### Updates

View File

@ -138,24 +138,29 @@ grep_cmdline() {
} }
detect_odex () { detect_odex () {
if [ -n "$(find '/system/framework/' -name '*.vdex')" ]; then SERVICES_JAR_ODEX=$(unzip -lq /system/framework/services.jar | grep classes.dex)
ui_print " "
ui_print " ++"
ui_print " ++ vdexed ROM detected"
ui_print " ++"
ROM_DEX_STATUS=VDEX if [ "${SERVICES_JAR_ODEX}" ]; then
elif [ -n "$(find '/system/framework/' -name '*.odex')" ]; then ROM_DEX_STATUS=NONE
ui_print " " else
ui_print " !! " if [ -n "$(find '/system/framework/' -name '*.vdex')" ]; then
ui_print " !! odexed ROMs are not supported" ui_print " "
ui_print " !! patching will fail, if you have" ui_print " ++"
ui_print " !! not manually deodexed services.jar" ui_print " ++ vdexed ROM detected"
# ui_print " !! odexed ROM detected!" ui_print " ++"
ui_print " !!"
ROM_DEX_STATUS=ODEX ROM_DEX_STATUS=VDEX
else ROM_DEX_STATUS=NONE elif [ -n "$(find '/system/framework/' -name '*.odex')" ]; then
ui_print " "
ui_print " !! "
ui_print " !! odexed ROMs are not supported"
ui_print " !! patching will fail, if you have"
ui_print " !! not manually deodexed services.jar"
# ui_print " !! odexed ROM detected!"
ui_print " !!"
ROM_DEX_STATUS=ODEX
fi
fi fi
} }
@ -300,10 +305,6 @@ patch_services () {
ui_print " > patching signature spoofing support" ui_print " > patching signature spoofing support"
ui_print " " ui_print " "
for jar in /system/framework/*.jar ; do
BOOTCLASSES=${BOOTCLASSES}:${jar}
done
cp /system/framework/services.jar \ cp /system/framework/services.jar \
${BASEDIR}/services.jar || \ ${BASEDIR}/services.jar || \
error " !! failed to copy services.jar" error " !! failed to copy services.jar"
@ -378,7 +379,6 @@ patch_services () {
ui_print " >> patching services.jar" ui_print " >> patching services.jar"
LD_LIBRARY_PATH=${C_LD} \ LD_LIBRARY_PATH=${C_LD} \
/system/bin/dalvikvm \ /system/bin/dalvikvm \
-Xbootclasspath:"${BOOTCLASSES}" \
-classpath "${BASEDIR}/dexpatcher.dex" \ -classpath "${BASEDIR}/dexpatcher.dex" \
lanchon.dexpatcher.Main \ lanchon.dexpatcher.Main \
${DEX_OPTS} --api-level "${SDK_VERSION}" \ ${DEX_OPTS} --api-level "${SDK_VERSION}" \