| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- function trace(tag) {
- Log.e((tag || '') + Java.use('android.util.Log').getStackTraceString(Java.use('java.lang.Throwable').$new()))
- }
- class Log {
- static TAG = '[DG]'
- static Debug = true
- static format(...msg) {
- let m = []
- for (let i = 0; i < msg.length; i++) {
- if (typeof msg[i] === 'object') {
- m.push(msg[i] + '')
- } else {
- m.push(msg[i])
- }
- }
- m = m.join(' ')
- return m
- }
- static i(...msg) {
- if (!this.Debug) return
- console.log(`\x1b[30m${this.TAG} ${this.format(...msg)}\x1b[0m`)
- }
- static w(...msg) {
- console.log(`\x1b[33m${this.TAG} ${this.format(...msg)}\x1b[0m`)
- }
- static e(...msg) {
- console.log(`\x1b[31m${this.TAG} ${this.format(...msg)}\x1b[0m`)
- }
- static s(...msg) {
- console.log(`\x1b[32m${this.TAG} ${this.format(...msg)}\x1b[0m`)
- }
- }
- Java.perform(function () {
- const classLoaders = Java.enumerateClassLoadersSync()
- for (let i of classLoaders) {
- Log.i(i)
- if (i.toString().includes('app_dg_cache')) {
- Log.s('Found DroidGuard ClassLoader:', i)
- Java.classFactory.loader = i
- }
- }
- const DroidGuard = Java.use('com.google.ccc.abuse.droidguard.DroidGuard')
- Log.i('DroidGuard:', DroidGuard)
- // .overload('android.content.Context', 'java.lang.String', '[B')
- // .overload('android.content.Context', 'java.lang.String', '[B', 'java.lang.Object')
- // .overload('android.content.Context', 'java.lang.String', '[B', 'java.lang.Object', 'android.os.Bundle')
- // .overload('android.content.Context', 'java.lang.String', '[B', 'java.lang.Object', 'boolean')
- // .overload('android.content.Context', 'java.lang.String', '[B', 'java.lang.Object', 'android.os.Bundle', 'int')
- // .overload('android.content.Context', 'java.lang.String', '[B', 'java.lang.Object', 'boolean', 'android.os.Bundle')
- DroidGuard.$init.overload('android.content.Context', 'java.lang.String', '[B').implementation = function (
- context,
- str,
- bytes
- ) {
- Log.s('DroidGuard.$init1', str)
- return this.$init(context, str, bytes)
- }
- DroidGuard.$init.overload('android.content.Context', 'java.lang.String', '[B', 'java.lang.Object').implementation =
- function (context, str, bytes, obj) {
- Log.s('DroidGuard.$init2', str, obj)
- return this.$init(context, str, bytes, obj)
- }
- DroidGuard.$init.overload(
- 'android.content.Context',
- 'java.lang.String',
- '[B',
- 'java.lang.Object',
- 'android.os.Bundle'
- ).implementation = function (context, str, bytes, obj, bundle) {
- Log.s('DroidGuard.$init3', str, obj, bundle)
- for(let k of Object.keys(obj)){
- Log.s('obj', k, obj[k])
- }
- return this.$init(context, str, bytes, obj, bundle)
- }
- DroidGuard.$init.overload(
- 'android.content.Context',
- 'java.lang.String',
- '[B',
- 'java.lang.Object',
- 'boolean'
- ).implementation = function (context, str, bytes, obj, bool) {
- Log.s('DroidGuard.$init4', str, obj, bool)
- return this.$init(context, str, bytes, obj, bool)
- }
- DroidGuard.$init.overload(
- 'android.content.Context',
- 'java.lang.String',
- '[B',
- 'java.lang.Object',
- 'android.os.Bundle',
- 'int'
- ).implementation = function (context, str, bytes, obj, bundle, int) {
- Log.s('DroidGuard.$init5', str, obj, bundle, int)
- return this.$init(context, str, bytes, obj, bundle, int)
- }
- DroidGuard.$init.overload(
- 'android.content.Context',
- 'java.lang.String',
- '[B',
- 'java.lang.Object',
- 'boolean',
- 'android.os.Bundle'
- ).implementation = function (context, str, bytes, obj, bool, bundle) {
- Log.s('DroidGuard.$init6', str, obj, bool, bundle)
- return this.$init(context, str, bytes, obj, bool, bundle)
- }
- DroidGuard.ssNative.overload('long', '[Ljava.lang.String;').implementation = function (l, strings) {
- Log.s('DroidGuard.ssNative', l, strings)
- return this.ssNative(l, strings)
- }
- })
|