apktool -version) - 2.3.3 , 2.3.492:得到 xiatian$ apktool d 得到.ver.4.0.1.build.20180615.apk
I: Using Apktool 2.3.4-92bec5-SNAPSHOT on 得到.ver.4.0.1.build.20180615.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
S: WARNING: Could not write to (.../apktool/framework), using /var/folders/46/1nvmzdp11230xjpb30_3lk7c0000gn/T/ instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
I: Loading resource table from file: /var/folders/46/1nvmzdp11230xjpb30_3lk7c0000gn/T/1.apk
I: Regular manifest package...
I: Decoding file-resources...
W: Cant find 9patch chunk in file: "i/n7.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "p/n9.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "p/n7.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "w/ak9.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "w/ak8.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "v/n8.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "w/rv.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "i/n_.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "p/n6.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "w/yw.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "w/yi.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "i/na.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "w/ru.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "i/n6.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "p/n_.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "p/n8.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "w/s5.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "p/na.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "w/y1.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "w/s2.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "w/a_u.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "v/n7.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "i/n8.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "v/na.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "v/n_.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "w/sb.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "v/n6.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "v/n9.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "i/n9.9.png". Renaming it to *.png.
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
192:得到 xiatian$ apktool b .../Desktop/temp/得到/得到.ver.4.0.1.build.20180615
I: Using Apktool 2.3.4-92bec5-SNAPSHOT
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether resources has changed...
I: Building resources...
S: WARNING: Could not write to (.../Library/apktool/framework), using /var/folders/46/1nvmzdp11230xjpb30_3lk7c0000gn/T/ instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
W: ERROR: 9-patch image .../Desktop/temp/得到/得到.ver.4.0.1.build.20180615/res/drawable-xxhdpi/a9h.9.png malformed.
W: No marked region found along edge.
W: Found along left edge.
W: ERROR: Failure processing PNG image .../Desktop/temp/得到/得到.ver.4.0.1.build.20180615/res/drawable-xxhdpi/a9h.9.png
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/46/1nvmzdp11230xjpb30_3lk7c0000gn/T/brut_util_Jar_7137504422296775119.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 26, --version-code, 20180615, --version-name, 4.0.1, --no-version-vectors, -F, /var/folders/46/1nvmzdp11230xjpb30_3lk7c0000gn/T/APKTOOL1077035773353441538.tmp, -0, assets/dist/css/ddeditor.d41d8cd98f00b204e9800998ecf8427e.css, -0, ogg, -0, mp3, -0, mp4, -0, arsc, -I, /var/folders/46/1nvmzdp11230xjpb30_3lk7c0000gn/T/1.apk, -S, .../Desktop/temp/得到/得到.ver.4.0.1.build.20180615/res, -M, .../Desktop/temp/得到/得到.ver.4.0.1.build.20180615/AndroidManifest.xml]
apktool d 201805251639406027371511.apkapktool b 201805251639406027371511None
apktool d, apktool b without changing anything?@ibuprophen1
You can get that kind of output when you compile from source.
/opt/Apktool# java -jar brut.apktool/apktool-cli/build/libs/apktool-cli-all.jar
Apktool123 v2.3.4-21fbe5-SNAPSHOT - a tool for reengineering Android apk files
@hurricanetx If you don't need to manipulate resources in the apk , you can use a workaround and decompile apk without resources.
$ apktool d 201805251639406027371511.apk -r -o without_res
$ apktool b without_res -o new.apk
I: Using Apktool 2.3.4-21fbe5-SNAPSHOT
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether resources has changed...
I: Copying raw resources...
I: Copying libs... (/lib)
I: Copying libs... (/kotlin)
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...
@TheKalin I'm trying that case before, but the apk is always crash.
@ibuprophen1 thank you. the release 2.3.3 used which is same as 2.3.4
@hurricanetx paste the logcat output.
In my case it looks like this.
TimaKeyStoreProvider D TimaKeyStore is not enabled: cannot add TimaSignature Service and generateKeyPair Service
MultiDex I VM with version 2.1.0 has multidex support
I Installing application
I VM has multidex support, MultiDex support library is disabled.
libc F Fatal signal 11 (SIGSEGV), code 2, fault addr 0xe401aea0 in tid 6374 (luojilab.player)
DEBUG F #00 pc 000175e4 /system/lib/libc.so (memcpy+112)
F #01 pc 00008ce4 /data/app/com.luojilab.player-1/lib/arm/libsupport.so (JNI_OnLoad+1248)
F #02 pc 0023da11 /system/lib/libart.so (_ZN3art9JavaVMExt17LoadNativeLibraryEP7_JNIEnvRKNSt3__112basic_stringIcN
S3_11char_traitsIcEENS3_9allocatorIcEEEEP8_jobjectP8_jstringPS9_+1844)
@TheKalin The logcat output is in follow:
--------- beginning of /dev/log/system
06-29 11:14:15.710 560-809/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.luojilab.player/com.luojilab.business.welcome.WelcomeActivity bnds=[287,525][381,665]} from pid 793
06-29 11:14:15.730 1266-1504/com.android.vending I/qtaguid: Untagging socket 52 failed errno=-13
06-29 11:14:15.730 1266-1504/com.android.vending W/NetworkManagementSocketTagger: untagSocket(52) failed with errno -13
06-29 11:14:15.730 1266-1504/com.android.vending I/qtaguid: Tagging socket 52 with tag e8d195d100000000(-388917807) for uid -1 failed errno=-13
06-29 11:14:15.730 1266-1504/com.android.vending I/NetworkManagementSocketTagger: tagSocketFd(52, -388917807, -1) failed with errno-13
06-29 11:14:15.730 793-793/com.vphone.launcher D/dalvikvm: GC_FOR_ALLOC freed 3012K, 20% free 12574K/15640K, paused 8ms, total 8ms
06-29 11:14:15.730 793-793/com.vphone.launcher W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1137 android.content.ContextWrapper.sendBroadcast:370 com.vphone.launcher.Stats.recordLaunch:129 com.vphone.launcher.Launcher.c:3069 com.vphone.launcher.Launcher.onClickAppShortcut:3037
06-29 11:14:15.750 560-792/system_process I/ActivityManager: Start proc com.luojilab.player for activity com.luojilab.player/com.luojilab.business.welcome.WelcomeActivity: pid=2992 uid=10048 gids={50048, 1028, 1015, 1023, 3002, 3001, 3003}
06-29 11:14:15.760 560-633/system_process W/NetworkManagementSocketTagger: setKernelCountSet(10048, 1) failed with errno -13
06-29 11:14:15.780 2992-2992/com.luojilab.player I/MultiDex: VM with version 1.6.0 does not have multidex support
Installing application
MultiDexExtractor(/data/app/com.luojilab.player-1.apk, /data/data/com.luojilab.player/code_cache/secondary-dexes)
Blocking on lock /data/data/com.luojilab.player/code_cache/secondary-dexes/MultiDex.lock
/data/data/com.luojilab.player/code_cache/secondary-dexes/MultiDex.lock locked
MultiDexExtractor.load(/data/app/com.luojilab.player-1.apk, false, )
Detected that extraction must be performed.
Extraction is needed for file /data/data/com.luojilab.player/code_cache/secondary-dexes/com.luojilab.player-1.apk.classes2.zip
06-29 11:14:15.790 2992-2992/com.luojilab.player I/MultiDex: Extracting /data/data/com.luojilab.player/code_cache/secondary-dexes/tmp-com.luojilab.player-1.apk.classes-2091077292.zip
06-29 11:14:17.070 2992-2992/com.luojilab.player I/MultiDex: Renaming to /data/data/com.luojilab.player/code_cache/secondary-dexes/com.luojilab.player-1.apk.classes2.zip
06-29 11:14:17.080 2992-2992/com.luojilab.player I/MultiDex: Extraction succeeded '/data/data/com.luojilab.player/code_cache/secondary-dexes/com.luojilab.player-1.apk.classes2.zip': length 3483142 - crc: 298573142
Extraction is needed for file /data/data/com.luojilab.player/code_cache/secondary-dexes/com.luojilab.player-1.apk.classes3.zip
Extracting /data/data/com.luojilab.player/code_cache/secondary-dexes/tmp-com.luojilab.player-1.apk.classes1903131080.zip
06-29 11:14:17.920 2992-2992/com.luojilab.player I/MultiDex: Renaming to /data/data/com.luojilab.player/code_cache/secondary-dexes/com.luojilab.player-1.apk.classes3.zip
Extraction succeeded '/data/data/com.luojilab.player/code_cache/secondary-dexes/com.luojilab.player-1.apk.classes3.zip': length 3000141 - crc: 3000510219
06-29 11:14:17.940 2992-2992/com.luojilab.player I/MultiDex: load found 2 secondary dex files
06-29 11:14:18.030 2992-2992/com.luojilab.player D/dalvikvm: DexOpt: --- BEGIN 'com.luojilab.player-1.apk.classes2.zip' (bootstrap=0) ---
06-29 11:14:18.330 3006-3006/? E/cutils-trace: Error opening trace file: No such file or directory (2)
06-29 11:14:18.330 3006-3006/? D/dalvikvm: GC_FOR_ALLOC freed 256K, 13% free 1782K/2048K, paused 1ms, total 1ms
06-29 11:14:18.610 3006-3006/? D/dalvikvm: DexOpt: load 80ms, verify+opt 259ms, 5707596 bytes
06-29 11:14:18.660 2992-2992/com.luojilab.player D/dalvikvm: DexOpt: --- END 'com.luojilab.player-1.apk.classes2.zip' (success) ---
DEX prep '/data/data/com.luojilab.player/code_cache/secondary-dexes/com.luojilab.player-1.apk.classes2.zip': unzip in 89ms, rewrite 628ms
06-29 11:14:18.710 2992-2992/com.luojilab.player D/dalvikvm: DexOpt: --- BEGIN 'com.luojilab.player-1.apk.classes3.zip' (bootstrap=0) ---
06-29 11:14:19.170 3007-3007/? D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_ABIS
06-29 11:14:19.180 3007-3007/? D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_ABIS
06-29 11:14:19.340 3007-3007/? D/dalvikvm: DexOpt: load 54ms, verify+opt 397ms, 5052316 bytes
06-29 11:14:19.400 2992-2992/com.luojilab.player D/dalvikvm: DexOpt: --- END 'com.luojilab.player-1.apk.classes3.zip' (success) ---
DEX prep '/data/data/com.luojilab.player/code_cache/secondary-dexes/com.luojilab.player-1.apk.classes3.zip': unzip in 52ms, rewrite 675ms
06-29 11:14:19.400 2992-2992/com.luojilab.player I/MultiDex: install done
06-29 11:14:19.400 2992-2992/com.luojilab.player W/PackageManager: Failure retrieving xml 0x7f120000 in package com.luojilab.player
android.content.res.Resources$NotFoundException: File r/ac/a.xml from xml type xml resource ID #0x7f120000
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2356)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2311)
at android.content.res.Resources.getXml(Resources.java:988)
at android.app.ApplicationPackageManager.getXml(ApplicationPackageManager.java:1036)
at android.content.pm.PackageItemInfo.loadXmlMetaData(PackageItemInfo.java:216)
at android.support.v4.content.FileProvider.parsePathStrategy(SourceFile:584)
at android.support.v4.content.FileProvider.getPathStrategy(SourceFile:558)
at android.support.v4.content.FileProvider.attachInfo(SourceFile:376)
at android.app.ActivityThread.installProvider(ActivityThread.java:4792)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4387)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4327)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5019)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.io.FileNotFoundException: r/ac/a.xml
at android.content.res.AssetManager.openXmlAssetNative(Native Method)
at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:488)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2338)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2311)Â
at android.content.res.Resources.getXml(Resources.java:988)Â
at android.app.ApplicationPackageManager.getXml(ApplicationPackageManager.java:1036)Â
at android.content.pm.PackageItemInfo.loadXmlMetaData(PackageItemInfo.java:216)Â
at android.support.v4.content.FileProvider.parsePathStrategy(SourceFile:584)Â
at android.support.v4.content.FileProvider.getPathStrategy(SourceFile:558)Â
at android.support.v4.content.FileProvider.attachInfo(SourceFile:376)Â
at android.app.ActivityThread.installProvider(ActivityThread.java:4792)Â
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4387)Â
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4327)Â
at android.app.ActivityThread.access$1500(ActivityThread.java:135)Â
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)Â
at android.os.Handler.dispatchMessage(Handler.java:102)Â
at android.os.Looper.loop(Looper.java:136)Â
at android.app.ActivityThread.main(ActivityThread.java:5019)Â
at java.lang.reflect.Method.invokeNative(Native Method)Â
at java.lang.reflect.Method.invoke(Method.java:515)Â
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)Â
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)Â
at dalvik.system.NativeStart.main(Native Method)Â
06-29 11:14:19.400 2992-2992/com.luojilab.player D/AndroidRuntime: Shutting down VM
06-29 11:14:19.400 2992-2992/com.luojilab.player W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x94c5cb20)
06-29 11:14:19.400 2992-2992/com.luojilab.player E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.luojilab.player, PID: 2992
java.lang.RuntimeException: Unable to get provider android.support.v4.content.FileProvider: java.lang.IllegalArgumentException: Missing android.support.FILE_PROVIDER_PATHS meta-data
at android.app.ActivityThread.installProvider(ActivityThread.java:4795)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4387)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4327)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5019)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: Missing android.support.FILE_PROVIDER_PATHS meta-data
at android.support.v4.content.FileProvider.parsePathStrategy(SourceFile:587)
at android.support.v4.content.FileProvider.getPathStrategy(SourceFile:558)
at android.support.v4.content.FileProvider.attachInfo(SourceFile:376)
at android.app.ActivityThread.installProvider(ActivityThread.java:4792)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4387)Â
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4327)Â
at android.app.ActivityThread.access$1500(ActivityThread.java:135)Â
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)Â
at android.os.Handler.dispatchMessage(Handler.java:102)Â
at android.os.Looper.loop(Looper.java:136)Â
at android.app.ActivityThread.main(ActivityThread.java:5019)Â
at java.lang.reflect.Method.invokeNative(Native Method)Â
at java.lang.reflect.Method.invoke(Method.java:515)Â
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)Â
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)Â
at dalvik.system.NativeStart.main(Native Method)Â
06-29 11:14:19.400 560-570/system_process W/ActivityManager: Force finishing activity com.luojilab.player/com.luojilab.business.welcome.WelcomeActivity
06-29 11:14:19.400 560-1821/system_process W/InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4a9daa38 attribute=null, token = android.os.BinderProxy@4a8c09c8
06-29 11:14:19.420 560-575/system_process D/dalvikvm: GC_FOR_ALLOC freed 228K, 15% free 8000K/9384K, paused 12ms, total 12ms
06-29 11:14:19.420 560-575/system_process I/dalvikvm-heap: Grow heap (frag case) to 8.142MB for 281892-byte allocation
06-29 11:14:19.450 560-568/system_process D/dalvikvm: GC_FOR_ALLOC freed 3K, 15% free 8272K/9660K, paused 21ms, total 21ms
The orginal apk package size is 41MB. The package used apktools to rebuild version is 36MB
@hurricanetx They apk file from the link have the size of 39 MB, not 41 MB ;/
Please provide the correct one.
$ du -hs 201805251639406027371511.apk
39M 201805251639406027371511.apk
After apktools rebuild:
$ du -hs new123.apk
31M new123.apk
@TheKalin Apk file from the link is correct. Maybe they had updated the package, but result as some as the package i used before
@hurricanetx Daym, I'm out of ideas now ;X
Looks like a new version/enhancement of AndroResGuard. I think there is a duplicate ticket of this, but not sure.
@iBotPeaches Thanks, maybe you are right. Here is the AndroResGuard source url: https://github.com/shwenzhang/AndResGuard, but how can i ensure this project used this tool.
@hurricanetx I recognize the resource directory named "r" from AndResGuard, so just what I thought this application is using for obfuscation.
@iBotPeaches 666,Thank you for your answer a lot
@hurricanetx Did you finally succeed? I'm also grabbing Dedao app's network requests.
@ripperhe No,always failed. But i'm use ssl-unpinning to catch app data
@hurricanetx Could you be more specific? Can we talk about it with WeChat? My WeChat account is hezongyi0094.
@iBotPeaches @ripperhe @TheKalin Is there any alternate method to successfully de-compile and recompile apk with such obfuscation , i mean AndResGuard.
Trying to unpack and repack Cleanmaster which is also using this ( tried with --no-res , no success)
Kotlin has nothing to do with this crash. It appears to be resource obfuscation, renaming and moving. Choking up the decoder. This is a duplicate (or at least I'm tracking it there) - https://github.com/iBotPeaches/Apktool/issues/1948
Most helpful comment
@hurricanetx If you don't need to manipulate resources in the apk , you can use a workaround and decompile apk without resources.