mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-05 17:45:52 +01:00
Fixed issues related to apks without res directory.
This commit is contained in:
parent
4af9f005b1
commit
80c9806214
@ -292,8 +292,10 @@ public class Androlib {
|
||||
false, framework
|
||||
);
|
||||
|
||||
new ExtFile(apkFile).getDirectory()
|
||||
.copyToDir(apkDir, APK_RESOURCES_FILENAMES);
|
||||
Directory tmpDir = new ExtFile(apkFile).getDirectory();
|
||||
tmpDir.copyToDir(apkDir,
|
||||
tmpDir.containsDir("res") ? APK_RESOURCES_FILENAMES :
|
||||
APK_RESOURCES_WITHOUT_RES_FILENAMES);
|
||||
}
|
||||
return true;
|
||||
} catch (IOException ex) {
|
||||
@ -418,6 +420,8 @@ public class Androlib {
|
||||
private final static String OUT_APK_FILENAME = "dist/out.apk";
|
||||
private final static String[] APK_RESOURCES_FILENAMES =
|
||||
new String[]{"resources.arsc", "AndroidManifest.xml", "res"};
|
||||
private final static String[] APK_RESOURCES_WITHOUT_RES_FILENAMES =
|
||||
new String[]{"resources.arsc", "AndroidManifest.xml"};
|
||||
private final static String[] APP_RESOURCES_FILENAMES =
|
||||
new String[]{"AndroidManifest.xml", "res"};
|
||||
private final static String VERSION = "1.2.0";
|
||||
|
@ -104,15 +104,18 @@ final public class AndrolibResources {
|
||||
attrDecoder.setCurrentPackage(
|
||||
resTable.listMainPackages().iterator().next());
|
||||
|
||||
Directory in, out;
|
||||
Directory inApk, in = null, out;
|
||||
try {
|
||||
in = apkFile.getDirectory();
|
||||
inApk = apkFile.getDirectory();
|
||||
out = new FileDirectory(outDir);
|
||||
|
||||
fileDecoder.decode(
|
||||
in, "AndroidManifest.xml", out, "AndroidManifest.xml", "xml");
|
||||
inApk, "AndroidManifest.xml", out, "AndroidManifest.xml",
|
||||
"xml");
|
||||
|
||||
in = in.getDir("res");
|
||||
if (inApk.containsDir("res")) {
|
||||
in = inApk.getDir("res");
|
||||
}
|
||||
out = out.createDir("res");
|
||||
} catch (DirectoryException ex) {
|
||||
throw new AndrolibException(ex);
|
||||
|
Loading…
Reference in New Issue
Block a user