objection
objection copied to clipboard
[bug] Bug <some class> has already been interned
Describe the bug
When trying to patch an APK with frida + a script, it won't work because "
To Reproduce Steps to reproduce the behavior: Run the commands below:
wget https://f1gh7.club/objection-issue-files.zip
unzip objection-issue-files.zip
objection patchapk -c libfrida-gadget.config.so -l libfrida-gadget.script.so -s *-MENU-ALIGNED.apk -a arm64
Similar issues Could not find any.
Expected behavior I expected for frida + script to be injected into the APK, but when I installed and tried it, that was not the case.
Evidence / Logs / Screenshots
$ objection patchapk -c libfrida-gadget.config.so -l libfrida-gadget.script.so -s com.example.someapk-MENU-ALIGNED.apk -a arm64
Using latest Github gadget version: 16.1.4
Patcher will be using Gadget version: 16.1.4
Detected apktool version as: 2.8.1
Running apktool empty-framework-dir...
Unpacking com.kiloo.subwaysurf_3.18.1-MENU-ALIGNED.apk
App already has android.permission.INTERNET
Target class not specified, searching for launchable activity instead...
Smali not found in smali directory. This might be a multidex APK. Searching...
Found smali at: /tmp/tmpogz3ztm0.apktemp/smali_classes3/com/<someone>/chili/multidex/ChiliMultidexSupportActivity.smali
Reading smali from: /tmp/tmpogz3ztm0.apktemp/smali_classes3/com/<someone>/chili/multidex/ChiliMultidexSupportActivity.smali
Injecting loadLibrary call at line: 10
Attempting to fix the constructors .locals count
Current locals value is 0, updating to 1:
Writing patched smali back to: /tmp/tmpogz3ztm0.apktemp/smali_classes3/com/<someone>/chili/multidex/ChiliMultidexSupportActivity.smali
Creating library path: /tmp/tmpogz3ztm0.apktemp/lib/arm64
Copying Frida gadget to libs path...
Adding a gadget configuration file...
Copying over a custom script to use with the gadget config.
Rebuilding the APK with the frida-gadget loaded...
Rebuilding the APK may have failed. Read the following output to determine if apktool actually had an error:
../../../../../tmp/tmpogz3ztm0.apktemp/smali_assets/kotlin/SinceKotlin.smali[63,52] Class Lkotlin/SinceKotlin; has already been interned
Could not smali file: kotlin/SinceKotlin.smali
Built new APK with injected loadLibrary and frida-gadget
Performing zipalign
Zipalign completed
Signing new APK.
Signed the new APK
Copying final apk from /tmp/tmpogz3ztm0.apktemp.aligned.objection.apk to com.example.someapk-MENU-ALIGNED.objection.apk in current directory...
Cleaning up temp files...
Environment (please complete the following information):
- Device: Android 13 (arm64, target)
- OS: Linux (x64, host)
- Frida Version 16.1.4
- Objection Version 1.11.0
Application Download of APK + config + script: https://f1gh7.club/objection-issue-files.zip
Additional context
This started happening after I recompiled an APK with custom classes for making a menu inserted at smali_classes3, and compiling with apktool. I don't know if it has anything to do with it, but who knows.