Decompiling Setting.apk creates "values-ᅫ@-rES" folder #870

Closed
iBotPeaches opened this Issue Mar 18, 2015 · 12 comments

Comments

Projects
None yet
1 participant
@iBotPeaches
Owner

iBotPeaches commented Mar 18, 2015

Original issue 761 created by laura.almeida.lannister on 2015-02-17T13:35:44.000Z:

What steps will reproduce the problem?
1.apktool if framework-res.apk
2.apktool d Settings.apk

What is the expected output? What do you see instead?
values-ᅫ@-rES is created while decompiling thus we cannot build Settings

What version of the product are you using? On what operating system?
Using Apktool 2.0.0-RC4 on Windows 8.1 64-bit

Please provide any additional information below.
When i tries to decompile Setting.apk or framework-res.apk of CM12 i am getting a folder called "values-ᅫ@-rES"
Due to this folder I can't recompile
Deleting this folder would let me to recompile But the app doesn't work (with the same system signature)

Download Link for Framework and Settings ==> https://www.dropbox.com/s/4v350tkkggk1tip/Apktool%20Error.zip?dl=0

LOGS

C:\Users\Laura\Desktop\Loli>apktool if framework-res.apk
I: Framework installed to: C:\Users\Laura\apktool\framework\1.apk

C:\Users\Laura\Desktop\Loli>apktool d Settings.apk
I: Using Apktool 2.0.0-RC4 on Settings.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Laura\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values / XMLs...
I: Baksmaling classes.dex...
testI: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

C:\Users\Laura\Desktop\Loli>apktool b Settings
I: Using Apktool 2.0.0-RC4
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\Laura\Desktop\Loli\Settings\res values-?@-rES
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Laura\AppData\Local\Temp\brut_util_Jar_883642563236148147.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 21, --version-name, 5.0.2-c88e2eeec4, -F, C:\Users\Laura\AppData\Local\Temp\APKTOOL1035266375298065500.tmp, -0, arsc, -I, C:\Users\Laura\apktool\framework\1.apk, -S,
C:\Users\Laura\Desktop\Loli\Settings\res, -M, C:\Users\Laura\Desktop\Loli\Settings\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:442)
at brut.androlib.Androlib.buildResources(Androlib.java:379)
at brut.androlib.Androlib.build(Androlib.java:282)
at brut.androlib.Androlib.build(Androlib.java:255)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Laura\AppData\Local\Temp\brut_util_Jar_883642563236148147.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 21, --version-name, 5.0.2-c88e2eeec4, -F, C:\Users\Laura\AppData\Local\Temp\APKTOOL1035266375298065500.tmp, -0, arsc, -I, C:\Users\Laura\apktool\framework\1.apk, -S, C:\Users\Laura\Desktop\Loli\Settings\res, -M, C:\Users\Laura\Desktop\Loli\Settings\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:504)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:428)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\Laura\AppData\Local\Temp\brut_util_Jar_883642563236148147.tmp, p, --forced-package-id,
127, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 21, --version-name, 5.0.2-c88e2eeec4, -F, C:\Users\Laura\AppData\Local\Temp\APKTOOL1035266375298065500.tmp, -0, arsc, -I, C:\Users\Laura\apktool\framework\1.apk, -S, C:\Users\Laura\Desktop\Loli\Settings\res, -M, C:\Users\Laura\Desktop\Loli\Settings\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:498)
... 6 more

C:\Users\Laura\Desktop\Loli>

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #1 originally posted by connor.tumbleson on 2015-02-17T16:03:05.000Z:

Yep. This is a big problem.

Missed support for this in upgrade to Lollipop. We have no support for 3 letter lang codes.

https://android-review.googlesource.com/#/c/82116/
https://android-review.googlesource.com/#/c/82117/

Started working on a patch.

Owner

iBotPeaches commented Mar 18, 2015

Comment #1 originally posted by connor.tumbleson on 2015-02-17T16:03:05.000Z:

Yep. This is a big problem.

Missed support for this in upgrade to Lollipop. We have no support for 3 letter lang codes.

https://android-review.googlesource.com/#/c/82116/
https://android-review.googlesource.com/#/c/82117/

Started working on a patch.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #2 originally posted by laura.almeida.lannister on 2015-02-17T17:27:36.000Z:

Thank you so much
You are an awesome dev

Owner

iBotPeaches commented Mar 18, 2015

Comment #2 originally posted by laura.almeida.lannister on 2015-02-17T17:27:36.000Z:

Thank you so much
You are an awesome dev

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #3 originally posted by connor.tumbleson on 2015-02-17T17:40:20.000Z:

Need to add to unit-tests

en-rUS
en-sLatn-rUS
en-vPOSIX

r = 'region prefix'
s = 'script prefix'
v = 'variant prefix'

Owner

iBotPeaches commented Mar 18, 2015

