xiongzhu 1 an în urmă
părinte
comite
c4b9708898
4 a modificat fișierele cu 125 adăugiri și 0 ștergeri
  1. 4 0
      euicc.js
  2. 1 0
      euicc.sh
  3. 119 0
      phone.js
  4. 1 0
      phone.sh

+ 4 - 0
euicc.js

@@ -0,0 +1,4 @@
+Java.perform(() => {
+    const TelephonyProvider = Java.use('com.android.providers.telephony.TelephonyProvider')
+    console.log('TelephonyProvider', TelephonyProvider)
+})

+ 1 - 0
euicc.sh

@@ -0,0 +1 @@
+frida -U -l euicc.js "$(frida-ps -U|grep com.google.android.euicc | sed 's/[^0-9]*//g')"

+ 119 - 0
phone.js

@@ -0,0 +1,119 @@
+Java.perform(() => {
+    const PhoneInterfaceManager = Java.use('com.android.phone.PhoneInterfaceManager')
+    PhoneInterfaceManager.getLine1NumberForDisplay.overload(
+        'int',
+        'java.lang.String',
+        'java.lang.String'
+    ).implementation = function (subId, callingPackage, callingFeatureId) {
+        const phoneNumber = this.getLine1NumberForDisplay(subId, callingPackage, callingFeatureId)
+        console.log(
+            `PhoneInterfaceManager.getLine1NumberForDisplay(${subId}, ${callingPackage}, ${callingFeatureId}) => ${phoneNumber}`
+        )
+        return '1234567890'
+    }
+    PhoneInterfaceManager.getNetworkCountryIsoForPhone.overload('int').implementation = function (phoneId) {
+        const countryIso = this.getNetworkCountryIsoForPhone(phoneId)
+        console.log(`PhoneInterfaceManager.getNetworkCountryIsoForPhone(${phoneId}): ${countryIso}`)
+        return 'us'
+    }
+    if (PhoneInterfaceManager.getNetworkCountryIso) {
+        PhoneInterfaceManager.getNetworkCountryIso.overload('int').implementation = function (phoneId) {
+            const countryIso = this.getNetworkCountryIso(phoneId)
+            console.log(`PhoneInterfaceManager.getNetworkCountryIso(${phoneId}): ${countryIso}`)
+            return 'us'
+        }
+    }
+    PhoneInterfaceManager.getImeiForSlot.overload('int', 'java.lang.String', 'java.lang.String').implementation =
+        function (slotId, callingPackage, callingFeatureId) {
+            const imei = this.getImeiForSlot(slotId, callingPackage, callingFeatureId)
+            console.log(
+                `PhoneInterfaceManager.getImeiForSlot(${slotId}, ${callingPackage}, ${callingFeatureId}): ${imei}`
+            )
+            return '123456789012345'
+        }
+
+    const SubscriptionController = Java.use('com.android.internal.telephony.SubscriptionController')
+    const SubsciptionInfo = Java.use('android.telephony.SubscriptionInfo')
+    SubscriptionController.getPhoneNumberFromFirstAvailableSource.overload(
+        'int',
+        'java.lang.String',
+        'java.lang.String'
+    ).implementation = function (subId, callingPackage, callingFeatureId) {
+        const phoneNumber = this.getPhoneNumberFromFirstAvailableSource(subId, callingPackage, callingFeatureId)
+        console.log(
+            `SubscriptionController.getPhoneNumberFromFirstAvailableSource(${subId}, ${callingPackage}, ${callingFeatureId}) => ${phoneNumber}`
+        )
+        return '1234567890'
+    }
+    SubscriptionController.getActiveSubscriptionInfoList.overload('java.lang.String').implementation = function (
+        callingPackage
+    ) {
+        const list = this.getActiveSubscriptionInfoList(callingPackage)
+        const newList = Java.use('java.util.ArrayList').$new()
+        for (let i = 0; i < list.size(); i++) {
+            const info = Java.cast(list.get(i), SubsciptionInfo)
+            info.mMcc.value = '123'
+            info.mMnc.value = '456'
+            info.mCountryIso.value = 'us'
+            info.mIccId.value = '1234567890'
+            newList.add(info)
+        }
+        return newList
+    }
+    SubscriptionController.getActiveSubscriptionInfoList.overload(
+        'java.lang.String',
+        'java.lang.String'
+    ).implementation = function (callingPackage, callingFeatureId) {
+        const list = this.getActiveSubscriptionInfoList(callingPackage, callingFeatureId)
+        const newList = Java.use('java.util.ArrayList').$new()
+        for (let i = 0; i < list.size(); i++) {
+            const info = Java.cast(list.get(i), SubsciptionInfo)
+            info.mMcc.value = '123'
+            info.mMnc.value = '456'
+            info.mCountryIso.value = 'us'
+            info.mIccId.value = '1234567890'
+            newList.add(info)
+        }
+        return newList
+    }
+    SubscriptionController.getSimStateForSlotIndex.overload('int').implementation = function (slotIndex) {
+        const simState = this.getSimStateForSlotIndex(slotIndex)
+        console.log(`SubscriptionController.getSimStateForSlotIndex(${slotIndex}) => ${simState}`)
+        return 5
+    }
+
+    const PhoneSubInfoController = Java.use('com.android.internal.telephony.PhoneSubInfoController')
+    PhoneSubInfoController.getIccSerialNumberForSubscriber.overload(
+        'int',
+        'java.lang.String',
+        'java.lang.String'
+    ).implementation = function (subId, callingPackage, callingFeatureId) {
+        const iccSerialNumber = this.getIccSerialNumberForSubscriber(subId, callingPackage, callingFeatureId)
+        console.log(
+            `PhoneSubInfoController.getIccSerialNumberForSubscriber(${subId}, ${callingPackage}, ${callingFeatureId}) => ${iccSerialNumber}`
+        )
+        return '1234567890'
+    }
+    PhoneSubInfoController.getSubscriberIdForSubscriber.overload(
+        'int',
+        'java.lang.String',
+        'java.lang.String'
+    ).implementation = function (subId, callingPackage, callingFeatureId) {
+        const subscriberId = this.getSubscriberIdForSubscriber(subId, callingPackage, callingFeatureId)
+        console.log(
+            `PhoneSubInfoController.getSubscriberIdForSubscriber(${subId}, ${callingPackage}, ${callingFeatureId}) => ${subscriberId}`
+        )
+        return '1234567890'
+    }
+
+    const SystemProperties = Java.use('android.os.SystemProperties')
+    console.log('SystemProperties', SystemProperties)
+    SystemProperties.set('gsm.sim.operator.iso-country', 'us')
+    SystemProperties.set('gsm.sim.operator.numeric', '123456')
+    SystemProperties.set('gsm.operator.numeric', '123456')
+    console.log(
+        SystemProperties.get('gsm.sim.operator.iso-country'),
+        SystemProperties.get('gsm.sim.operator.numeric'),
+        SystemProperties.get('gsm.operator.numeric')
+    )
+})

+ 1 - 0
phone.sh

@@ -0,0 +1 @@
+frida -U -l phone.js "$(frida-ps -U|grep com.android.phone | sed 's/[^0-9]*//g')"