mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-21 17:27:41 +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
|
false, framework
|
||||||
);
|
);
|
||||||
|
|
||||||
new ExtFile(apkFile).getDirectory()
|
Directory tmpDir = new ExtFile(apkFile).getDirectory();
|
||||||
.copyToDir(apkDir, APK_RESOURCES_FILENAMES);
|
tmpDir.copyToDir(apkDir,
|
||||||
|
tmpDir.containsDir("res") ? APK_RESOURCES_FILENAMES :
|
||||||
|
APK_RESOURCES_WITHOUT_RES_FILENAMES);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@ -418,6 +420,8 @@ public class Androlib {
|
|||||||
private final static String OUT_APK_FILENAME = "dist/out.apk";
|
private final static String OUT_APK_FILENAME = "dist/out.apk";
|
||||||
private final static String[] APK_RESOURCES_FILENAMES =
|
private final static String[] APK_RESOURCES_FILENAMES =
|
||||||
new String[]{"resources.arsc", "AndroidManifest.xml", "res"};
|
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 =
|
private final static String[] APP_RESOURCES_FILENAMES =
|
||||||
new String[]{"AndroidManifest.xml", "res"};
|
new String[]{"AndroidManifest.xml", "res"};
|
||||||
private final static String VERSION = "1.2.0";
|
private final static String VERSION = "1.2.0";
|
||||||
|
@ -104,15 +104,18 @@ final public class AndrolibResources {
|
|||||||
attrDecoder.setCurrentPackage(
|
attrDecoder.setCurrentPackage(
|
||||||
resTable.listMainPackages().iterator().next());
|
resTable.listMainPackages().iterator().next());
|
||||||
|
|
||||||
Directory in, out;
|
Directory inApk, in = null, out;
|
||||||
try {
|
try {
|
||||||
in = apkFile.getDirectory();
|
inApk = apkFile.getDirectory();
|
||||||
out = new FileDirectory(outDir);
|
out = new FileDirectory(outDir);
|
||||||
|
|
||||||
fileDecoder.decode(
|
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");
|
out = out.createDir("res");
|
||||||
} catch (DirectoryException ex) {
|
} catch (DirectoryException ex) {
|
||||||
throw new AndrolibException(ex);
|
throw new AndrolibException(ex);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user