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

Wrong forcedPackageId for framework-ext-res.apk from MiUI7 android 4.4.2 #1220

Closed
Hikari-no-Tenshi opened this Issue Apr 10, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@Hikari-no-Tenshi

Hikari-no-Tenshi commented Apr 10, 2016

  1. Apktool Version: 2.1.0-180728-SNAPSHOT.
  2. Operating System: Windows.
  3. APK From: MiUI7 android 4.4.2.

Decompiling APK with apktool writes wrong forcedPackageId to apktool.yml.
For framework-ext-res.apk it writes 16, but should be 17.

!!brut.androlib.meta.MetaInfo
apkFileName: framework-ext-res.apk
compressionType: false
doNotCompress:
- arsc
isFrameworkApk: true
packageInfo:
  forcedPackageId: '16'
  renameManifestPackage: com.miui.rom
sdkInfo: null
sharedLibrary: false
unknownFiles: {}
usesFramework:
  ids:
  - 1
  - 16
  tag: null
version: 2.1.0-180728-SNAPSHOT
versionInfo:
  versionCode: '1010000'
  versionName: 1.1.0.0

APK
framework-ext-res.zip

Frameworks
frameworks.zip

@BurgerZ

This comment has been minimized.

Show comment
Hide comment
@BurgerZ

BurgerZ Apr 11, 2016

Contributor

Wrong package decoding is here: https://github.com/iBotPeaches/Apktool/blob/master/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java#L173
So we'll have better results, when we cahge
ResPackage resPackage = resTable.getCurrentResPackage();
to
ResPackage resPackage = resTable.listMainPackages().iterator().next();

Contributor

BurgerZ commented Apr 11, 2016

Wrong package decoding is here: https://github.com/iBotPeaches/Apktool/blob/master/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java#L173
So we'll have better results, when we cahge
ResPackage resPackage = resTable.getCurrentResPackage();
to
ResPackage resPackage = resTable.listMainPackages().iterator().next();

@Hikari-no-Tenshi

This comment has been minimized.

Show comment
Hide comment
@Hikari-no-Tenshi

Hikari-no-Tenshi Apr 11, 2016

Thanks for hint.

Hikari-no-Tenshi commented Apr 11, 2016

Thanks for hint.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Apr 11, 2016

Owner

Took a different approach. getCurrentResPackage is used in APKs that are weird.

Owner

iBotPeaches commented Apr 11, 2016

Took a different approach. getCurrentResPackage is used in APKs that are weird.

Hikari-no-Tenshi pushed a commit to Hikari-no-Tenshi/Apktool that referenced this issue Apr 11, 2016

Hikari-no-Tenshi pushed a commit to Hikari-no-Tenshi/Apktool that referenced this issue Apr 12, 2016

Hikari-no-Tenshi pushed a commit to Hikari-no-Tenshi/Apktool that referenced this issue Apr 12, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment