Skip to content
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

build: update aapt/aapt2 with win/linux binaries #3360

Merged
merged 3 commits into from
Oct 4, 2023
Merged

Conversation

iBotPeaches
Copy link
Owner

fixes: #3346


There was reports that aapt2 builds were bugged - I rebased my patches onto AOSP and checked each one and seem to have success now with the above issue. One of my merges/rebases must have gone south.

https://github.com/iBotPeaches/platform_frameworks_base/tree/android_14

@iBotPeaches iBotPeaches marked this pull request as ready for review October 4, 2023 21:38
@iBotPeaches
Copy link
Owner Author

Will re-make these shortly with Android 14.

@iBotPeaches iBotPeaches merged commit 91a5863 into master Oct 4, 2023
31 checks passed
@iBotPeaches iBotPeaches deleted the issue-3346 branch October 4, 2023 23:03
@iBotPeaches iBotPeaches added this to the v2.9.0 milestone Oct 6, 2023
@mdee5test
Copy link

@iBotPeaches, I came across this issue recently while reverse engineering my app for some testing purposes.
After some thorough investigation, I found that the file res/drawable/abc_vector_test.xml mentioned in #3346 seem to have been generated due to Android Test Instrumentation. To verify this, I created a new Android Studio project targeting Android 34. This project did not even use activity binding. Just very simple Hello World activity. Next, I built the release version APK.
Then I used the latest version of apktool -- 2.9.3 -- to execute:

apktool d -r -s App.apk

I did this so that there wouldn't be any resource mismatching. Then once it had decompiled, I simply built it back using:

apktool b -o RebuiltApp.apk App/

After I got the rebuilt APK -- RebuiltApp.apk -- I zipaligned it and signed it. Finally, I installed it.

Upon launching, it brought the stack trace about the res/drawable/abc_vector_test.xml and the app crashed.

Testing My Theory

To test my theory, I removed the following lines from my app's build.gradle file:

defaultConfig {
        ...
//        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" [REMOVE THIS]
}

dependencies {

    ...
//    testImplementation libs.junit   [REMOVE THIS]
//    androidTestImplementation libs.ext.junit  [REMOVE THIS]
//    androidTestImplementation libs.espresso.core  [REMOVE THIS]

    ...
}

After doing this, I synced my gradle file again and rebuilt the release APK.
Then I did the same decompilation and recompilation steps above using apktool, zipaligned the app, and signed it.
After installation and launching, it had NO issues again. The res/drawable/abc_vector_test.xml not found exception was no longer thrown.

Conclusion

It makes sense to think that the res/drawable/abc_vector_test.xml was generated by Test Instrumentation considering the name of the file that was not found abc_vector_test.xml :)

Perhaps this might provide some more insight into how to solve this for good. Great job so far. Love your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Renaming package (or use of Brave APK at all) results in drawable not found
2 participants