-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix rebuild apk without res directory when it use AndResGuard plugin #2943
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
fix rebuild apk without res directory when it use AndResGuard plugin #2943
Conversation
…m/shwenzhang/AndResGuard plugin to guard resource. according to AndResGuard offical document, ex. "It changes res/drawable/wechat to r/d/a"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of unrelated CS changes in here.
LOGGER.info("Found illegal resources dir r,decode it!"); | ||
apkResourcesFileNames.add("r"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This messaging pattern does not follow our pattern we have.
apkFile.getDirectory().copyToDir(outDir, APK_RESOURCES_FILENAMES); | ||
Directory directory = apkFile.getDirectory(); | ||
List<String> apkResourcesFileNames = new ArrayList<>(Arrays.asList(APK_RESOURCES_FILENAMES)); | ||
if (directory.getDirs().containsKey("r")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about R
and r
?
try { | ||
LOGGER.info("Copying raw resources..."); | ||
apkFile.getDirectory().copyToDir(outDir, APK_RESOURCES_FILENAMES); | ||
Directory directory = apkFile.getDirectory(); | ||
List<String> apkResourcesFileNames = new ArrayList<>(Arrays.asList(APK_RESOURCES_FILENAMES)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we just load all the AndResGuard res directories into APK_RESOURCES_FILENAMES
and ensure copyToDir
handles null/missing directories?
Thanks for drawing my attention to this area. I've refactored it and added a test to prevent regression with raw handling w/ AndResGuard in here - #2944 So closing this one. |
fix rebuild apk without res when the origin apk use https://github.co…m/shwenzhang/AndResGuard plugin to guard resource.
according to AndResGuard official document, ex. "It changes res/drawable/wechat to r/d/a"