Skip to content
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

Cannot invoke "com.reandroid.arsc.value.Entry.isScalar()" because "item" is null #151

Open
SchrodingersNeko749 opened this issue Dec 7, 2024 · 2 comments

Comments

@SchrodingersNeko749
Copy link

SchrodingersNeko749 commented Dec 7, 2024

Describe the bug
Running APKEditor with any of the options in any modes besides info generates a NullPointerException in the main thread almost immediately.

To Reproduce
Steps to reproduce the behavior:

  1. Used version 'APKEditor-1.4.1.'
  2. Operating system 'Windows 10'
  3. Command 'java -jar APKEditor-1.4.1.jar d -i .\myapp.apk' However using all options this still fails

Log/Stacktrace

java.lang.NullPointerException: Cannot invoke "com.reandroid.arsc.value.Entry.isScalar()" because "item" is null
        at com.reandroid.apk.ApkModule.lambda$filterResFileEntries$1(ApkModule.java:648)
        at com.reandroid.arsc.item.StringItem.lambda$getUsers$0(StringItem.java:77)
        at com.reandroid.utils.collection.ComputeIterator.getNext(ComputeIterator.java:52)
        at com.reandroid.utils.collection.ComputeIterator.hasNext(ComputeIterator.java:38)
        at com.reandroid.utils.collection.CollectionUtil.toList(CollectionUtil.java:180)
        at com.reandroid.apk.ApkModule.filterResFileEntries(ApkModule.java:657)
        at com.reandroid.apk.ApkModule.listResFiles(ApkModule.java:595)
        at com.reandroid.apk.ApkModule.listResFiles(ApkModule.java:581)
        at com.reandroid.apkeditor.protect.DirectoryConfuser.confuse(DirectoryConfuser.java:44)
        at com.reandroid.apkeditor.protect.Protector.runCommand(Protector.java:59)
        at com.reandroid.apkeditor.Options.runCommand(Options.java:59)
        at com.reandroid.apkeditor.Main.run(Main.java:136)
        at com.reandroid.apkeditor.Main.execute(Main.java:72)
        at com.reandroid.apkeditor.Main.main(Main.java:57)

Used apk file
I Cannot disclose the name of the app due to NDA contract. but this app is a real piece of work with multiple layers of obfuscation.

Additional context
apktool can decompile this but fails to recompile because of the DUMMY VALUE in the assets and the obfuscated resources. (this is my best guess so far).

@REAndroid
Copy link
Owner

I believe this issue is already fixed on this Commit, try with latest build from here

@SchrodingersNeko749
Copy link
Author

Thanks a lot, using the new commit I was able to both decompile and recompile the app. Can you summarize how you bypass the resource obfuscation issue? I have tried everything and failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants