Benjamin-Loison / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
0 stars 0 forks source link

[Feature]: Retrieve phone number #34

Open Benjamin-Loison opened 2 months ago

Benjamin-Loison commented 2 months ago

Feature description

Would help Benjamin-Loison/android_packages_apps_Messaging/issues/1.

Additional information

Not read.

Benjamin-Loison commented 2 months ago

https://wiki.termux.com/wiki/Termux:API

termux-telephony-deviceinfo
{
  "data_enabled": "true",
  "data_activity": "dormant",
  "data_state": "connected",
  "device_id": null,
  "device_software_version": "35",
  "phone_count": 2,
  "phone_type": "gsm",
  "network_operator": "20801",
  "network_operator_name": "Orange F",
  "network_country_iso": "fr",
  "network_type": "lte",
  "network_roaming": false,
  "sim_country_iso": "fr",
  "sim_operator": "20801",
  "sim_operator_name": "Orange F",
  "sim_serial_number": null,
  "sim_subscriber_id": null,
  "sim_state": "ready"
}

does not help.

getprop

does not help according to grep 'XX'.

termux-contact-list

I have 2 entries named Benjamin Loison and Moi - Benjamin Loison but I suspect having created those.

termux-telephony-cellinfo
[]
termux-sms-list -l 1 -t sent
[
  {
    "threadid": XX,
    "type": "sent",
    "read": true,
    "sender": "You",
    "number": "06X-XXX-XXXX",
    "received": "2024-XX-XX XX:XX:XX",
    "body": "CENSORED",
    "_id": XXX
  }
]
termux-sms-list -l 1 -t inbox
[
  {
    "threadid": XX,
    "type": "inbox",
    "read": false,
    "number": "+33XXXXXXXXX",
    "received": "2024-08-19 14:XX:XX",
    "body": "CENSORED",
    "_id": XXX
  }
]
Benjamin-Loison commented 1 month ago

Related to Benjamin-Loison/termux-api/issues/18.

The only occurrences of 6XXXXXXXX in termux-call-log seem to be when I try to call myself.

Benjamin-Loison commented 1 month ago

Termux get phone number does not return interesting DuckDuckGo and Google results.

Benjamin-Loison commented 1 month ago

adb get phone number DuckDuckGo and Google first page of results does not seem to work in my case:

The Stack Overflow answers 19201516 and 76504247 do not work with my Fairphone 4 LineageOS even with root.

for iphonesubinfoIndex in `seq 0 30`
do
    adb shell service call iphonesubinfo $iphonesubinfoIndex
done

does not seem to help too.

Benjamin-Loison commented 1 month ago

As announced above:

https://adbshell.com/commands/adb-shell-getprop

adb shell getprop gsm.sim.operator.alpha
Orange F,
adb shell getprop ro.ril.oem.imei

does not return anything.