Skip to content

Commit

Permalink
Little bit of formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr Fadeev committed Aug 6, 2018
1 parent 6d5b56f commit 87e8603
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Demo of Android linker namespace design
# Accessubg System Private API Through the Android Linker Namespace

## Build

```bash
# Set up `local.properties`
echo "sdk.dir=/path/to/android-sdk-linux" > local.properties
echo "ndk.dir=/path/to/android-ndk-r17b" >> local.properties
# Set up `local.properties`
echo "sdk.dir=/path/to/android-sdk-linux" > local.properties
echo "ndk.dir=/path/to/android-ndk-r17b" >> local.properties

./gradlew build
./gradlew build
```

## Install

```bash
./gradlew installArm8Debug
./gradlew installArm8Debug
```

## Test
Expand Down
16 changes: 9 additions & 7 deletions app/src/main/jni/src/roadtosystem_jni.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ JNIEXPORT jint JNICALL Java_com_example_android_jniapi_RoadToSystem_linkSystemLi
JNIEnv *env, jobject obj) {
const char *lib_path = getLibPath();

struct android_namespace_t *ns = android_create_namespace("trustme",
lib_path,
lib_path,
ANDROID_NAMESPACE_TYPE_SHARED |
ANDROID_NAMESPACE_TYPE_ISOLATED,
"/system/:/data/:/vendor/",
NULL);
struct android_namespace_t *ns = android_create_namespace(
"trustme",
lib_path,
lib_path,
ANDROID_NAMESPACE_TYPE_SHARED |
ANDROID_NAMESPACE_TYPE_ISOLATED,
"/system/:/data/:/vendor/",
NULL);

const android_dlextinfo dlextinfo = {
.flags = ANDROID_DLEXT_USE_NAMESPACE,
.library_namespace = ns,
Expand Down

0 comments on commit 87e8603

Please sign in to comment.