find_class.js 1.5 KB

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