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

AAPT Issues (?) with Samsung framework-res #1258

Closed
Jertlok opened this Issue May 27, 2016 · 15 comments

Comments

Projects
None yet
4 participants
@Jertlok

Jertlok commented May 27, 2016

Hello there, i'm trying to theme my Samsung Framework-res.apk, but one magical glitch stopped me and led me dig for it. I'll attach the error that apktool gives me, it seems to be an AAPT issue on some PNGs but this is not the main issue since it can be manually fixed changing their name - (no more errors are thrown after those manual renaming). Basically, changing the windowBackground color to black, made me noticing that somehow a red glitch on WiFi texts was magically appearing.
Album@Imgur - in order to keep this bug report clean and small.
My first move, in order to try fixing the issue, has been to set EVERYTHING from SecSettings.apk and framework-res.apk into transparent (#00000000) using regular expressions to match every colors and item lines (found in all their XML files) placing (at)android:color/transparent, but yet some wifi labels were still there.
AAPT issues perhaps?

Thanks in advance, cheers.

Information

  1. Apktool Version (2.1.1) -
  2. Operating System (Windows) -
  3. APK From? (ROM) -

Stacktrace/Logcat

Decompilation:

I: Using Apktool 2.1.1 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...

Compilation

I: Using Apktool 2.1.1
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
W: C:\Users\Jertlok\Desktop\apkbench\framework-res\res\drawable-sw360dp-xxxhdpi-v13\ic_knox_badge.PNG: error: File is case-insensitive equivalent to: C:\Users\Jertlok\Desktop\apkbench\framework-res\res\drawable-hdpi-v4\ic_knox_badge.png
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Jertlok\AppData\Local\Temp\brut_util_Jar_1442071662568735255.tmp, p, --forced-package-id, 1, --min-sdk-version, 23, --target-sdk-version, 23, --version-code, 23, --version-name, 6.0.1, -F, C:\Users\Jertlok\AppData\Local\Temp\APKTOOL2743732649485842444.tmp, -x, -0, arsc, -0, PNG, -0, arsc, -S, C:\Users\Jertlok\Desktop\apkbench\framework-res\res, -M, C:\Users\Jertlok\Desktop\apkbench\framework-res\AndroidManifest.xml]
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:437)
        at brut.androlib.Androlib.buildResources(Androlib.java:371)
        at brut.androlib.Androlib.build(Androlib.java:281)
        at brut.androlib.Androlib.build(Androlib.java:254)
        at brut.apktool.Main.cmdBuild(Main.java:224)
        at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Jertlok\AppData\Local\Temp\brut_util_Jar_1442071662568735255.tmp, p, --forced-package-id, 1, --min-sdk-version, 23, --target-sdk-version, 23, --version-code, 23, --version-name, 6.0.1, -F, C:\Users\Jertlok\AppData\Local\Temp\APKTOOL2743732649485842444.tmp, -x, -0, arsc, -0, PNG, -0, arsc, -S, C:\Users\Jertlok\Desktop\apkbench\framework-res\res, -M, C:\Users\Jertlok\Desktop\apkbench\framework-res\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:436)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:423)
        ... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Jertlok\AppData\Local\Temp\brut_util_Jar_1442071662568735255.tmp, p, --forced-package-id, 1, --min-sdk-version, 23, --target-sdk-version, 23, --version-code, 23, --version-name, 6.0.1, -F, C:\Users\Jertlok\AppData\Local\Temp\APKTOOL2743732649485842444.tmp, -x, -0, arsc, -0, PNG, -0, arsc, -S, C:\Users\Jertlok\Desktop\apkbench\framework-res\res, -M, C:\Users\Jertlok\Desktop\apkbench\framework-res\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:95)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:430)
        ... 6 more

Steps to Reproduce

  1. apktool d framework-res.apk
  2. apktool b framework-res.apk

Frameworks

framework-res.apk from Samsung Galaxy Note 4 MM Stock ROM
framework-res.zip@GDrive - uploaded on Google Drive due to its size

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything?
    Yes, and it gives me some errors related to PNGs during the re-compilation.
  2. If you are trying to install a modified apk, did you resign it?
    I'm not installing the application via a normal installation procedure because it's a framework-res.apk (System).
  3. Are you using the latest apktool version?
    Yes, i'm using the version downloadable from here ApkTool Download Link.
@Jertlok

This comment has been minimized.

Show comment
Hide comment
@Jertlok

Jertlok May 27, 2016

Similar to #1026
But let's see what you think about the second issue ;)

Jertlok commented May 27, 2016

Similar to #1026
But let's see what you think about the second issue ;)

iBotPeaches added a commit that referenced this issue May 31, 2016

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches May 31, 2016

Owner

Fixed the PNG issue. Still not sure what I should be looking at in terms of where the problem may be at. Might need to refresh my aapt knowledge especially in regards to how it handles colors.

Owner

iBotPeaches commented May 31, 2016

Fixed the PNG issue. Still not sure what I should be looking at in terms of where the problem may be at. Might need to refresh my aapt knowledge especially in regards to how it handles colors.

@Jertlok

This comment has been minimized.

Show comment
Hide comment
@Jertlok

