Skip to content

Commit

Permalink
Provide a native method to retrieve the version number
Browse files Browse the repository at this point in the history
  • Loading branch information
rovo89 committed Jun 20, 2015
1 parent bccac73 commit 155431f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libxposed_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ jboolean XposedBridge_startsSystemServer(JNIEnv* env, jclass clazz) {
return xposed->startSystemServer;
}

jint XposedBridge_getXposedVersion(JNIEnv* env, jclass clazz) {
return xposed->xposedVersionInt;
}

jboolean XposedBridge_initNative(JNIEnv* env, jclass clazz) {
if (!xposedLoadedSuccessfully) {
ALOGE("Not initializing Xposed because of previous errors");
Expand Down Expand Up @@ -284,6 +288,7 @@ int register_natives_XposedBridge(JNIEnv* env, jclass clazz) {
NATIVE_METHOD(XposedBridge, getStartClassName, "()Ljava/lang/String;"),
NATIVE_METHOD(XposedBridge, getRuntime, "()I"),
NATIVE_METHOD(XposedBridge, startsSystemServer, "()Z"),
NATIVE_METHOD(XposedBridge, getXposedVersion, "()I"),
NATIVE_METHOD(XposedBridge, initNative, "()Z"),
NATIVE_METHOD(XposedBridge, hookMethodNative, "(Ljava/lang/reflect/Member;Ljava/lang/Class;ILjava/lang/Object;)V"),
#ifdef ART_TARGET
Expand Down
1 change: 1 addition & 0 deletions xposed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ bool initialize(bool zygote, bool startSystemServer, const char* className, int
xposed->zygote = zygote;
xposed->startSystemServer = startSystemServer;
xposed->startClassName = className;
xposed->xposedVersionInt = xposedVersionInt;

#if XPOSED_WITH_SELINUX
xposed->isSELinuxEnabled = is_selinux_enabled() == 1;
Expand Down
1 change: 1 addition & 0 deletions xposed_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ struct XposedShared {
bool zygote;
bool startSystemServer;
const char* startClassName;
uint32_t xposedVersionInt;
bool isSELinuxEnabled;
bool isSELinuxEnforcing;

Expand Down

0 comments on commit 155431f

Please sign in to comment.