Patch newest AndroResGuard format

This commit is contained in:
Connor Tumbleson 2016-08-06 07:56:17 -04:00
parent e1dd436854
commit 6e509695eb
No known key found for this signature in database
GPG Key ID: C3CC0A201EC7DA75
3 changed files with 6 additions and 2 deletions

View File

@ -718,7 +718,8 @@ public class Androlib {
private final static String[] APK_MANIFEST_FILENAMES = new String[] {
"AndroidManifest.xml" };
private final static String[] APK_STANDARD_ALL_FILENAMES = new String[] {
"classes.dex", "AndroidManifest.xml", "resources.arsc", "res", "r", "lib", "libs", "assets", "META-INF" };
"classes.dex", "AndroidManifest.xml", "resources.arsc", "res", "r", "R",
"lib", "libs", "assets", "META-INF" };
// Taken from AOSP's frameworks/base/tools/aapt/Package.cpp
private final static Pattern NO_COMPRESS_PATTERN = Pattern.compile("\\.(" +
"jpg|jpeg|png|gif|wav|mp2|mp3|ogg|aac|mpg|mpeg|mid|midi|smf|jet|rtttl|imy|xmf|mp4|" +

View File

@ -246,6 +246,9 @@ final public class AndrolibResources {
if (in == null && inApk.containsDir("r")) {
in = inApk.getDir("r");
}
if (in == null && inApk.containsDir("R")) {
in = inApk.getDir("R");
}
} catch (DirectoryException ex) {
throw new AndrolibException(ex);
}

View File

@ -37,7 +37,7 @@ public class ResFileValue extends ResIntBasedValue {
if (mPath.startsWith("res/")) {
return mPath.substring(4);
}
if (mPath.startsWith("r/")) {
if (mPath.startsWith("r/") || mPath.startsWith("R/")) {
return mPath.substring(2);
}
throw new AndrolibException("File path does not start with \"res/\" or \"r/\": " + mPath);