Jertlok Jun 1, 2016

I've seen your new commit, pretty simple workaround!
Thank you very much!
Maybe the situation will change with the hypotetical new AAPT.

Jertlok commented Jun 1, 2016

I've seen your new commit, pretty simple workaround!
Thank you very much!
Maybe the situation will change with the hypotetical new AAPT.

@micky387

This comment has been minimized.

Show comment
Hide comment
@micky387

micky387 Jun 2, 2016

Hello.
No need to fix anything. Just rename your xxx.PNG to xxx.png.

regards

micky387 commented Jun 2, 2016

Hello.
No need to fix anything. Just rename your xxx.PNG to xxx.png.

regards

@Jertlok

This comment has been minimized.

Show comment
Hide comment
@Jertlok

Jertlok Jun 4, 2016

Yeah mate, thanks for your reply but i stated it too inside my bug report.
Though iBotPeaches came with a simple workaround ;)

Jertlok commented Jun 4, 2016

Yeah mate, thanks for your reply but i stated it too inside my bug report.
Though iBotPeaches came with a simple workaround ;)

@micky387

This comment has been minimized.

Show comment
Hide comment
@micky387

micky387 Jun 4, 2016

ok sorry,i dont saw it.

micky387 commented Jun 4, 2016

ok sorry,i dont saw it.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Aug 9, 2016

Owner

Sorry for delay. 2.2.0 introduces this commit - a684bae which properly handles @empty references. I believe this was the cause to the above errors if you could give it another shot.

Owner

iBotPeaches commented Aug 9, 2016

Sorry for delay. 2.2.0 introduces this commit - a684bae which properly handles @empty references. I believe this was the cause to the above errors if you could give it another shot.

@Jertlok

This comment has been minimized.

Show comment
Hide comment
@Jertlok

Jertlok Aug 9, 2016

Hello, iBotPeaches, unfortunately i switched to a Nexus 6P some days ago but i'm still inside plenty of Note 4 communities, i'll ask them to test this for you.

Jertlok commented Aug 9, 2016

Hello, iBotPeaches, unfortunately i switched to a Nexus 6P some days ago but i'm still inside plenty of Note 4 communities, i'll ask them to test this for you.

@rakeshraimca

This comment has been minimized.

Show comment
Hide comment
@rakeshraimca

rakeshraimca Sep 7, 2016

Hello, iBotPeaches, Sorry to say but this issue still appears while recompiling my framework-res file . i am using latest framework.jar file patched by you..but still i am getting same issue

"

framework-res\res\drawable-sw360dp-xxxhdpi-v13\ic_knox_badge.PNG: error: File is case-insensitive equivalent to:"

here is my framework-res file: https://drive.google.com/open?id=0B5yEFQJPxvK6ZGMtNUdRXzVhOEE

any workaround for this?

rakeshraimca commented Sep 7, 2016

Hello, iBotPeaches, Sorry to say but this issue still appears while recompiling my framework-res file . i am using latest framework.jar file patched by you..but still i am getting same issue

"

framework-res\res\drawable-sw360dp-xxxhdpi-v13\ic_knox_badge.PNG: error: File is case-insensitive equivalent to:"

here is my framework-res file: https://drive.google.com/open?id=0B5yEFQJPxvK6ZGMtNUdRXzVhOEE

any workaround for this?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Sep 7, 2016

Owner

@rakeshraimca Did you decode it with 2.2.0 as well? That warning you posted goes against patches that directly went into 2.2.0.

Owner

iBotPeaches commented Sep 7, 2016

@rakeshraimca Did you decode it with 2.2.0 as well? That warning you posted goes against patches that directly went into 2.2.0.

@rakeshraimca

This comment has been minimized.

Show comment
Hide comment
@rakeshraimca

rakeshraimca Sep 8, 2016

I am using 2.1.1 version apktool..i decoded with that version

rakeshraimca commented Sep 8, 2016

I am using 2.1.1 version apktool..i decoded with that version

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@rakeshraimca

This comment has been minimized.

Show comment
Hide comment
@rakeshraimca

rakeshraimca Sep 8, 2016

let me try with latest 2.2 ...will update here shortly

rakeshraimca commented Sep 8, 2016

let me try with latest 2.2 ...will update here shortly

@rakeshraimca

This comment has been minimized.

Show comment
Hide comment
@rakeshraimca

rakeshraimca Sep 8, 2016

Yes its working now..sorry my bad..

rakeshraimca commented Sep 8, 2016

Yes its working now..sorry my bad..

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Dec 24, 2016

Owner

Okay, so I am under belief this has since been fixed. Original OP couldn't test, but someone with similar issue after using the 2.2.0 binary confirmed the problem was resolved.

This should have been in 2.2.0 patch notes, but I forgot to add changelog entry for this. Closing this now. If this appears to be broken, just leave another comment.

Owner

iBotPeaches commented Dec 24, 2016

Okay, so I am under belief this has since been fixed. Original OP couldn't test, but someone with similar issue after using the 2.2.0 binary confirmed the problem was resolved.

This should have been in 2.2.0 patch notes, but I forgot to add changelog entry for this. Closing this now. If this appears to be broken, just leave another comment.

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