sms.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. function trace(tag) {
  2. Log.e((tag || '') + Java.use('android.util.Log').getStackTraceString(Java.use('java.lang.Throwable').$new()))
  3. }
  4. class Log {
  5. static TAG = '[GMS]'
  6. static Debug = false
  7. static format(...msg) {
  8. let m = []
  9. for (let i = 0; i < msg.length; i++) {
  10. if (typeof msg[i] === 'object') {
  11. m.push(msg[i] + '')
  12. } else {
  13. m.push(msg[i])
  14. }
  15. }
  16. m = m.join(' ')
  17. return m
  18. }
  19. static i(...msg) {
  20. if (!this.Debug) return
  21. console.log(`\x1b[30m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  22. }
  23. static w(...msg) {
  24. console.log(`\x1b[33m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  25. }
  26. static e(...msg) {
  27. console.log(`\x1b[31m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  28. }
  29. static s(...msg) {
  30. console.log(`\x1b[32m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  31. }
  32. }
  33. Java.perform(function () {
  34. setImmediate(() => {
  35. const bvqg = Java.use('bvqg')
  36. bvqg.h.overload('int').implementation = function (i) {
  37. const res = this.h(3)
  38. Log.i('bvqg.h(3) =', res)
  39. return res
  40. }
  41. })
  42. })