Comment #3 originally posted by connor.tumbleson on 2015-02-17T17:40:20.000Z:

Need to add to unit-tests

en-rUS
en-sLatn-rUS
en-vPOSIX

r = 'region prefix'
s = 'script prefix'
v = 'variant prefix'

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #4 originally posted by connor.tumbleson on 2015-02-17T23:22:25.000Z:

#100

WIP

Owner

iBotPeaches commented Mar 18, 2015

Comment #4 originally posted by connor.tumbleson on 2015-02-17T23:22:25.000Z:

#100

WIP

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #6 originally posted by connor.tumbleson on 2015-02-25T23:03:06.000Z:

This has been fixed as of: #100

Since this was a BIG change to underlying code. I've made a snapshot build below. You may use and test the change before the next public release.

Owner

iBotPeaches commented Mar 18, 2015

Comment #6 originally posted by connor.tumbleson on 2015-02-25T23:03:06.000Z:

This has been fixed as of: #100

Since this was a BIG change to underlying code. I've made a snapshot build below. You may use and test the change before the next public release.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #7 originally posted by laura.almeida.lannister on 2015-03-01T03:29:08.000Z:

Thanks
All working perfectly fine now

Owner

iBotPeaches commented Mar 18, 2015

Comment #7 originally posted by laura.almeida.lannister on 2015-03-01T03:29:08.000Z:

Thanks
All working perfectly fine now

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #8 originally posted by keerthy.tech on 2015-03-11T18:25:11.000Z:

Hi there! I encountered the same issue. And on updating the old apktool_2.0.0rc4.jar with apktool-2.0.0-f8d153-SNAPSHOT-small.jar, now I'm not able to decompile the apk at all. I see the below error:
I: Using Apktool 2.0.0-f8d153-SNAPSHOT on xxhdpi_normal_1_nondebug.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:52)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:621)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:73)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:65)
at brut.androlib.Androlib.getResTable(Androlib.java:63)
at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:209)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:92)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
Caused by: java.io.IOException: Expected: 0x00000008, got: 0x00000000
at brut.util.ExtDataInput.skipCheckShort(ExtDataInput.java:56)
at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:237)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:200)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:188)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:156)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:113)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:78)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
... 8 more

Owner

iBotPeaches commented Mar 18, 2015

Comment #8 originally posted by keerthy.tech on 2015-03-11T18:25:11.000Z:

Hi there! I encountered the same issue. And on updating the old apktool_2.0.0rc4.jar with apktool-2.0.0-f8d153-SNAPSHOT-small.jar, now I'm not able to decompile the apk at all. I see the below error:
I: Using Apktool 2.0.0-f8d153-SNAPSHOT on xxhdpi_normal_1_nondebug.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:52)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:621)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:73)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:65)
at brut.androlib.Androlib.getResTable(Androlib.java:63)
at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:209)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:92)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
Caused by: java.io.IOException: Expected: 0x00000008, got: 0x00000000
at brut.util.ExtDataInput.skipCheckShort(ExtDataInput.java:56)
at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:237)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:200)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:188)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:156)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:113)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:78)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
... 8 more

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #9 originally posted by connor.tumbleson on 2015-03-11T18:31:54.000Z:

Not sure. Check how many bytes are in the ResConfig header or upload the apk.

Owner

iBotPeaches commented Mar 18, 2015

Comment #9 originally posted by connor.tumbleson on 2015-03-11T18:31:54.000Z:

Not sure. Check how many bytes are in the ResConfig header or upload the apk.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #10 originally posted by connor.tumbleson on 2015-03-11T18:31:54.000Z:

Not sure. Check how many bytes are in the ResConfig header or upload the apk.

Owner

iBotPeaches commented Mar 18, 2015

Comment #10 originally posted by connor.tumbleson on 2015-03-11T18:31:54.000Z:

Not sure. Check how many bytes are in the ResConfig header or upload the apk.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #11 originally posted by keerthy.tech on 2015-03-11T18:42:07.000Z:

Can you please tell me how I can check on the ResConfig header?

Owner

iBotPeaches commented Mar 18, 2015

Comment #11 originally posted by keerthy.tech on 2015-03-11T18:42:07.000Z:

Can you please tell me how I can check on the ResConfig header?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #12 originally posted by keerthy.tech on 2015-03-11T19:06:20.000Z:

Guess I figured why. When I decompiled the apk it did not add the all framework ids in android.yml. So it was freaking out. After adding the ids in android.yml, it worked just fine. Thank you for the tool! :)

Owner

iBotPeaches commented Mar 18, 2015

Comment #12 originally posted by keerthy.tech on 2015-03-11T19:06:20.000Z:

Guess I figured why. When I decompiled the apk it did not add the all framework ids in android.yml. So it was freaking out. After adding the ids in android.yml, it worked just fine. Thank you for the tool! :)

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