wget -qO- https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
make core-android-arm64
make tools-linux-x86_64 PYTHON=$HOME/miniconda3/bin/python
redfin:/data/local/tmp # ./frida-server
{"type":"error","description":"Error: Java API not available","stack":"Error: Java API not available\n at _checkAvailable (frida/node_modules/frida-java-bridge/index.js:298:1)\n at _.perform (frida/node_modules/frida-java-bridge/index.js:203:1)\n at /internal-agent.js:490:6","fileName":"frida/node_modules/frida-java-bridge/index.js","lineNumber":298,"columnNumber":1}
setTimeout(
function() {
Java.perform(function() {
console.log("Hello frida!")
})
}
)//test.js
(base) /data/code/OpenSource/crack/frida/build/frida-linux-x86_64/bin (16.0.11 ✔) ./frida -U -l ../../../../frida_script/test.js com.example.myapplication
____
/ _ | Frida 16.0.11 - A world-class dynamic instrumentation toolkit
| (_| |
> _ | Commands:
/_/ |_| help -> Displays the help system
. . . . object? -> Display information about 'object'
. . . . exit/quit -> Exit
. . . .
. . . . More info at https://frida.re/docs/home/
. . . .
. . . . Connected to AOSP on redfin (id=0A051FDD4003BW)
Failed to spawn: cannot read properties of undefined (reading 'getRunningAppProcesses')
perform (fn) {
this._checkAvailable();if (!this._isAppProcess() || this.classFactory.loader !== null) {
try {
this.vm.perform(fn);
} catch (e) {
Script.nextTick(() => { throw e; });
}
} else {
this._pendingVmOps.push(fn);
if (this._pendingVmOps.length === 1) {
this._performPendingVmOpsWhenReady();
}
}
}
_checkAvailable () {
if (!this.available) {
throw new Error('Java API not available');
}
}
get available () {
return this._tryInitialize();
}_tryInitialize () {
if (this._initialized) {
return true;
}if (this._apiError !== null) {
throw this._apiError;
}let api;
try {
api = getApi();
this.api = api;
} catch (e) {
this._apiError = e;
throw e;
}
if (api === null) {
return false; //只有这里返回为false
}const vm = new VM(api);
this.vm = vm;Types.initialize(vm);
ClassFactory._initialize(vm, api);
this.classFactory = new ClassFactory();this._initialized = true;
return true;
}
// index.js
const getApi = require('./lib/api');// ./lib/api.js
let { getApi, getAndroidVersion } = require('./android');
try {
getAndroidVersion();
} catch (e) {
getApi = require('./jvm').getApi;
}
module.exports = getApi;// ./lib/android.js
function getApi () {
if (cachedApi === null) {
cachedApi = _getApi();
}
return cachedApi;
}function _getApi () {
const vmModules = Process.enumerateModules()
.filter(m => /^lib(art|dvm).so$/.test(m.name))
.filter(m => !/\/system\/fake-libs/.test(m.path));
if (vmModules.length === 0) {
return null; // 这里返回了null
}//以下代码省略...
}
redfin:/ # ps -ef | grep com.example.myapplication
u0_a108 27168 21776 0 11:18:29 ? 00:00:03 com.example.myapplication
root 28255 28250 35 14:11:06 pts/1 00:00:00 grep com.example.myapplication
redfin:/ # cat /proc/27168/maps | grep libart.so
1|redfin:/ #
XACT_DEPS = {
"frida-java-bridge": "6.2.3",
"frida-objc-bridge": "7.0.2",
"frida-swift-bridge": "2.0.6"
}def generate_runtime(backends, arch, endian, input_dir, gum_dir, capstone_incdir, libtcc_incdir, quickcompile, output_dir):
frida_compile = output_dir / "node_modules" / ".bin" / make_script_filename("frida-compile")
if not frida_compile.exists():
pkg_files = [output_dir / "package.json", output_dir / "package-lock.json"]
for f in pkg_files:
if f.exists():
f.unlink()
(output_dir / "tsconfig.json").write_text("{ \"files\": [], \"compilerOptions\": { \"typeRoots\": [] } }", encoding="utf-8")node_modules = output_dir / "node_modules"
if node_modules.exists():
shutil.rmtree(node_modules)npm = os.environ.get("NPM", make_script_filename("npm"))
try:
subprocess.run([npm, "init", "-y"],
capture_output=True,
cwd=output_dir,
check=True)
subprocess.run([npm, "install"] + [f"{name}@{version_spec}" for name, version_spec in RELAXED_DEPS.items()],
capture_output=True,
cwd=output_dir,
check=True)
subprocess.run([npm, "install", "-E"] + [f"{name}@{version_spec}" for name, version_spec in EXACT_DEPS.items()],
capture_output=True,
cwd=output_dir,
check=True) <=========这里下载了EXACT_DEPS里面的依赖项
git clone https://github.com/frida/frida-java-bridge.git
(base) /data/code/OpenSource/crack/frida/frida-java-bridge (main ✗) npm link up to date, audited 3 packages in 574ms
found 0 vulnerabilities
(base) /data/code/OpenSource/crack/frida/frida-java-bridge (main ✗) npm install
added 214 packages, and audited 215 packages in 1s
62 packages are looking for funding
run `npm fund` for detailsfound 0 vulnerabilities
看雪ID:madsu
https://bbs.kanxue.com/user-home-975816.htm
# 往期推荐
3、安卓加固脱壳分享
球分享
球点赞
球在看