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.

[BUG] invalid package ID 0x01. Must be in the range 0x7f-0xff..

See original GitHub issue

Information

  1. Apktool Version (apktool -version) - 2.5.0
  2. Operating System (Mac, Linux, Windows) - Same on all 3, tested on Windows, Linux and Mac
  3. APK From? (Playstore, ROM, Other) - Stock ROM for Alldocube iPlay 30

Stacktrace/Logcat

root@dMe:/mnt/e# java -jar apktool_2.5.0.jar d framework-res.apk --use-aapt2
I: Using Apktool 2.5.0 on framework-res.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

root@dMe:/mnt/e# java -jar apktool_2.5.0.jar b framework-res --use-aapt2
I: Using Apktool 2.5.0
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
W: error: invalid package ID 0x01. Must be in the range 0x7f-0xff..
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_1733501279999439899848001132792844792.tmp, link, -o, /tmp/APKTOOL9797823588068534639.tmp, --package-id, 1, --min-sdk-version, 29, --target-sdk-version, 29, --version-code, 29, --version-name, 10, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, -x, -e, /tmp/APKTOOL1126151149898017191.tmp, -0, arsc, --manifest, /mnt/e/framework-res/AndroidManifest.xml, /mnt/e/framework-res/build/resources.zip]

Steps to Reproduce

  1. java -jar apktool_2.5.0.jar if framework-res.apk
  2. java -jar apktool_2.5.0.jar if mediatek-res.apk
  3. java -jar apktool_2.5.0.jar d framework-res.apk --use-aapt2
  4. java -jar apktool_2.5.0.jar b framework-res --use-aapt2

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files (.apks that live in /system/framework or /system/priv-app)

framework-res.zip mediatek-res.zip

APK

If this APK can be freely shared, please upload/attach a link to it.

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? Yes
  2. If you are trying to install a modified apk, did you resign it? N/A
  3. Are you using the latest apktool version? Yes

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pashamcrcommented, Jan 31, 2021

@dumle11 Yes, you’re right, aapt2 is still used without this patch. But you can take a look at my profile.

0reactions
RDPCodercommented, Jun 30, 2022

@pashamcr first of all, sorry for taking so long to reply. Didn’t have time for the past 2 days and started downloading AOSP yesterday, but didn’t finish.

I have tested the binaries you have provided and now I can confirm I can successfully rebuild the framework-res. Thanks a milion for your help and have a nice week guys!

I: Using Apktool 2.6.1 W: Could not find sources I: Checking whether resources has changed… I: Building resources… W: warn: invalid package ID 0x01. Must be in the range 0x7f-0xff. Ignoring… I: Building apk file… I: Copying unknown files/dir… I: Built apk…

Read more comments on GitHub >

github_iconTop Results From Across the Web

[UTIL][FEB 26, 2022] Apktool - Tool for reverse engineering ...
W: error: invalid package ID 0x01. Must be in the range 0x7f-0xff.. brut.androlib.AndrolibException: brut.common.
Read more >
tools/aapt2/cmd/Link.cpp - platform/frameworks/base
A custom delegate that generates compatible pre-O IDs for use with feature splits. // Feature splits use package IDs > 7f, which in...
Read more >
Android resource linking failed AAPT: unknown option
n --package-id arg Specify the package ID to use for this app. Must be greater or equal to\n 0x7f and can't be used...
Read more >
Viewing online file analysis results for 'aapt2.exe'
" is a repeated message. Repeated message options must be initialized using an aggregate value. Ansi based on Memory/File Scan ( ...
Read more >
RFC 9113 - HTTP/2 - IETF Datatracker
The "h2c" protocol identifier MUST NOT be sent by a client or selected by a ... MUST treat an invalid connection preface as...
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