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

Add support for new resources qualifiers. #176

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

Comments

Projects
None yet
1 participant
@iBotPeaches
Owner

iBotPeaches commented Mar 18, 2015

Original issue 65 created by bufane on 2010-06-23T08:06:28.000Z:

What steps will reproduce the problem?
1.i copy my framework-res.apk from system/framework
2.i want to decoding framework-res.apk and customize start anim

What is the expected output? What do you see instead?
C:\apktool-install-windows-2.1_r01-1>apktool d framework-res.apk 234
I: Loading resource table...
W: Config size > 32
W: Config size > 32
W: Config size > 32
W: Config size > 32
W: Config size > 32
W: Config size > 32
W: Config size > 32
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources:
spec=0x01030000 style/Animation, config=[DEFAULT]
at brut.androlib.res.data.ResConfig.addResource(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readType(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readTable(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.decode(Unknown Source)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(Unknown Sou
rce)
at brut.androlib.res.AndrolibResources.loadMainPkg(Unknown Source)
at brut.androlib.res.AndrolibResources.getResTable(Unknown Source)
at brut.androlib.Androlib.getResTable(Unknown Source)
at brut.androlib.ApkDecoder.getResTable(Unknown Source)
at brut.androlib.ApkDecoder.decode(Unknown Source)
at brut.apktool.Main.cmdDecode(Unknown Source)
at brut.apktool.Main.main(Unknown Source)

What version of the product are you using? On what operating system?
android 1.6

Please provide any additional information below.
i see you wiki,and read FrameworkFiles. But the problem is not resolved, please help me Thank you.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #1 originally posted by bufane on 2010-06-23T08:15:44.000Z:

What version of the product are you using? On what operating system?
android 1.6
Apktool v1.3.1,
Windows Xp sp3 x86.

Owner

iBotPeaches commented Mar 18, 2015

Comment #1 originally posted by bufane on 2010-06-23T08:15:44.000Z:

What version of the product are you using? On what operating system?
android 1.6
Apktool v1.3.1,
Windows Xp sp3 x86.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #2 originally posted by Brut.alll on 2010-06-23T08:52:35.000Z:

Yeah, I know, what it is. Thanks for reporting it :-)

Owner

iBotPeaches commented Mar 18, 2015

Comment #2 originally posted by Brut.alll on 2010-06-23T08:52:35.000Z:

Yeah, I know, what it is. Thanks for reporting it :-)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #3 originally posted by Brut.alll on 2010-08-28T15:52:07.000Z:

<empty>

Owner

iBotPeaches commented Mar 18, 2015

Comment #3 originally posted by Brut.alll on 2010-08-28T15:52:07.000Z:

<empty>

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #4 originally posted by Brut.alll on 2010-08-29T18:58:24.000Z:

I have updated apktool to support Froyo resource qualifiers, but still config flags occupy 32 bytes max. There is no info about flags exceeding 32 bytes in Android sources :-/

From which ROM is this framework-res.apk file? Some newer device or what? Maybe some manufacturers add their own config flags?

Owner

iBotPeaches commented Mar 18, 2015

Comment #4 originally posted by Brut.alll on 2010-08-29T18:58:24.000Z:

I have updated apktool to support Froyo resource qualifiers, but still config flags occupy 32 bytes max. There is no info about flags exceeding 32 bytes in Android sources :-/

From which ROM is this framework-res.apk file? Some newer device or what? Maybe some manufacturers add their own config flags?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #5 originally posted by bufane on 2010-08-30T03:33:37.000Z:

My device is LENOVO 3GW100.Maybe some manufacturers add their own config flags.

http://appserver.lenovo.com.cn/Lenovo_Product_Detail.aspx?CategoryCode=A21B01&gdsid=A2100011590

Owner

iBotPeaches commented Mar 18, 2015

Comment #5 originally posted by bufane on 2010-08-30T03:33:37.000Z:

My device is LENOVO 3GW100.Maybe some manufacturers add their own config flags.

http://appserver.lenovo.com.cn/Lenovo_Product_Detail.aspx?CategoryCode=A21B01&gdsid=A2100011590

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #6 originally posted by Brut.alll on 2010-08-30T09:54:09.000Z:

Unfortunately apktool can't decode this file fully - it just does not understand these config flags. I will try to add a feature to support duplicated resources, so they'll be overwritten or dropped, but of course rebuilt apk file won't be 100% identical to original one. This does not mean it will be broken, most probably you won't see any difference ;-)

I've got another issue with duplicated resources, but that was different story. I will create an issue for both these apks.

Owner

iBotPeaches commented Mar 18, 2015

Comment #6 originally posted by Brut.alll on 2010-08-30T09:54:09.000Z:

Unfortunately apktool can't decode this file fully - it just does not understand these config flags. I will try to add a feature to support duplicated resources, so they'll be overwritten or dropped, but of course rebuilt apk file won't be 100% identical to original one. This does not mean it will be broken, most probably you won't see any difference ;-)

I've got another issue with duplicated resources, but that was different story. I will create an issue for both these apks.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #7 originally posted by Brut.alll on 2010-08-30T10:08:34.000Z:

Hmmm... no, it would be better to drop all resources with unknown flags. If there will be new qualifier in the future and a file e.g. drawable-aaa/bbb.png, then apktool would convert it to drawable/bbb.png. This isn't good, cause older devices would read this resource even if they shouldn't.

Actually... Adroid team did exactly same mistake. E.g. Cupcake reads drawable-mdpi as it would be normal drawable. Newest aapt automatically adds -v4 qualifier for such files, so Cupcake won't read them anymore.

Owner

iBotPeaches commented Mar 18, 2015

Comment #7 originally posted by Brut.alll on 2010-08-30T10:08:34.000Z:

Hmmm... no, it would be better to drop all resources with unknown flags. If there will be new qualifier in the future and a file e.g. drawable-aaa/bbb.png, then apktool would convert it to drawable/bbb.png. This isn't good, cause older devices would read this resource even if they shouldn't.

Actually... Adroid team did exactly same mistake. E.g. Cupcake reads drawable-mdpi as it would be normal drawable. Newest aapt automatically adds -v4 qualifier for such files, so Cupcake won't read them anymore.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #8 originally posted by Brut.alll on 2010-09-03T15:59:54.000Z:

Fixed in v1.3.2 .

@bufane
New apktool will success at decoding these apks, but it will have to remove all unknown/undecodable resources. You will get warnings about that.

Of course you won't be able to even look in these unknown resources to do something with them. You could use new --keep-broken-res option, but then you will have to fix -ERR mess. You will see, what I'm talking about.

Unfortunately it's impossible to rebuild an apk with these unknown config flags (theme1, noscaledpi), cause official aapt doesn't support them.

Owner

iBotPeaches commented Mar 18, 2015

Comment #8 originally posted by Brut.alll on 2010-09-03T15:59:54.000Z:

Fixed in v1.3.2 .

@bufane
New apktool will success at decoding these apks, but it will have to remove all unknown/undecodable resources. You will get warnings about that.

Of course you won't be able to even look in these unknown resources to do something with them. You could use new --keep-broken-res option, but then you will have to fix -ERR mess. You will see, what I'm talking about.

Unfortunately it's impossible to rebuild an apk with these unknown config flags (theme1, noscaledpi), cause official aapt doesn't support them.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #9 originally posted by bufane on 2010-12-28T07:58:43.000Z:

thanks a lot

Owner

iBotPeaches commented Mar 18, 2015

Comment #9 originally posted by bufane on 2010-12-28T07:58:43.000Z:

thanks a lot

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