redundancy: remove unspecial special cases#3755
Merged
iBotPeaches merged 2 commits intoiBotPeaches:masterfrom Jan 15, 2025
IgorEisberg:rmkotlin
Merged
redundancy: remove unspecial special cases#3755iBotPeaches merged 2 commits intoiBotPeaches:masterfrom IgorEisberg:rmkotlin
iBotPeaches merged 2 commits intoiBotPeaches:masterfrom
IgorEisberg:rmkotlin
Conversation
As we discussed before, some of the dirs in RAW_DIRNAMES are treated as standard dirs in an APK, despite not being such. Instead of arbitrarily deciding what is known and what is unknown, we can make a concrete distinction: known dirs are dirs that are standard in APKs as generated by aapt: "assets", "lib" and "res". Everything else is app or library-specific and is unknown to aapt or smali/baksmali and should be treated as raw files that must be preserved as-is. "libs" (not "lib") is another example of a non-standard dir that might appear in specific APKs simply because the developers decided so, but it's not used for native libraries when calling loadLibrary. https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/app/LoadedApk.java;l=565 Thanks to refactoring done some months ago, everything in "unknown" is already being preserved when rebuilding an APK, no special considerations needed for kotlin.
iBotPeaches
approved these changes
Jan 1, 2025
Owner
iBotPeaches
left a comment
There was a problem hiding this comment.
Makes sense, but I'll hold merging until next cut.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As we discussed before, some of the dirs in
RAW_DIRNAMESare treated as standard dirs in an APK, despite not being such.Instead of arbitrarily deciding what is known and what is unknown, we can make a concrete distinction: known dirs are dirs that are standard in APKs as generated by aapt:
assets,libandres. Everything else is app or library-specific and is unknown to aapt or smali/baksmali and should be treated as raw files that must be preserved as-is.libs(notlib) is another example of a non-standard dir that might appear in specific APKs simply because the developers decided so, but it's not used for native libraries when callingloadLibrary.https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/app/LoadedApk.java;l=565
Thanks to refactoring done some months ago, everything in
unknownis already being preserved when rebuilding an APK, no special considerations needed for kotlin.