-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file #1131
Comments
Looks like duplicate of #1121 , but I haven't got an APK for either. |
I'm getting the same issue on the new TW M builds with the latest apktool release and master branch:
Apk: https://www.dropbox.com/s/i80xi2uyjlfttji/framework-res.apk?dl=0 |
@wanam |
@mythtrandyr Nice catch, 2.0.0 is working fine. |
Confirmed. |
Yeah this is strange and regression. I thought the problem occurred during my massive changes in Working on a fix. |
I have a similar issue. Would an additional APK sample help? |
@iBotPeaches Having the same issue with the Galaxy S7. I can install and decompile frameworks and secsettings with 2.0.0, other apks get the same error as above. If I switch to 2.0.3 or build form source, after installing frameworks, I receive a non stop entire apk of the following error (SecContacts was used in screenshot. Terminal wouldnt let me copy) screenshot- https://drive.google.com/file/d/0B3FpYTXXDE_ARTlVYWtsM2o2R3M/view?usp=sharing apks- https://drive.google.com/file/d/0B3FpYTXXDE_AbjF0NEpqNEQ2a1E/view?usp=sharing |
This broke because of this commit - 6ee029d If we revert this commit we break #924 On this bug. 76 bytes read (reverted) = good. On #924 So patch or not something gets broken. I need to figure out why this is, but I now know the problem. Sorry for the delay. |
Any update on this @iBotPeaches ? |
Unfortunately nothing easy. Like I had expected, simply reverting the commit that caused the problem this far down the commit line doesn't work. Trying to make this work with the current codebase I don't think is the best method of attack as tons of refactoring has occurred around it. We just have big problem in which some APKs rely on reading the remaining bytes in a ResConfig while others rely on skipping the reading of these extra bytes. This is a combination of |
Okay spent a good deal of time this weekend on this. While I don't have a fix, I have good news. I've isolated the problem down to this struct - https://github.com/android/platform_frameworks_base/blob/master/include/androidfw/ResourceTypes.h#L897 Before that function runs we are position 20 (byte) of the reader, at the end of it. We are at 72. 72 - 20 = 52 bytes.
That is exactly whats expected, so the problem doesn't make much sense. Before this function runs we have - Apktool/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java Line 171 in 6ee029d
Or The entire time I spent looking for the missing 4 bytes I failed. Skipping these bytes might prove to cause a problem, but we know the mistake happens at this struct - https://github.com/android/platform_frameworks_base/blob/master/include/androidfw/ResourceTypes.h#L897 You can compare that struct to our reading here - Apktool/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java Line 266 in 6ee029d
After multiple multiple checks, there is no error there. So the fix. Currently our Couple notes
|
Due to the complexity of this change. I'll need to test this a lot more, but it is working for the test suite and the original apk here. So thats good news. |
The other application in this thread. Proving both work with this patch. I'll clean it up and merge it in over the weekend / tonight. |
Sorry to be a pain and open an old bug report, I'm having the same issue with the Sony Select APK.
EDIT: scrap that, remove the |
Not sure @hoshsadiq , couldn't duplicate with |
Very odd hm. I'll try and replicate it again and tie down the causes if you'd like! Will report back. I think it may be because I was giving it a path as a value for |
I have a similar issue. After i deleted resources.arsc, it passed. |
Log For : app.apk Log Type : Recompiling Log Recorded At : 12 2018-01- 2:02:12,15 Log Recorded By : Advanced ApkTool v4.2.0 By BDFreak W: C:\Users\pc\Desktop\AdvancedApkTool\3-Out\app.apk\AndroidManifest.xml:17: error: No resource identifier found for attribute 'roundIcon' in package 'android' |
Since 2.5.1 has not released, I worked-around with this tutorial. Hope it helps someone. |
Still not fixed in 2.7.1 |
@iBotPeaches getting the following error in the version 2.9.0. is this issue related to it?
APK file : https://www.dropbox.com/scl/fo/5wymbvrd8nnpz0jrl74yz/h?rlkey=wzz6puinj0bwfukduuuktbcao&dl=0 |
@harsh-im - It is not. You have an archive (zip) that is being rejected by the increasing validation that the Zip Class offers in Java. Now AOSP/Android might accept it, but stricter Java validation may not. What you are encountering is basically this ticket - #2553, but there is no good workaround at the moment as only option is to build a Zip class that doesn't invoke all the same criteria during parsing. |
Thank you for getting back to me quickly, @iBotPeaches. You mentioned that the error is caused by stricter validation in the Zip class in some newer Java versions. Based on the discussion in ticket #2553, can I resolve this issue by switching to a different Java version when using apktool? |
Maybe? The LTS versions were patched as well. |
The text was updated successfully, but these errors were encountered: