spoof_phone1.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. const config = {
  34. "mcc": "310",
  35. "mnc": "240",
  36. "iccid": "15946952472810582287",
  37. "number": "3145612379",
  38. "imei": "011546001540649",
  39. "imsi": "310240325454398",
  40. "country": "us"
  41. }
  42. setImmediate(() => {
  43. Java.perform(function () {
  44. function checkPackage(name) {
  45. // return (
  46. // name.startsWith('com.google.android.gsf') ||
  47. // name.startsWith('com.google.android.gms') ||
  48. // name.startsWith('com.google.android.apps') ||
  49. // name.startsWith('com.example')
  50. // )
  51. return true
  52. }
  53. const SubscriptionController = Java.use('com.android.internal.telephony.SubscriptionController')
  54. SubscriptionController.getSimStateForSlotIndex.overload('int').implementation = function (slotIndex) {
  55. const res = this.getSimStateForSlotIndex(slotIndex)
  56. Log.i(`spoof SubscriptionController.getSimStateForSlotIndex(${slotIndex}): ${res} -> 5`)
  57. return 5
  58. }
  59. })
  60. })