-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Dex not properly decompiled/recompiled #2955
Comments
I see the library files you mentioned aren't found, so a bit confused.
I believe those all cleanly align with the files you mentioned above. What would help here is the logcat during the crash so we can see the exact error Android is throwing when resolving these shared objects. |
what I found based on exact analysis of this app was that it uses root, native lib, obfuscation, ... and I think these have caused apktool to fail at decompiling and recompiling it correctly. there is no single logcat because each step that I fix a new problem arises. for example I patched a hash checksum of dex in libbbvoip.so library using IDA pro and thought game is over but again got error related to async task and threads (monitor-enter,...) in: "smali/com/boldbeast/voiprecorder/i.smali - b() function" if libbbvoip.so isn't patched app's process will end after entering the app if dex is recompiled and I upload patched libbbvoip.so which is inside armeabi-v7a apk lib folder but for smali side best thing you can do for research on this and finding true problem is to decompile it yourself and debug using smalidea. (LogCat I got was VerifyError: Rejecting class because it failed compile-time verification for runnables I mentioned or one of them doesn't run at all and I don't know why doesn't run maybe because it has started from beggining of the app and doesn't run on click but generally they fail and need your debugging and I couldn't fully understand them) also the apk version you mentioned above is older veriosn and get newer version (2.2) from google play itself because it has split apks too. thank you very much |
Okay thanks for the detailed explanation, but reading this again I'm just not sure what to make of it. I think the summarized idea is loading native modules is having issues. I've been tracking this (albeit still unsolved) here - #2490 So I'll close this for that one |
Information
apktool -version
) - apktool_2.7.0Stacktrace/Logcat
No Stacktrace (stated in main text why there is no trace)
Steps to Reproduce
java -jar apktool_2.7.0.jar d BoldBeast_Latest_Apktool.apk -r
java -jar apktool_2.7.0.jar b BoldBeast_Latest_Apktool
Uber Signer
SAI install bundle apks (all with same signature)
Frameworks
I used framework and same problem happened and nothing changed, also faster and easier way I used was to omit resource decompiling by -r option and main problem is from dex.
APK
https://play.google.com/store/apps/details?id=com.boldbeast.voiprecorder
Questions to ask before submission
apktool d
,apktool b
without changing anything? YesHello,
there is a unique app for recording VOIP calls:
https://play.google.com/store/apps/details?id=com.boldbeast.voiprecorder
I tried to decompiled and recompile it, for resources using --use-aapt2 or -r solves it's errors but main problem is for dex part, when I use -s to not do any change to dex, the app works correctly but when I want to decompile and recompile it without any changes, problem arise and that has no error in apktool and app gets installed properly and opens propery but when I click grant root button, it crashes and there is nothing about crash in logcat so I had to debug it using smalidea and found where exactly the crash is , it's at loading a native library (which I checked and it doesn't exist in lib folder so maybe what they do is to create these libs dynamically or they make symlinks or ... becaue this is a root app and has magisk module and does things in root level that ordinary apps don't do and it has native libraries)
here is exact path to where crash happens:
"smali\com\boldbeast\voiprecorder\BBJni.smali" :
const-string v2, "bbvoip"
Line 743: invoke-static {v2}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
if I don't do any change to dex (no decompile) it works but if any decompile and recompile without any change at all, app fails at this point (I checked and there is no signature or integrity check and problem is from what I mentioned)
also I searched in all smali in \smali\com to find more native libs loading and found below ones:
"smali\com\boldbeast\base\BBBaseFunc.smali" :
const-string v1, "bbbasefunc"
Line 110: invoke-static {v1}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
"smali\com\boldbeast\voiprecorder\BBRootService.smali" :
const-string v0, "bbrecserver2"
Line 53: invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
also after recompile it mistakenly says can't get root access (becaue it can't load libs)
also checked module files and found there are native libs there too but they aren't ones loaded in above and I couldn't find libs loaded in above lines anywhere from app libs folder or modules libs folder in root and I don't know what developer does that decompile and recompile breaks it! (most likely it's some kind of root actions which ordinary apps don't do)
below is path of magisk module and libs and other files are there:
/data/adb/modules/CallRecordingFix
because I really need to decompile and recompile this app, tried to use -s -r and then decompiled and recompiled with baksmali and it's same as apktool (maybe both use same code)
I hope you work on this because this is a clear bug in decompiling and recompiling dex for native libs.
The text was updated successfully, but these errors were encountered: