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