Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

add option to use aapt2 #23

Closed
wants to merge 1 commit into from
Closed

Conversation

sh4dowb
Copy link

@sh4dowb sh4dowb commented Feb 6, 2021

sometimes only checking for res/navigation isn't enough to use aapt2.

sometimes only checking for res/navigation isn't enough to use aapt2.
@NickstaDB
Copy link
Owner

Thanks @sh4dowb.

To clarify, is this to fix a problem where:

  1. The --use-aapt2 option was required, but the res/navigation directory was not present
  2. The res/navigation directory was present, but the --use-aapt2 option was not required

Are you also able to give an example of a public app where you have encountered this issue?

I'm not entirely opposed to adding a command-line option to force the use of --use-aapt2 (or vice versa), but if the script can do a better job of detecting when --use-aapt2 is required I'd prefer to implement that instead.

@sh4dowb
Copy link
Author

sh4dowb commented Feb 8, 2021

Thanks @sh4dowb.

To clarify, is this to fix a problem where:

1. The `--use-aapt2` option was required, but the `res/navigation` directory was not present

2. The `res/navigation` directory was present, but the `--use-aapt2` option was not required

Are you also able to give an example of a public app where you have encountered this issue?

I'm not entirely opposed to adding a command-line option to force the use of --use-aapt2 (or vice versa), but if the script can do a better job of detecting when --use-aapt2 is required I'd prefer to implement that instead.

Hi, not the 2nd, only 1st.

W: /tmp/tmprjzbf2wn/*******/res/values/arrays.xml:1149: error: Error retrieving parent for item: No resource found that matches the given name 'currency'.
W: /tmp/tmprjzbf2wn/******/res/values/plurals.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'analytics.account_chooser'.
W: 

I'm getting errors like this from apktool
If I use aapt2 I don't get these errors, however, I noticed it still happens with objection. Maybe fix it for objection too, if there's the option for that, or just keep it the way it is?

@BenjaDiaz
Copy link

I have also found a case where res/navigation was not present, but the use of aapt2 was necessary for it to work. The error was:

W: /private/var/folders/w4/s5j65zls605cv0bzxdp0lg2w0000gp/T/tmplwhsykg8/XXX/res/values/drawables.xml:5: error: Error: String types not allowed (at 'abc_ab_share_pack_mtrl_alpha' with value '').

@NickstaDB
Copy link
Owner

It looks like an update to apktool changed the way some resource file elements are handled (see iBotPeaches/Apktool#2462 and iBotPeaches/Apktool@1422293).

I've updated the script to enforce --use-aapt2 if the installed apktool is newer than version 2.4.2, hopefully that will resolve the issues you've both experienced but let me know if not or if that breaks anything else. Cheers.

@NickstaDB NickstaDB closed this Apr 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants