Build

Compile frida-java-bridge#

Installation dependencies#

# install Node.js Current
curl -sL https://deb.nodesource.com/setup_current.x | sudo -E bash -
sudo apt install -y curl git nodejs build-essential
tar -zxvf jdk-8u281-linux-x64.tar.gz ~/work/
  • install Android SDK,NDK

Download with android studio

Config Env#

# java
export JAVA_HOME=/home/i/work/jdk1.8.0_281
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
# android sdk
export ANDROID_SDK_HOME=$HOME/Android/Sdk
export PATH=$PATH:${ANDROID_SDK_HOME}/tools
export PATH=$PATH:${ANDROID_SDK_HOME}/build-tools/30.0.3
export PATH=$PATH:${ANDROID_SDK_HOME}/platform-tools
# android ndk
export NDK_HOME=$HOME/Android/Sdk/ndk/22.0.7026061
export PATH=$NDK_HOME:$PATH

Download source#

git clone https://github.com/frida/frida-java-bridge.git
cd frida-java-bridge
cd test
vim config.mk
  • Change as follows
# Your ANDROID SDK ROOT
ANDROID_SDK_ROOT ?= $(shell echo ~/Android/Sdk)
# Your ANDROID NDK ROOT
ANDROID_NDK_ROOT ?= ~/Android/Sdk/ndk/22.0.7026061
ANDROID_ARCH ?= arm64
ANDROID_ABI ?= arm64-v8a
ANDROID_API_LEVEL ?= 29
ANDROID_BINDIR ?= /system/bin
ANDROID_LIBDIR ?= /system/lib64
APEX_LIBDIRS ?= /apex/com.android.runtime/$(shell basename $(ANDROID_LIBDIR)):/apex/com.android.art/$(shell basename $(ANDROID_LIBDIR))
DEBUG_PORT ?= 5042

make#

cd frida-java-bridge
mkae check

error record#

  • adb: no devices/emulators found

    Connect the device to the computer or start the emulator

  • adb no permissions

    adb devices
    List of devices attached
    FA69H0308097 no permissions (user in plugdev group; are your udev rules wrong?); see [http://developer.android.com/tools/device.html]

    "Charge this phone" to "PTP" (Picture Transfer Protocol).