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

Can't roundtrip apks with fonts #1662

Closed
minsko opened this Issue Nov 15, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@minsko
Contributor

minsko commented Nov 15, 2017

Information

  1. Apktool Version (apktool -version) - 2.3.1-f7a872-SNAPSHOT (and release 2.3.0)
  2. Operating System (Mac, Linux, Windows) -Mac
  3. APK From? (Playstore, ROM, Other) - Attached

Attached is a basic sample which has a font under res/font. Apktool has issues processing it.

Stacktrace/Logcat

Decoding

I: Using Apktool 2.3.1-f7a872-SNAPSHOT on FontTest.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /Users/XXXXXXXX/Library/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
S: Could not decode file, replacing by FALSE value: font/pecita.otf
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

Building

I: Using Apktool 2.3.1-f7a872-SNAPSHOT
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: /Users/XXXXXXXX/FontTest/res/values/fonts.xml:3: error: Resource entry pecita is already defined.
W: res/font/pecita.otf:0: Originally defined here.
W: 
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/83/sh_q1wcn3w73jx47yd34lf4c0000gn/T/brut_util_Jar_1241476597711590322.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 26, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, /var/folders/83/sh_q1wcn3w73jx47yd34lf4c0000gn/T/APKTOOL5622062928118098755.tmp, -0, arsc, -0, arsc, -I, /Users/XXXXXXXX/Library/apktool/framework/1.apk, -S, /Users/XXXXXXXX/FontTest/res, -M, /Users/XXXXXXXX/FontTest/AndroidManifest.xml]
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:485)
	at brut.androlib.Androlib.buildResources(Androlib.java:419)
	at brut.androlib.Androlib.build(Androlib.java:318)
	at brut.androlib.Androlib.build(Androlib.java:270)
	at brut.apktool.Main.cmdBuild(Main.java:224)
	at brut.apktool.Main.main(Main.java:75)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/83/sh_q1wcn3w73jx47yd34lf4c0000gn/T/brut_util_Jar_1241476597711590322.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 26, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, /var/folders/83/sh_q1wcn3w73jx47yd34lf4c0000gn/T/APKTOOL5622062928118098755.tmp, -0, arsc, -0, arsc, -I, /Users/XXXXXXXX/Library/apktool/framework/1.apk, -S, /Users/XXXXXXXX/FontTest/res, -M, /Users/XXXXXXXX/FontTest/AndroidManifest.xml]
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:456)
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:471)
	... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/83/sh_q1wcn3w73jx47yd34lf4c0000gn/T/brut_util_Jar_1241476597711590322.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 26, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, /var/folders/83/sh_q1wcn3w73jx47yd34lf4c0000gn/T/APKTOOL5622062928118098755.tmp, -0, arsc, -0, arsc, -I, /Users/XXXXXXXX/Library/apktool/framework/1.apk, -S, /Users/XXXXXXXX/FontTest/FontTest/res, -M, /Users/XXXXXXXX/FontTest/AndroidManifest.xml]
	at brut.util.OS.exec(OS.java:95)
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:450)
	... 6 more

Steps to Reproduce

  1. apktool d
  2. apktool b

Frameworks

Nothing special

APK

FontTest.apk.zip

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
@minsko

This comment has been minimized.

Show comment
Hide comment
@minsko

minsko Nov 16, 2017

Contributor

I may have a fix for this.

Contributor

minsko commented Nov 16, 2017

I may have a fix for this.

minsko added a commit to minsko/Apktool that referenced this issue Nov 16, 2017

iBotPeaches added a commit that referenced this issue Nov 23, 2017

@stkent

This comment has been minimized.

Show comment
Hide comment
@stkent

stkent Nov 29, 2017

Nothing to add other than to say thanks, @minsko; I ran into this issue today and am building from master right now! 💯

stkent commented Nov 29, 2017

Nothing to add other than to say thanks, @minsko; I ran into this issue today and am building from master right now! 💯

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