Move a string to shared constants

This commit is contained in:
Nullptr 2021-09-18 12:52:52 +08:00
parent de06c1cf7c
commit 0f0e726f2f
3 changed files with 4 additions and 3 deletions

View File

@ -3,6 +3,7 @@ package org.lsposed.lspatch.loader;
import static android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE;
import static org.lsposed.lspatch.share.Constants.ORIGINAL_APK_ASSET_PATH;
import static org.lsposed.lspatch.share.Constants.ORIGINAL_APP_COMPONENT_FACTORY_ASSET_PATH;
import static org.lsposed.lspatch.share.Constants.PROXY_APP_COMPONENT_FACTORY;
import static org.lsposed.lspd.service.ConfigFileManager.loadModule;
import android.annotation.SuppressLint;
@ -126,7 +127,7 @@ public class LSPApplication extends ApplicationServiceClient {
try {
ApplicationInfo aInfo = context.getApplicationInfo();
ClassLoader baseClassLoader = context.getClassLoader();
Class<?> stubClass = Class.forName("org.lsposed.lspatch.appstub.LSPAppComponentFactoryStub", false, baseClassLoader);
Class<?> stubClass = Class.forName(PROXY_APP_COMPONENT_FACTORY, false, baseClassLoader);
String originPath = aInfo.dataDir + "/cache/lspatch/origin/";
String originalAppComponentFactoryClass = FileUtils.readTextFromInputStream(baseClassLoader.getResourceAsStream(ORIGINAL_APP_COMPONENT_FACTORY_ASSET_PATH));

View File

@ -2,6 +2,7 @@ package org.lsposed.patch;
import static org.lsposed.lspatch.share.Constants.ORIGINAL_APK_ASSET_PATH;
import static org.lsposed.lspatch.share.Constants.ORIGINAL_APP_COMPONENT_FACTORY_ASSET_PATH;
import static org.lsposed.lspatch.share.Constants.PROXY_APP_COMPONENT_FACTORY;
import com.android.tools.build.apkzlib.sign.SigningExtension;
import com.android.tools.build.apkzlib.sign.SigningOptions;
@ -85,8 +86,6 @@ public class LSPatch {
@Parameter(names = {"-m", "--embed"}, description = "Embed provided modules to apk")
private List<String> modules = new ArrayList<>();
private static final String PROXY_APP_COMPONENT_FACTORY = "org.lsposed.lspatch.appstub.LSPAppComponentFactoryStub";
private static final String SIGNATURE_INFO_ASSET_PATH = "assets/original_signature_info.ini";
private static final String USE_MANAGER_CONTROL_PATH = "assets/use_manager.ini";
private static final String ANDROID_MANIFEST_XML = "AndroidManifest.xml";

View File

@ -4,6 +4,7 @@ public class Constants {
final static public String ORIGINAL_APK_ASSET_PATH = "assets/origin_apk.bin";
final static public String ORIGINAL_APP_COMPONENT_FACTORY_ASSET_PATH = "assets/original_app_component_factory.ini";
final static public String PROXY_APP_COMPONENT_FACTORY = "org.lsposed.lspatch.appstub.LSPAppComponentFactoryStub";
final static public String MANAGER_PACKAGE_NAME = "org.lsposed.lspatch";
final static public String CONFIG_NAME_SIGBYPASSLV = "lspatch_sigbypasslv";
final static public int SIGBYPASS_LV_DISABLE = 0;