Code Monkey home page Code Monkey logo

Comments (11)

jpage4500 avatar jpage4500 commented on May 23, 2024 1

very cool - thanks. I'll give it a shot

from microg-unofficial-installer.

jpage4500 avatar jpage4500 commented on May 23, 2024 1

the updated script works great! I ran it with lots of devices connected and no issues

I agree it's probably not possible to get the phone number for some of these devices although I am very curious to figure out why.

Here's a device that doesn't return a number:

BASIC INFO

Manufacturer: samsung
Model: SM-G991U1
Device: o1q
Android version: 14
Kernel version: 5.4.233-qgki-27920445-abG991U1UESAFXAB
Device path: 0-1.3.1.4

Serial number: RFCT7000XXX

Android ID: 73a18a000ff0f0ff

Display size: 1080x2400
Display density: 480

SLOT INFO

Slot count: 2

DEFAULT SLOT
IMEI: 352335000000000
IMEI SV: 38
ICCID (SIM serial number): 89012800000000000000

SLOT 1
Slot state: LOADED
IMEI: 352335000000000
Operator: AT&T

SLOT 2
Slot state: NOT_READY
IMEI: 355217000000000

ADVANCED INFO (root may be required)



EFS INFO (root may be required)

Here's another one which does:

BASIC INFO

Manufacturer: samsung
Model: SM-G991U1
Device: o1q
Android version: 14
Kernel version: 5.4.233-qgki-27920445-abG991U1UESAFXAB
Device path: 0-1.2.4.2

Serial number: RFCT7000XFX

Android ID: d2cfd700000000f0

Display size: 1080x2400
Display density: 480

SLOT INFO

Slot count: 2

DEFAULT SLOT
IMEI: 352335000000000
IMEI SV: 38
ICCID (SIM serial number): 89012800000000000000
Line number: 14173000000

SLOT 1
Slot state: LOADED
IMEI: 352335000000000
Operator: AT&T

SLOT 2
Slot state: NOT_READY
IMEI: 355217000000000
Line number: 14173000000

ADVANCED INFO (root may be required)



EFS INFO (root may be required)

from microg-unofficial-installer.

ale5000-git avatar ale5000-git commented on May 23, 2024

@jpage4500
Could you please post the result of every of these commands?

adb shell "service call iphonesubinfo 15 s16 'com.android.shell'"
adb shell "service call iphonesubinfo 16 i32 0 s16 'com.android.shell'"
adb shell "service call iphonesubinfo 16 i32 1 s16 'com.android.shell'"
adb shell "service call iphonesubinfo 16 i32 2 s16 'com.android.shell'"

from microg-unofficial-installer.

jpage4500 avatar jpage4500 commented on May 23, 2024

@ale5000-git

$ adb -s RFCT7103MGE shell "service call iphonesubinfo 15 s16 'com.android.shell'"
Result: Parcel(    00000000 00000000 00000000  '............')

$ adb -s RFCT7103MGE shell "service call iphonesubinfo 16 i32 0 s16 'com.android.shell'"
Result: Parcel(    00000000 ffffffff   '........')

$ adb -s RFCT7103MGE shell "service call iphonesubinfo 16 i32 1 s16 'com.android.shell'"
Result: Parcel(    00000000 ffffffff   '........')

$ adb -s RFCT7103MGE shell "service call iphonesubinfo 16 i32 2 s16 'com.android.shell'"
Result: Parcel(    00000000 00000000 00000000  '............')

from microg-unofficial-installer.

jpage4500 avatar jpage4500 commented on May 23, 2024

FWIW results from a different device (same hardware & carrier)

Result: Parcel(
0x00000000: 00000000 0000000b 00340031 00370031 '........1.X.1.7.'
0x00000010: 00300033 00360038 00380039 00000030 '3.0.8.X.X.X.X...')

Result: Parcel(	00000000 ffffffff   '........')

Result: Parcel(
0x00000000: 00000000 0000000b 00340031 00370031 '........1.X.1.7.'
0x00000010: 00300033 00360038 00380039 00000030 '3.0.8.X.X.X.X...')

Result: Parcel(	00000000 ffffffff   '........')

(I replaced some of the digits with X)

from microg-unofficial-installer.

ale5000-git avatar ale5000-git commented on May 23, 2024

@jpage4500

I have added support for multiple slot in the script and done various improvements.
Could you please retry with version 2.0?

Please post the full output (with some parts covered) but enough to get the idea of what is working and what it isn't.

from microg-unofficial-installer.

jpage4500 avatar jpage4500 commented on May 23, 2024

Hi @ale5000-git -- thanks again for the changes! multiple device support works great! I did have to comment out the root/advanced checks as they caused the script to hang at one point as well as the wait_connection() and start_adb_server() methods. Not sure why but the devices aren't rooted anyway so I figured it wasn't necessary.

