From 85d02960d31a3ced46a635f890103f459ba4f536 Mon Sep 17 00:00:00 2001 From: iddoeldor Date: Fri, 22 Feb 2019 02:18:28 +0200 Subject: [PATCH] get android id --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 09ea818..c789afb 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ * [`Hook Java reflection`](#hook-refelaction) * [`Trace class`](#trace-class) * [`Hooking Unity3d`](https://github.com/iddoeldor/mplus) - +* [`Get Android ID`](#get-android-id)
@@ -963,6 +963,27 @@ TODO
[⬆ Back to top](#table-of-contents) +#### Get Android ID +The [ANDROID_ID](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID) is unique in each application in Android. + + +```javascript +function getContext() { + return Java.use('android.app.ActivityThread').currentApplication().getApplicationContext().getContentResolver(); +} + +function logAndroidId() { + console.log('[-]', Java.use('android.provider.Settings$Secure').getString(getContext(), 'android_id')); +} +``` + +
+Output example +https://stackoverflow.com/a/54818023/2655092 +
+ +
[⬆ Back to top](#table-of-contents) + #### iOS alert box ```js