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

Get rid of -v4 resource qualifiers #196

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

Comments

Projects
None yet
1 participant
@iBotPeaches
Owner

iBotPeaches commented Mar 18, 2015

Original issue 85 created by Brut.alll on 2010-08-25T15:22:32.000Z:

This isn't actually a bug. -v4 is a valid Android res qualifier:

http://d.android.com/guide/topics/resources/providing-resources.html#VersionQualifier

and apktool adds it when some resources really has it.

Seems apps built for 2.2 target get sdk=4 qualifier by default, but not for all resources: e.g. drawables get it, but values not. I think I could just ignore sdk=4 qualifier - Cupcake is really old and if Google has set sdk=4 as default for SDK Tools, then seems they also think so.

Issue has low priority, cause it doesn't break anything - just makes decoded apps uglier.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #1 originally posted by mrozdoba on 2010-08-25T17:37:30.000Z:

Are you saying, for example, that all drawables directories get this qualifier, including the default non-qualified drawable/ ?

If not, my reading of the url you quoted is that this is done specifically to support Cupcake & pre, not because it's too old to bother supporting. Without -v4, as the resolution quantifier is not known by cupcake it is ignored, consequently the resolution quantified drawables are seen as equally valid as the default & might well be used. With the -v4 which cupcake understands, it will avoid those drawables correctly using the mdp defaults, this being correct as google asserts all 1.5 devices are mdp.

Owner

iBotPeaches commented Mar 18, 2015

Comment #1 originally posted by mrozdoba on 2010-08-25T17:37:30.000Z:

Are you saying, for example, that all drawables directories get this qualifier, including the default non-qualified drawable/ ?

If not, my reading of the url you quoted is that this is done specifically to support Cupcake & pre, not because it's too old to bother supporting. Without -v4, as the resolution quantifier is not known by cupcake it is ignored, consequently the resolution quantified drawables are seen as equally valid as the default & might well be used. With the -v4 which cupcake understands, it will avoid those drawables correctly using the mdp defaults, this being correct as google asserts all 1.5 devices are mdp.

@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-08-25T17:58:27.000Z:

"Are you saying, for example, that all drawables directories get this qualifier, including the default non-qualified drawable/ ?"

Yes. If you'll create empty app for 2.2 target, build it and look into its resources, you'll see something like: http://pastebin.com/wBM0gnTX . As you can see all drawables got sdk=4 qualifier even if they're referencing dirs without -v4.

"Without -v4, as the resolution quantifier is not known by cupcake it is ignored (...)"

Negative, all densities got sdk=4. I don't really know, why they made sdk=4 default. Maybe they have introduced some PNG optimizations which Cupcake does not support. But this doesn't make much sense cause then app is practically useless on Cupcake, so why haven't they made minSdkVersion=4 default too?

Owner

iBotPeaches commented Mar 18, 2015

Comment #2 originally posted by Brut.alll on 2010-08-25T17:58:27.000Z:

"Are you saying, for example, that all drawables directories get this qualifier, including the default non-qualified drawable/ ?"

Yes. If you'll create empty app for 2.2 target, build it and look into its resources, you'll see something like: http://pastebin.com/wBM0gnTX . As you can see all drawables got sdk=4 qualifier even if they're referencing dirs without -v4.

"Without -v4, as the resolution quantifier is not known by cupcake it is ignored (...)"

Negative, all densities got sdk=4. I don't really know, why they made sdk=4 default. Maybe they have introduced some PNG optimizations which Cupcake does not support. But this doesn't make much sense cause then app is practically useless on Cupcake, so why haven't they made minSdkVersion=4 default too?

@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-29T15:23:22.000Z:

I've just noticed that if you add some resources with Froyo qualifiers, e.g. drawable-night-mdpi, then aapt will automatically add -v8 qualifier. Now I understand, what is going on: newer aapt automatically adds sdkVersion requirement if there are resources using qualifiers supported on some APIs only. Otherwise these resources might be used by device even if they shouldn't.

So yeah, you was, mrozdoba, right. Now I know exactly, what to do, thank you :-)

Owner

iBotPeaches commented Mar 18, 2015

Comment #3 originally posted by Brut.alll on 2010-08-29T15:23:22.000Z:

I've just noticed that if you add some resources with Froyo qualifiers, e.g. drawable-night-mdpi, then aapt will automatically add -v8 qualifier. Now I understand, what is going on: newer aapt automatically adds sdkVersion requirement if there are resources using qualifiers supported on some APIs only. Otherwise these resources might be used by device even if they shouldn't.

So yeah, you was, mrozdoba, right. Now I know exactly, what to do, thank you :-)

@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-09-03T15:51:51.000Z:

Fixed in v1.3.2 .

Owner

iBotPeaches commented Mar 18, 2015

Comment #4 originally posted by Brut.alll on 2010-09-03T15:51:51.000Z:

Fixed in v1.3.2 .

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