question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

APKTOOL_DUMMY (again): clarifications needed

See original GitHub issue

Using 2.4.0, decompiling and re-building the (un-modified) medium application is a smooth process, but the APK is just crashing because of some missing resources:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.medium.reader/com.medium.android.donkey.start.SplashActivity}: android.content.res.Resources$NotFoundException: Drawable com.medium.reader:drawable/splash_background with resource ID #0x7f080188

Obviously, that splash_background.xml file is present in both the original and the rebuilt APK, but the latter is referencing an APKTOOL_DUMMY resource:

<?xml version="1.0" encoding="utf-8"?>
...
    <item android:top="@dimen/sign_in_wordmark_vertical_padding">
        <bitmap android:gravity="top" android:src="@drawable/APKTOOL_DUMMY_161" />
    </item>
</layer-list>

I know this has been discussed in #1773 and #1117, but I’m still not getting why apktool would be unable to decode some resources if they’re known to be both present AND used?

Sounds like an apktool bug, rather than some missing or invalid resources.

Any clarifications?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
AyraHikaricommented, Feb 19, 2020

You need to grab splitted APK in /data/app/com.app/*.apk or export with SAI app.

  • Decompile all apk (if it was SAI exported apks, open as zip then extract apk)
  • Merge all files except values to real APK one, and don’t replace anything in here
  • Instead of replace files, you need to merge/replace string files
  • Open both values folder, replace DUMMY to REAL ony Example: <public type="drawable" name="APKTOOL_DUMMY_b" id="0x7f07000b" /> Replace to <public type="drawable" name="abc_btn_check_to_on_mtrl_000" id="0x7f07000b" /> By search from public id 0x7f07000b
  • Don’t forget to replace DUMMY in any XML files (drawable or styles dir, or etc)
  • Edit AndroidManifest.xml, delete android:isSplitRequired="true" at application tag
  • Then try recompile, and install
  • If apk was force close, check log and check what wrong in there
0reactions
DieHertzcommented, Sep 9, 2022

I know it’s a bit old, but could you elaborate here?

Merge all files except values to real APK one, and don’t replace anything in here

I wrote a script which does resolving APKTOOL_DUMMY_ names across split APK contents, and also copies all the files into base without overwriting anything, but I didn’t omit files like values-hdpi/styles.xml and values-xhdpi/drawables.xml, and ended up with app crashing when trying to find drawables defined in the latter. Removing them solved this issue, but I don’t quite understand why, nor why these files are there at all. Were they part of original project or it’s just an artifact or quirk of apktool?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[TOOL] Tickle My Android - Decompile & Recompile With Ease
The issue regarding apktool dummy values has been solved in apktool v2.5.0! I've seen a lot of posts here complaining about the issue,...
Read more >
Why can't I get the source code by apktool? - Stack Overflow
I think you can get full source code from apk using "APK Easy Tool". Of course, it's impossible ...
Read more >
apk tools - How to create alpine package without git?
Asking for help, clarification, or responding to other answers. · Making statements based on opinion; back them up with references or personal ...
Read more >
Malicious Android Applications: Risks and Exploitation - GIAC
Several malicious applications, ranging from fake banking applications ... required by the application, is bundled into an Android package ...
Read more >
eu-15-Lin-Androbugs-Framework-An-Android-Application ...
Repackaging APK and Hacking with AndroBugs Framework. • Conclusions ... both need to specify the same “android:sharedUserId” ... Made Again and Again…
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found