-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
83 lines (59 loc) · 3.28 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#
# Makefile to build injector, victim and agent
#
FRIDA_VERSION := 12.11.8
FRIDA_EXT_PATH := $(abspath ./ext/frida-core)
OUTPUT_BIN_DIR := $(abspath ./bin)
BUILD_DIR := $(abspath ./build)
default: all
.PHONY: all deploy clean
all: build-injector-x86 build-injector-x86_64 build-injector-arm build-injector-arm64
build-injector-x86: $(FRIDA_EXT_PATH)/android-x86/.stamp
@echo [+] Building Injector - x86
@ndk-build -B NDK_PROJECT_PATH=. NDK_APPLICATION_MK=./Application.mk NDK_APP_DST_DIR=$(OUTPUT_BIN_DIR) NDK_APP_OUT=$(BUILD_DIR) APP_BUILD_SCRIPT=./Android.mk FRIDA_EXT_PATH=$(FRIDA_EXT_PATH) APP_ABI=x86
build-injector-x86_64: $(FRIDA_EXT_PATH)/android-x86_64/.stamp
@echo [+] Building Injector - x86_64
@ndk-build -B NDK_PROJECT_PATH=. NDK_APPLICATION_MK=./Application.mk NDK_APP_DST_DIR=$(OUTPUT_BIN_DIR) NDK_APP_OUT=$(BUILD_DIR) APP_BUILD_SCRIPT=./Android.mk FRIDA_EXT_PATH=$(FRIDA_EXT_PATH) APP_ABI=x86_64
build-injector-arm: $(FRIDA_EXT_PATH)/android-arm/.stamp
@echo [+] Building Injector - armeabi-v7a
@ndk-build -B NDK_PROJECT_PATH=. NDK_APPLICATION_MK=./Application.mk NDK_APP_DST_DIR=$(OUTPUT_BIN_DIR) NDK_APP_OUT=$(BUILD_DIR) APP_BUILD_SCRIPT=./Android.mk FRIDA_EXT_PATH=$(FRIDA_EXT_PATH) APP_ABI=armeabi-v7a
build-injector-arm64: $(FRIDA_EXT_PATH)/android-arm64/.stamp
@echo [+] Building Injector - arm64-v8a
@ndk-build -B NDK_PROJECT_PATH=. NDK_APPLICATION_MK=./Application.mk NDK_APP_DST_DIR=$(OUTPUT_BIN_DIR) NDK_APP_OUT=$(BUILD_DIR) APP_BUILD_SCRIPT=./Android.mk FRIDA_EXT_PATH=$(FRIDA_EXT_PATH) APP_ABI=arm64-v8a
$(FRIDA_EXT_PATH)/android-x86/.stamp:
$(eval FRIDA_CORE_DEVKIT_URL := https://github.com/frida/frida/releases/download/$(FRIDA_VERSION)/frida-core-devkit-$(FRIDA_VERSION)-android-x86.tar.xz)
@echo [+] Fetching Frida DevKit for x86: $(FRIDA_CORE_DEVKIT_URL)
@mkdir -p $(@D)
@rm -f $(@D)/*
@curl -Ls $(FRIDA_CORE_DEVKIT_URL) | xz -d | tar -C $(@D) -xf -
@touch $@
$(FRIDA_EXT_PATH)/android-x86_64/.stamp:
$(eval FRIDA_CORE_DEVKIT_URL := https://github.com/frida/frida/releases/download/$(FRIDA_VERSION)/frida-core-devkit-$(FRIDA_VERSION)-android-x86_64.tar.xz)
@echo [+] Fetching Frida DevKit for x86_64: $(FRIDA_CORE_DEVKIT_URL)
@mkdir -p $(@D)
@rm -f $(@D)/*
@curl -Ls $(FRIDA_CORE_DEVKIT_URL) | xz -d | tar -C $(@D) -xf -
@touch $@
$(FRIDA_EXT_PATH)/android-arm/.stamp:
$(eval FRIDA_CORE_DEVKIT_URL := https://github.com/frida/frida/releases/download/$(FRIDA_VERSION)/frida-core-devkit-$(FRIDA_VERSION)-android-arm.tar.xz)
@echo [+] Fetching Frida DevKit for arm: $(FRIDA_CORE_DEVKIT_URL)
@mkdir -p $(@D)
@rm -f $(@D)/*
@curl -Ls $(FRIDA_CORE_DEVKIT_URL) | xz -d | tar -C $(@D) -xf -
@touch $@
$(FRIDA_EXT_PATH)/android-arm64/.stamp:
$(eval FRIDA_CORE_DEVKIT_URL := https://github.com/frida/frida/releases/download/$(FRIDA_VERSION)/frida-core-devkit-$(FRIDA_VERSION)-android-arm64.tar.xz)
@echo [+] Fetching Frida DevKit for arm64: $(FRIDA_CORE_DEVKIT_URL)
@mkdir -p $(@D)
@rm -f $(@D)/*
@curl -Ls $(FRIDA_CORE_DEVKIT_URL) | xz -d | tar -C $(@D) -xf -
@touch $@
clean:
@echo Removing build dir: $(abspath ./build)
@rm -rf $(abspath ./build)
@echo Removing bin dir: $(abspath ./bin)
@rm -rf $(abspath ./bin)
deploy:
@adb shell "rm -rf /data/local/tmp/injection"
@adb shell "mkdir /data/local/tmp/injection"
@adb push $(abspath ./bin)/* /data/local/tmp/injection