Here's the results from 2 devices - 1 that works and another that doesn't. The only differences I noticed between all of them is Kernel version and Device path. Other than that not much difference.

device 1:

BASIC INFO

Manufacturer: samsung
Model: SM-G991U1
Device: o1q
Android version: 14
Kernel version: 5.4.233-qgki-27920445-abG991U1UESAFXAB
Device path: 0-4

Serial number: RFCT7103MGE
�[0;33mWARNING: CPU serial number not found�[0m

Android ID: d14a411e4b4XXXXX

Physical size: 1080x2400
Physical density: 480

SLOT INFO

Slot count: 2

SLOT 1
Slot state: LOADED
IMEI: 3523352899XXXXX
Operator: AT&T
�[0;33mWARNING: Line number not found�[0m

SLOT 2
Slot state: NOT_READY
IMEI: 3552178299XXXXX
Operator: 
�[0;33mWARNING: Line number not found�[0m

DEFAULT SLOT
IMEI: 3523352899XXXXX
IMEI SV: 38
ICCID: 890128043310464XXXXX
�[0;33mWARNING: Line number not found�[0m

device 2:

BASIC INFO

Manufacturer: samsung
Model: SM-G991U1
Device: o1q
Android version: 14
Kernel version: 5.4.233-qgki-27920445-abG991U1UESAFXAB
Device path: 0-1.2.3.1

Serial number: RFCT7103N6M
�[0;33mWARNING: CPU serial number not found�[0m

Android ID: da861077259XXXXX

Physical size: 1080x2400
Physical density: 480

SLOT INFO

Slot count: 2

SLOT 1
Slot state: LOADED
IMEI: 3523352899XXXXX
Operator: AT&T
�[0;33mWARNING: Line number not found�[0m

SLOT 2
Slot state: NOT_READY
IMEI: 3552178299XXXXX
Operator: 
�[0;33mWARNING: Line number not found�[0m

DEFAULT SLOT
IMEI: 3523352899XXXXX
IMEI SV: 38
ICCID: 890128043310464XXXXX
Line number: 177545XXXXX

Let me know if you can think of anything else I can try

from microg-unofficial-installer.

ale5000-git avatar ale5000-git commented on May 23, 2024

@jpage4500
I see that it say Line number not found on SLOT 1 even in the phone where it works so there must be an issue.
Although in most cases iphonesubinfo follow the AOSP code there may be some OEMs that variate it.

The better thing to discover the problem is to see the output of all queries, with this code:

for i in $(seq 22); do
  echo "${i:?}:"
  adb shell "service call iphonesubinfo ${i:?} s16 'com.android.shell'"
done

Could you please send the result of that?
If you don't want to post it here publically, you can send me a private message here: https://xdaforums.com/m/ale5000.5627087/

from microg-unofficial-installer.

jpage4500 avatar jpage4500 commented on May 23, 2024

@ale5000-git - I just sent a PM with details; thanks again!

from microg-unofficial-installer.

ale5000-git avatar ale5000-git commented on May 23, 2024

@jpage4500
Hi,
the phone commands appear to be the same as AOSP but the line number is not returned anywhere.
I have found this: https://stackoverflow.com/questions/52041818/get-phone-number-from-sim-card-with-telephonymanager
which says: getLine1Number(); returns whatever is stored on the SIM card's MSISDN, which isn't filled by some operators.
So I don't think there is any reliable way to get it.


@jpage4500

  1. Could you please try the version 2.7 to see if it still hangs?
  2. What is the problem with start_adb_server()? This is very important otherwise the messages of the starting adb will become part of adb devices and it may break the parsing.
  3. I would also like to know if now (in the phone where it worked) the line number appears correctly on both DEFAULT SLOT and SLOT 1.

I made these changes to the script:

  • The code now, if it sees an offline device, waits a maximum of 5 seconds to see if it comes back online otherwise it will skip it;
  • I rewrote the root and wait code so now it should NO longer hang;
  • Added privacy mode with -p parameter to anonymize sensitive data;
  • Added DEBUG=1 env to include a copy of errors and warning (without color codes) inside STDOUT when redirected to a file.

So now you could get perfect debug output with:
DEBUG=1 device-info.sh -p > output.txt

from microg-unofficial-installer.

ale5000-git avatar ale5000-git commented on May 23, 2024

From what I have read they say that it is the operator who can choose whether or not to write the number on the SIM.
If you want to be sure you can swap the SIM from the device where it doesn't work to the device where does it work to see if the problem follow the SIM.
I also read that on some older Android phones you can manually write the number where it says "Your number" and it will be written on the sim (but I can't confirm this).

Current problems:

  1. I don't see any warning, did you include DEBUG=1 in the command?
    If you included it, this may be another compatibility issue to check for.

  2. I also see that on the phone where it gets the phone number, he puts it in the wrong slot.
    This is an annoying problem, I will try to do some tests in the emulator to try if I can reproduce the problem.

from microg-unofficial-installer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.