You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the meta-data in AndroidManifest contains a numeric string, there will be an extra space in front of the value of this field in the new package built.
My fix suggestion
The new version of apktool uses aapt2 for packaging by default, resulting in spaces added when parsing the AndroidManifest that cannot be eliminated. Turn off aapt2 and use aapt1 to create new packages without this problem.
When parsing AndroidManifest, you can decide whether to add spaces in front of numeric strings according to the version of aapt.
The code here needs to be modified to solve the problem of test cases failing to pass:
brut.apktool/apktool-lib/src/test/resources/aapt2/testapp/AndroidManifest.xml
The text was updated successfully, but these errors were encountered:
This is a known issue still. We don't have the knowledge of whether aapt2/aapt1 is in play during the checkIfStringIsNumeric check to properly avoid this.
Information
apktool -version
) -2.9.3java --version
) - java11Bug
When the meta-data in AndroidManifest contains a numeric string, there will be an extra space in front of the value of this field in the new package built.
My fix suggestion
The new version of apktool uses aapt2 for packaging by default, resulting in spaces added when parsing the AndroidManifest that cannot be eliminated. Turn off aapt2 and use aapt1 to create new packages without this problem.
When parsing AndroidManifest, you can decide whether to add spaces in front of numeric strings according to the version of aapt.
code: brut.androlib.res.data.value.ResStringValue#checkIfStringIsNumeric
The code here needs to be modified to solve the problem of test cases failing to pass:
![image](https://private-user-images.githubusercontent.com/8817374/320481748-867a35af-1ba1-45a9-be45-b31bfee9eafc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEzMDU5OTcsIm5iZiI6MTcyMTMwNTY5NywicGF0aCI6Ii84ODE3Mzc0LzMyMDQ4MTc0OC04NjdhMzVhZi0xYmExLTQ1YTktYmU0NS1iMzFiZmVlOWVhZmMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MThUMTIyODE3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmFjM2ViOGUzYmNkZjI0MjQ2OTE5YjYwN2M2OTA4MmVjZGVhYWYzOTIxNzRiNjYwMmYxNWE0N2UyOTYxNmJiZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.x2WHMsfPHgWJrNtgc7NFMCliiVZz4eY441QO0rRQ-Uk)
brut.apktool/apktool-lib/src/test/resources/aapt2/testapp/AndroidManifest.xml
The text was updated successfully, but these errors were encountered: