mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-10 18:54:24 +02:00
Generate warning instead of exception on multipackage apks.
This commit is contained in:
parent
235bfbc803
commit
6d8bd55ba6
@ -178,14 +178,22 @@ final public class AndrolibResources {
|
|||||||
throws AndrolibException {
|
throws AndrolibException {
|
||||||
JniPackageGroup[] groups =
|
JniPackageGroup[] groups =
|
||||||
nativeGetPackageGroups(apkFile.getAbsolutePath());
|
nativeGetPackageGroups(apkFile.getAbsolutePath());
|
||||||
if (groups.length != 1) {
|
if (groups.length == 0) {
|
||||||
throw new AndrolibException(
|
throw new AndrolibException(
|
||||||
"Apk's with multiple or zero package groups not supported");
|
"Apk with zero package groups: " + apkFile.getPath());
|
||||||
|
}
|
||||||
|
if (groups.length > 1) {
|
||||||
|
System.err.println(
|
||||||
|
"warning: apk with multiple package groups: "
|
||||||
|
+ apkFile.getPath());
|
||||||
}
|
}
|
||||||
for (int i = 0; i < groups.length; i++) {
|
for (int i = 0; i < groups.length; i++) {
|
||||||
// if (groups.length != 1 && i == 0) {
|
if (groups.length != 1 && i == 0
|
||||||
// continue;
|
&& "android".equals(groups[i].packages[0].name)) {
|
||||||
// }
|
System.err.println(
|
||||||
|
"warning: skipping \"android\" package group");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
for (JniPackage jniPkg : groups[i].packages) {
|
for (JniPackage jniPkg : groups[i].packages) {
|
||||||
ResPackage pkg = new JniPackageDecoder().decode(jniPkg, resTable);
|
ResPackage pkg = new JniPackageDecoder().decode(jniPkg, resTable);
|
||||||
resTable.addPackage(pkg, main);
|
resTable.addPackage(pkg, main);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user