sensepost / objection

📱 objection - runtime mobile exploration
GNU General Public License v3.0
7.6k stars 859 forks source link

[bug] Cannot install patched split apk (apks) #425

Closed rypz79 closed 4 years ago

rypz79 commented 4 years ago

Describe the bug Following this tutorial, I got a split apk

roey@HP-Spectre-x360-13:~/ApkProjects$ adb shell pm path com.goldtouch.ynet
package:/data/app/com.goldtouch.ynet-qbwggjZ6lz65HoS35SuAGw==/base.apk
package:/data/app/com.goldtouch.ynet-qbwggjZ6lz65HoS35SuAGw==/split_config.arm64_v8a.apk
package:/data/app/com.goldtouch.ynet-qbwggjZ6lz65HoS35SuAGw==/split_config.en.apk
package:/data/app/com.goldtouch.ynet-qbwggjZ6lz65HoS35SuAGw==/split_config.xxhdpi.apk

So I decided to get an apks using LuckyPatcher backup, then using AntiSplit merge it (.apks->.apk) Then patch the apk:

roey@HP-Spectre-x360-13:~/ApkProjects$ objection patchapk --source ynet_v6.79-b162.apk 
No architecture specified. Determining it using `adb`...
Detected target device architecture as: arm64-v8a
Using latest Github gadget version: 14.0.8
Patcher will be using Gadget version: 14.0.8
Detected apktool version as: 2.4.1
Running apktool empty-framework-dir...
I: Removing 1.apk framework file...
Unpacking ynet_v6.79-b162.apk
App already has android.permission.INTERNET
Setting extractNativeLibs to true...
Target class not specified, searching for launchable activity instead...
Reading smali from: /tmp/tmpoexmxfqf.apktemp/smali/com/goldtouch/ynet/ui/activities/SplashActivity.smali
Injecting loadLibrary call at line: 47
Attempting to fix the constructors .locals count
Current locals value is 0, updating to 1:
Writing patched smali back to: /tmp/tmpoexmxfqf.apktemp/smali/com/goldtouch/ynet/ui/activities/SplashActivity.smali
Copying Frida gadget to libs path...
Rebuilding the APK with the frida-gadget loaded...
Built new APK with injected loadLibrary and frida-gadget
Signing new APK.
Signed the new APK
Performing zipalign
Zipalign completed
Copying final apk from /tmp/tmpoexmxfqf.apktemp.aligned.objection.apk to ynet_v6.79-b162.objection.apk in current directory...
Cleaning up temp files...

Moved it to the my rooted android device -> installed the apk -> run it...it hangs (Tried cleaning DATA) When I opened playstore I noticed that he wants to upgrade the app

Expected behavior The patched app should be running in my android device

Environment (please complete the following information):

Application Ynet Newspaper ynet_v6.79-b162.objection.zip

leonjza commented 4 years ago

Duplicate of #358. Check out https://github.com/NickstaDB/patch-apk to help with the patching process.