Add .apk suffix

This commit is contained in:
Nullptr 2022-07-05 19:10:29 +08:00
parent e05dde5b20
commit 0ef34fa633
No known key found for this signature in database
GPG Key ID: 0B9D02052FF536BD
4 changed files with 5 additions and 5 deletions

View File

@ -133,7 +133,7 @@ public class LSPApplication {
String originPath = appInfo.dataDir + "/cache/lspatch/origin/";
String cacheApkPath;
try (ZipFile sourceFile = new ZipFile(appInfo.sourceDir)) {
cacheApkPath = originPath + sourceFile.getEntry(ORIGINAL_APK_ASSET_PATH).getCrc();
cacheApkPath = originPath + sourceFile.getEntry(ORIGINAL_APK_ASSET_PATH).getCrc() + ".apk";
}
appInfo.sourceDir = cacheApkPath;
@ -317,7 +317,7 @@ public class LSPApplication {
if (config.sigBypassLevel >= Constants.SIGBYPASS_LV_PM_OPENAT) {
String cacheApkPath;
try (ZipFile sourceFile = new ZipFile(context.getPackageResourcePath())) {
cacheApkPath = context.getCacheDir() + "/lspatch/origin/" + sourceFile.getEntry(ORIGINAL_APK_ASSET_PATH).getCrc();
cacheApkPath = context.getCacheDir() + "/lspatch/origin/" + sourceFile.getEntry(ORIGINAL_APK_ASSET_PATH).getCrc() + ".apk";
}
SigBypass.enableOpenatHook(context.getPackageResourcePath(), cacheApkPath);
}

View File

@ -33,7 +33,7 @@ public class LocalApplicationService extends ILSPApplicationService.Stub {
String modulePath = context.getCacheDir() + "/lspatch/" + packageName + "/";
String cacheApkPath;
try (ZipFile sourceFile = new ZipFile(context.getPackageResourcePath())) {
cacheApkPath = modulePath + sourceFile.getEntry("assets/lspatch/modules/" + name).getCrc();
cacheApkPath = modulePath + sourceFile.getEntry("assets/lspatch/modules/" + name).getCrc() + ".apk";
}
if (!Files.exists(Paths.get(cacheApkPath))) {

View File

@ -345,7 +345,7 @@ public class LSPatch {
var manifest = Objects.requireNonNull(ManifestParser.parseManifestFile(xmlIs));
var packageName = manifest.packageName;
logger.i(" - " + packageName);
zFile.add("assets/lspatch/modules/" + packageName + ".bin", fileIs);
zFile.add("assets/lspatch/modules/" + packageName + ".apk", fileIs);
} catch (NullPointerException | IOException e) {
logger.e(module + " does not exist or is not a valid apk file.");
}

View File

@ -4,7 +4,7 @@ public class Constants {
final static public String DEX_ASSET_PATH = "assets/lspatch/lsp.dex";
final static public String CONFIG_ASSET_PATH = "assets/lspatch/config.json";
final static public String ORIGINAL_APK_ASSET_PATH = "assets/lspatch/origin_apk.bin";
final static public String ORIGINAL_APK_ASSET_PATH = "assets/lspatch/origin.apk";
final static public String PROXY_APP_COMPONENT_FACTORY = "org.lsposed.lspatch.appstub.LSPAppComponentFactoryStub";
final static public String MANAGER_PACKAGE_NAME = "org.lsposed.lspatch";