Refine get version interface
This commit is contained in:
parent
73b915e5a7
commit
d9b3263077
|
|
@ -58,7 +58,6 @@ val injectedPackageName by extra("com.android.shell")
|
|||
val injectedPackageUid by extra(2000)
|
||||
|
||||
val defaultManagerPackageName by extra("org.lsposed.manager")
|
||||
val apiCode by extra(93)
|
||||
val verCode by extra(commitCount)
|
||||
val verName by extra(latestTag)
|
||||
val androidTargetSdkVersion by extra(33)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
* Copyright (C) 2021 - 2022 LSPosed Contributors
|
||||
*/
|
||||
|
||||
val apiCode: Int by rootProject.extra
|
||||
val verName: String by rootProject.extra
|
||||
val verCode: Int by rootProject.extra
|
||||
|
||||
|
|
@ -35,7 +34,8 @@ android {
|
|||
defaultConfig {
|
||||
consumerProguardFiles("proguard-rules.pro")
|
||||
|
||||
buildConfigField("int", "API_CODE", "$apiCode")
|
||||
buildConfigField("String", "VERSION_NAME", """"$verName"""")
|
||||
buildConfigField("long", "VERSION_CODE", """$verCode""")
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import android.content.res.Resources;
|
|||
import android.content.res.TypedArray;
|
||||
import android.util.Log;
|
||||
|
||||
import org.lsposed.lspd.core.BuildConfig;
|
||||
import org.lsposed.lspd.nativebridge.HookBridge;
|
||||
import org.lsposed.lspd.nativebridge.ResourcesHook;
|
||||
|
||||
|
|
@ -43,6 +42,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
|||
|
||||
import de.robv.android.xposed.callbacks.XC_InitPackageResources;
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
||||
import io.github.libxposed.XposedInterface;
|
||||
|
||||
/**
|
||||
* This class contains most of Xposed's central logic, such as initialization and callbacks used by
|
||||
|
|
@ -145,7 +145,7 @@ public final class XposedBridge {
|
|||
* Returns the currently installed version of the Xposed framework.
|
||||
*/
|
||||
public static int getXposedVersion() {
|
||||
return BuildConfig.API_CODE;
|
||||
return XposedInterface.API;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import android.view.Display;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.lsposed.lspd.core.BuildConfig;
|
||||
import org.lsposed.lspd.models.Module;
|
||||
import org.lsposed.lspd.service.ILSPInjectedModuleService;
|
||||
import org.lsposed.lspd.util.LspModuleClassLoader;
|
||||
|
|
@ -729,19 +730,19 @@ public class LSPosedContext extends XposedContext {
|
|||
|
||||
@NonNull
|
||||
@Override
|
||||
public String implementationName() {
|
||||
public String getFrameworkName() {
|
||||
return "LSPosed";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String implementationVersion() {
|
||||
return "";
|
||||
public String getFrameworkVersion() {
|
||||
return BuildConfig.VERSION_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long implementationVersionCode() {
|
||||
return 0;
|
||||
public long getFrameworkVersionCode() {
|
||||
return BuildConfig.VERSION_CODE;
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ val injectedPackageUid: Int by rootProject.extra
|
|||
val agpVersion : String by project
|
||||
|
||||
val defaultManagerPackageName: String by rootProject.extra
|
||||
val apiCode: Int by rootProject.extra
|
||||
|
||||
android {
|
||||
buildFeatures {
|
||||
|
|
@ -44,7 +43,6 @@ android {
|
|||
defaultConfig {
|
||||
applicationId = "org.lsposed.daemon"
|
||||
|
||||
buildConfigField("int", "API_CODE", "$apiCode")
|
||||
buildConfigField(
|
||||
"String",
|
||||
"DEFAULT_MANAGER_PACKAGE_NAME",
|
||||
|
|
@ -129,6 +127,7 @@ dependencies {
|
|||
compileOnly("androidx.annotation:annotation:1.5.0")
|
||||
compileOnly(projects.hiddenapi.stubs)
|
||||
implementation(projects.hiddenapi.bridge)
|
||||
implementation(projects.libxposed.service)
|
||||
implementation(projects.services.daemonService)
|
||||
implementation(projects.services.managerService)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class LSPInjectedModuleService extends ILSPInjectedModuleService.Stub {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Bundle requestRemotePreferences(String group, IRemotePreferenceCallback callback) throws RemoteException {
|
||||
public Bundle requestRemotePreferences(String group, IRemotePreferenceCallback callback) {
|
||||
var bundle = new Bundle();
|
||||
var userId = Binder.getCallingUid() % PER_USER_RANGE;
|
||||
bundle.putSerializable("map", ConfigManager.getInstance().getModulePrefs(loadedModule.packageName, userId, group));
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ import java.util.UUID;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import hidden.HiddenApiBridge;
|
||||
import io.github.libxposed.service.IXposedService;
|
||||
import rikka.parcelablelist.ParcelableListSlice;
|
||||
|
||||
public class LSPManagerService extends ILSPManagerService.Stub {
|
||||
|
|
@ -362,7 +363,7 @@ public class LSPManagerService extends ILSPManagerService.Stub {
|
|||
|
||||
@Override
|
||||
public int getXposedApiVersion() {
|
||||
return BuildConfig.API_CODE;
|
||||
return IXposedService.API;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -559,7 +560,7 @@ public class LSPManagerService extends ILSPManagerService.Stub {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void getLogs(ParcelFileDescriptor zipFd) throws RemoteException {
|
||||
public void getLogs(ParcelFileDescriptor zipFd) {
|
||||
ConfigFileManager.getLogs(zipFd);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -95,22 +95,22 @@ public class LSPModuleService extends IXposedService.Stub {
|
|||
}
|
||||
|
||||
@Override
|
||||
public long getAPIVersion() {
|
||||
public int getAPIVersion() {
|
||||
return API;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String implementationName() {
|
||||
public String getFrameworkName() {
|
||||
return "LSPosed";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String implementationVersion() throws RemoteException {
|
||||
public String getFrameworkVersion() {
|
||||
return BuildConfig.VERSION_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long implementationVersionCode() throws RemoteException {
|
||||
public long getFrameworkVersionCode() {
|
||||
return BuildConfig.VERSION_CODE;
|
||||
}
|
||||
|
||||
|
|
@ -131,13 +131,13 @@ public class LSPModuleService extends IXposedService.Stub {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Bundle requestRemotePreferences(String group) throws RemoteException {
|
||||
public Bundle requestRemotePreferences(String group) {
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRemotePreferences(String group, Bundle diff) throws RemoteException {
|
||||
public void updateRemotePreferences(String group, Bundle diff) {
|
||||
// TODO
|
||||
((LSPInjectedModuleService) loadedModule.service).onUpdateRemotePreferences(group, diff);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ public class XposedContextWrapper extends ContextWrapper implements XposedInterf
|
|||
super(base);
|
||||
}
|
||||
|
||||
final long getAPIVersion() {
|
||||
return 100;
|
||||
final public int getAPIVersion() {
|
||||
return API;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -30,19 +30,19 @@ public class XposedContextWrapper extends ContextWrapper implements XposedInterf
|
|||
|
||||
@NonNull
|
||||
@Override
|
||||
final public String implementationName() {
|
||||
return getBaseContext().implementationVersion();
|
||||
final public String getFrameworkName() {
|
||||
return getBaseContext().getFrameworkName();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
final public String implementationVersion() {
|
||||
return getBaseContext().implementationVersion();
|
||||
final public String getFrameworkVersion() {
|
||||
return getBaseContext().getFrameworkVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
final public long implementationVersionCode() {
|
||||
return getBaseContext().implementationVersionCode();
|
||||
final public long getFrameworkVersionCode() {
|
||||
return getBaseContext().getFrameworkVersionCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import java.lang.reflect.Method;
|
|||
import java.util.ConcurrentModificationException;
|
||||
|
||||
public interface XposedInterface {
|
||||
int API = 100;
|
||||
|
||||
interface BeforeHookCallback<T> {
|
||||
@NonNull
|
||||
T getOrigin();
|
||||
|
|
@ -79,12 +81,12 @@ public interface XposedInterface {
|
|||
}
|
||||
|
||||
@NonNull
|
||||
String implementationName();
|
||||
String getFrameworkName();
|
||||
|
||||
@NonNull
|
||||
String implementationVersion();
|
||||
String getFrameworkVersion();
|
||||
|
||||
long implementationVersionCode();
|
||||
long getFrameworkVersionCode();
|
||||
|
||||
MethodUnhooker<BeforeMethodHooker<Method>, Method> hookBefore(@NonNull Method origin, @NonNull BeforeMethodHooker<Method> hooker);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ interface IXposedService {
|
|||
const String SEND_BINDER = "SendBinder";
|
||||
|
||||
// framework details
|
||||
long getAPIVersion() = 1;
|
||||
String implementationName() = 2;
|
||||
String implementationVersion() = 3;
|
||||
long implementationVersionCode() = 4;
|
||||
int getAPIVersion() = 1;
|
||||
String getFrameworkName() = 2;
|
||||
String getFrameworkVersion() = 3;
|
||||
long getFrameworkVersionCode() = 4;
|
||||
|
||||
// scope utilities
|
||||
List<String> getScope() = 10;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ val injectedPackageName: String by rootProject.extra
|
|||
val injectedPackageUid: Int by rootProject.extra
|
||||
|
||||
val defaultManagerPackageName: String by rootProject.extra
|
||||
val apiCode: Int by rootProject.extra
|
||||
val verCode: Int by rootProject.extra
|
||||
val verName: String by rootProject.extra
|
||||
|
||||
|
|
@ -65,7 +64,6 @@ android {
|
|||
applicationId = "org.lsposed.lspd"
|
||||
multiDexEnabled = false
|
||||
|
||||
buildConfigField("int", "API_CODE", "$apiCode")
|
||||
buildConfigField(
|
||||
"String",
|
||||
"DEFAULT_MANAGER_PACKAGE_NAME",
|
||||
|
|
|
|||
|
|
@ -35,6 +35,5 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
api(projects.libxposed.service)
|
||||
api("dev.rikka.rikkax.parcelablelist:parcelablelist:2.0.1")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue