mirror of
https://github.com/revanced/smali.git
synced 2025-05-23 18:16:23 +02:00
Fix classpath loading for pre-art odex files
This commit is contained in:
parent
4eefe294e4
commit
f2935deb16
@ -46,6 +46,8 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jf.dexlib2.analysis.ClassPath.NOT_ART;
|
||||
|
||||
public class AnalysisArguments {
|
||||
@Parameter(names = {"-a", "--api"},
|
||||
description = "The numeric api level of the file being disassembled.")
|
||||
@ -86,7 +88,7 @@ public class AnalysisArguments {
|
||||
@Nonnull
|
||||
public ClassPath loadClassPathForDexFile(@Nonnull File dexFileDir, @Nonnull DexFile dexFile,
|
||||
boolean checkPackagePrivateAccess) throws IOException {
|
||||
return loadClassPathForDexFile(dexFileDir, dexFile, checkPackagePrivateAccess, 0);
|
||||
return loadClassPathForDexFile(dexFileDir, dexFile, checkPackagePrivateAccess, NOT_ART);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@ -95,7 +97,16 @@ public class AnalysisArguments {
|
||||
throws IOException {
|
||||
ClassPathResolver resolver;
|
||||
|
||||
if (dexFile instanceof OatDexFile) {
|
||||
// By default, oatVersion should be NOT_ART, and we'll automatically set it if dexFile is an oat file. In some
|
||||
// cases the caller may choose to override the oat version, in which case we should use the given oat version
|
||||
// regardless of the actual version of the oat file
|
||||
if (oatVersion == NOT_ART) {
|
||||
if (dexFile instanceof OatDexFile) {
|
||||
checkPackagePrivateAccess = true;
|
||||
oatVersion = ((OatDexFile)dexFile).getContainer().getOatVersion();
|
||||
}
|
||||
} else {
|
||||
// this should always be true for ART
|
||||
checkPackagePrivateAccess = true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user