_log_gms.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. const mcc = '255'
  2. const mnc = '06'
  3. const simOperator = '25506'
  4. const networkOperator = '25506'
  5. const simSerialNumber = '52463878170561652433'
  6. const iccId = '52463878170561652433'
  7. const number = '739727133'
  8. const imei = '352260057378931'
  9. const imsi = '255064887029478'
  10. const countryIso = 'ua'
  11. const subId = '59'
  12. const androidId = '50b4577c46ef5e96'
  13. const serialNumber = '1955b056'
  14. function trace(tag) {
  15. Log.e((tag || '') + Java.use('android.util.Log').getStackTraceString(Java.use('java.lang.Throwable').$new()))
  16. }
  17. function dump(obj) {
  18. try {
  19. const gson = Java.use('com.google.gson.Gson').$new()
  20. const json = gson.toJson(obj)
  21. return json
  22. } catch (error) {
  23. return ''
  24. }
  25. }
  26. function dumpJson(obj) {
  27. try {
  28. const gson = Java.use('com.google.gson.Gson').$new()
  29. const json = gson.toJson(obj)
  30. return JSON.parse(json)
  31. } catch (error) {
  32. return ''
  33. }
  34. }
  35. class Log {
  36. static TAG = '[GMS]'
  37. static Debug = false
  38. static format(...msg) {
  39. let m = []
  40. for (let i = 0; i < msg.length; i++) {
  41. if (typeof msg[i] === 'object') {
  42. m.push(msg[i] + '')
  43. } else {
  44. m.push(msg[i])
  45. }
  46. }
  47. m = m.join(' ')
  48. return m
  49. }
  50. static i(...msg) {
  51. if (!this.Debug) return
  52. console.log(`\x1b[30m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  53. }
  54. static w(...msg) {
  55. console.log(`\x1b[33m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  56. }
  57. static e(...msg) {
  58. console.log(`\x1b[31m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  59. }
  60. static s(...msg) {
  61. console.log(`\x1b[32m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  62. }
  63. }
  64. Java.perform(function () {
  65. try {
  66. const GsonClass = Java.openClassFile('/sdcard/Android/data/com.google.android.gms/gson.dex')
  67. GsonClass.load()
  68. Log.s('gson class loaded')
  69. } catch (error) {
  70. Log.e('load gson error', error)
  71. }
  72. })