mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-21 01:07:34 +01:00
Make the checkPackagePrivateAccess functionality an option
This is only needed for 4.2.0, but not 4.2.1. Both are api 17, so we can't tie this functionality to an api level.
This commit is contained in:
parent
89e6b06521
commit
52482802dc
@ -211,6 +211,9 @@ public class main {
|
|||||||
case 'e':
|
case 'e':
|
||||||
options.dexEntry = commandLine.getOptionValue("e");
|
options.dexEntry = commandLine.getOptionValue("e");
|
||||||
break;
|
break;
|
||||||
|
case 'k':
|
||||||
|
options.checkPackagePrivateAccess = true;
|
||||||
|
break;
|
||||||
case 'N':
|
case 'N':
|
||||||
disassemble = false;
|
disassemble = false;
|
||||||
break;
|
break;
|
||||||
@ -241,10 +244,6 @@ public class main {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.apiLevel == 17) {
|
|
||||||
options.checkPackagePrivateAccess = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
String inputDexFileName = remainingArgs[0];
|
String inputDexFileName = remainingArgs[0];
|
||||||
|
|
||||||
File dexFileFile = new File(inputDexFileName);
|
File dexFileFile = new File(inputDexFileName);
|
||||||
@ -430,6 +429,12 @@ public class main {
|
|||||||
.withDescription("Don't use implicit (type-less) method and field references")
|
.withDescription("Don't use implicit (type-less) method and field references")
|
||||||
.create("t");
|
.create("t");
|
||||||
|
|
||||||
|
Option checkPackagePrivateAccessOption = OptionBuilder.withLongOpt("check-package-private-access")
|
||||||
|
.withDescription("When deodexing, use the package-private access check when calculating vtable " +
|
||||||
|
"indexes. It should only be needed for 4.2.0 odexes. The functionality was reverted for " +
|
||||||
|
"4.2.1.")
|
||||||
|
.create("k");
|
||||||
|
|
||||||
Option dumpOption = OptionBuilder.withLongOpt("dump-to")
|
Option dumpOption = OptionBuilder.withLongOpt("dump-to")
|
||||||
.withDescription("dumps the given dex file into a single annotated dump file named FILE" +
|
.withDescription("dumps the given dex file into a single annotated dump file named FILE" +
|
||||||
" (<dexfile>.dump by default), along with the normal disassembly")
|
" (<dexfile>.dump by default), along with the normal disassembly")
|
||||||
@ -477,6 +482,7 @@ public class main {
|
|||||||
basicOptions.addOption(resourceIdFilesOption);
|
basicOptions.addOption(resourceIdFilesOption);
|
||||||
basicOptions.addOption(noImplicitReferencesOption);
|
basicOptions.addOption(noImplicitReferencesOption);
|
||||||
basicOptions.addOption(dexEntryOption);
|
basicOptions.addOption(dexEntryOption);
|
||||||
|
basicOptions.addOption(checkPackagePrivateAccessOption);
|
||||||
|
|
||||||
debugOptions.addOption(dumpOption);
|
debugOptions.addOption(dumpOption);
|
||||||
debugOptions.addOption(ignoreErrorsOption);
|
debugOptions.addOption(ignoreErrorsOption);
|
||||||
|
@ -164,7 +164,7 @@ public class ClassPath {
|
|||||||
return unknownClass;
|
return unknownClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean needCheckPackagePrivateAccess() {
|
public boolean shouldCheckPackagePrivateAccess() {
|
||||||
return checkPackagePrivateAccess;
|
return checkPackagePrivateAccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -628,7 +628,7 @@ public class ClassProto implements TypeProto {
|
|||||||
for (int i=0; i<vtable.size(); i++) {
|
for (int i=0; i<vtable.size(); i++) {
|
||||||
Method superMethod = vtable.get(i);
|
Method superMethod = vtable.get(i);
|
||||||
if (methodSignaturesMatch(superMethod, virtualMethod)) {
|
if (methodSignaturesMatch(superMethod, virtualMethod)) {
|
||||||
if (!classPath.needCheckPackagePrivateAccess() || canAccess(superMethod)) {
|
if (!classPath.shouldCheckPackagePrivateAccess() || canAccess(superMethod)) {
|
||||||
if (replaceExisting) {
|
if (replaceExisting) {
|
||||||
vtable.set(i, virtualMethod);
|
vtable.set(i, virtualMethod);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user