Skip to content

Commit

Permalink
add some information about the Xposed binary and the phone into the log
Browse files Browse the repository at this point in the history
For example:
D/Xposed  (19345): Starting Xposed binary version 30, compiled for SDK 17
D/Xposed  (19345): Phone GT-I9100 (samsung), Android version 4.2.1 (SDK 17)
D/Xposed  (19345): ROM: cm_i9100-userdebug 4.2.1 JOP40D eng..20130105.024510 test-keys
I/Xposed  (19345): -----------------
I/Xposed  (19345): Added Xposed (/data/xposed/XposedBridge.jar) to CLASSPATH.
I/Xposed  (19345): Found Xposed class 'de/robv/android/xposed/XposedBridge', now initializing
  • Loading branch information
rovo89 committed Jan 7, 2013
1 parent 4cb6b43 commit 66e768a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions app_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ int main(int argc, const char* const argv[])

runtime.mParentDir = parentDir;

xposedInfo();
keepLoadingXposed = !isXposedDisabled() && !xposedShouldIgnoreCommand(className, argc, argv) && addXposedToClasspath(zygote);

if (zygote) {
Expand Down
19 changes: 19 additions & 0 deletions xposed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <stdio.h>
#include <sys/mman.h>
#include <cutils/properties.h>

#ifdef WITH_JIT
#include <interp/Jit.h>
Expand All @@ -43,6 +44,24 @@ const char* startClassName = NULL;
// called directoy by app_process
////////////////////////////////////////////////////////////

void xposedInfo() {
char release[PROPERTY_VALUE_MAX];
char sdk[PROPERTY_VALUE_MAX];
char manufacturer[PROPERTY_VALUE_MAX];
char model[PROPERTY_VALUE_MAX];
char rom[PROPERTY_VALUE_MAX];

property_get("ro.build.version.release", release, "n/a");
property_get("ro.build.version.sdk", sdk, "n/a");
property_get("ro.product.manufacturer", manufacturer, "n/a");
property_get("ro.product.model", model, "n/a");
property_get("ro.build.display.id", rom, "n/a");

ALOGD("Starting Xposed binary version %s, compiled for SDK %d\n", XPOSED_VERSION, PLATFORM_SDK_VERSION);
ALOGD("Phone: %s (%s), Android version %s (SDK %s)\n", model, manufacturer, release, sdk);
ALOGD("ROM: %s\n", rom);
}

bool isXposedDisabled() {
// is the blocker file present?
if (access(XPOSED_LOAD_BLOCKER, F_OK) == 0) {
Expand Down
3 changes: 2 additions & 1 deletion xposed.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace android {
#define XPOSED_CLASS "de/robv/android/xposed/XposedBridge"
#define XPOSED_CLASS_DOTS "de.robv.android.xposed.XposedBridge"
#define XRESOURCES_CLASS "android/content/res/XResources"
#define XPOSED_VERSION "29"
#define XPOSED_VERSION "30"

#ifndef ALOGD
#define ALOGD LOGD
Expand All @@ -26,6 +26,7 @@ extern bool keepLoadingXposed;
typedef std::list<Method>::iterator XposedOriginalMethodsIt;

// called directoy by app_process
void xposedInfo();
bool isXposedDisabled();
bool xposedShouldIgnoreCommand(const char* className, int argc, const char* const argv[]);
bool addXposedToClasspath(bool zygote);
Expand Down

0 comments on commit 66e768a

Please sign in to comment.