How to obtain MDN or Telephone number from a script - Android Software/Hacking General [Developers Only]

Hello all,
I am creating a universal flash to enable web/mms for android devices on alternate carriers (i.e. Cricket/Metro PCS). The issue i am having is that some of the MMS settings require the users telephone number to send properly (for authentication i believe)
My current flash file is here:
http://forum.xda-developers.com/showthread.php?t=730289
You can view the code to see what im doing so far, but this uses a generic MMSC rather than one specific to the user as it should be for cricket. I don't know if there is any reason to have it authenticate with the correct user information for cricket or metropcs but im trying to make it as authentic as possible.
I am working to try to get this done in a script ran from recovery that sets this information dynamically for each phone without any user interaction other than flashing the file.
Is it possible to obtain the MDN or the Telephone number via a script or is this something i would need to build an apk to obtain?
i found this snippet:
Code:
TelephonyManager tManager = (TelephonyManager)myActivity.getSystemService(Context.TELEPHONY_SERVICE);
String uid = tManager.getDeviceId();
but this appears to be something that would go in while building an apk. My goal is to have a simple flash that can be done, but if needed i can start work on my first apk to accomplish the goal.
Any suggestions or feedback are welcome, Thanks in advance.

Related

[Q] OpenVPN + Samsung Galaxy S = problems

Greetings,
I realise this may have been asked a number of times before on this forum (and other forums, for that matter), but my circumstances don't appear to be quite the same as those of the people asking if any of the Google searching I've done is anything to go by (correct me if I'm wrong, once you've read this):
I recently got a Samsung Galaxy S on Vodafone UK (see below for more firmware details) which I have since rooted, and I was hoping get OpenVPN working on it using OpenVPN Installer and OpenVPN Settings from the Android Market. I understand as part of the process that I need a module named tun.ko which ordinarily has to have been compiled specifically for a particular phone, yes? With that in mind I was hoping to be able to use this post from a thread I dug up during a search of this forum in order to help me. So I loaded this onto my phone's internal storage and then inserted the exact path accordingly into OpenVPN Settings, however I get the below error when I try to initiate a new tunnel:
Code:
FATAL: cannot allocate tun/tap dev dynamically
Here are the things I've tried up to now to get this working (in no particular order), which so far haven't worked:
1) Installed BusyBox Installer from the Android Market, in order to install BusyBox (obviously ) which I understand OpenVPN Settings requires to initiate a new tunnel.
- Having done this I have also tried re-installing OpenVPN via OpenVPN Installer, and redefining the path to BusyBox's 'ifconfig' and 'route' processes, which I understand the OpenVPN Settings app uses.​
2) Tried switching between 'modprobe' and 'insmod' as the chosen method of calling the tun module prior to tunnel initialisation.
3) Tried moving the tun.ko module I downloaded from the above linked post to different locations, then add the exact path in OpenVPN Settings accordingly.
4) Tried using various differing tun modules downloaded from different webpages, loading each one in turn as above.
5) Tried switching between 3G and Wi-Fi hoping that somehow the behaviour would change (was running out of ideas at this point ).
6) I read somewhere that you can compile your own tun.ko module using the kernel source code that matches your particular firmware version, so I tried visiting the link referenced in the above linked post [http://opensource.samsung.com/] in order to find the source code for my phone. However I can't seem to find my exact firmware listed (see below for my firmware). Incidentally how exactly would you compile your own module from the source code? Does this require the Android SDK, which I have readily available? [EDIT: I've had another look at the list of source code downloads for my phone and I noticed one entitled 'GT-I9000_OpenSource_Froyo_update2.zip' for the so-called 'JPX' version, which appears to be for the European versions of the handset. Do I assume the 'X' here is a wildcard in place of whatever letter or number represents the user's firmware, or does the 'X' represent the actual firmware version itself?]
7) Tried manually editing the .ovpn config file to read 'dev tun' instead of 'dev tap' as it was originally (I can post the full config file if anyone requires it for the troubleshooting process, perhaps there's something here I've missed).
If it helps at all here are the firmware details for my handset (taken from 'About phone' section under 'Settings'):
Code:
Model number: GT-I9000
Firmware version: 2.2
Baseband version: I9000BUJP5
Kernel version: 2.6.32.9
[email protected] #1
Build number: FROYO.BUJP7
N.B. This was pre-loaded onto the phone (probably by Vodafone), I haven't flashed/updated it with anything else.
Any help would be appreciated. Thanks.
Regards,
Jon.
Bump, this forum seems to get a lot of activity!
Bump. Still no help?
Why don't you install a kernel with TUN support? voodoo and hardcore do support it.
I'm using hardcore's and my OpenVPN connection works without any problems. See this post for more inform about the client and server settings:
http://forum.xda-developers.com/showpost.php?p=11299020&postcount=3

[Q] WhisperPush removal

Hi guys,
At one point I was running Cyanogenmod, and had enabled WhisperPush without knowing how to use it. That installation is long gone, and I now have another phone, not running CM. I'd like to use TextSecure now - but when registering, it tells me that I need to unregister. Full message:
"Registration conflict"
"This numer is already registered on a different TextSecure server (CyanogenMod?). You must unregister there before registering here."
How on earth do I do that? As stated - I do not have access to the CM installation with the required XML file (with which I could do some magic via ADB).
Some people on the internetz refer to a Ruby script on https://github.com/daveio/whisperpush-unregister - but this yields nothing but Ruby errors (looks like code errors).
Does anyone know how to fix this problem?
ad9fe7uhasf said:
Hi guys,
At one point I was running Cyanogenmod, and had enabled WhisperPush without knowing how to use it. That installation is long gone, and I now have another phone, not running CM. I'd like to use TextSecure now - but when registering, it tells me that I need to unregister. Full message:
"Registration conflict"
"This numer is already registered on a different TextSecure server (CyanogenMod?). You must unregister there before registering here."
How on earth do I do that? As stated - I do not have access to the CM installation with the required XML file (with which I could do some magic via ADB).
Some people on the internetz refer to a Ruby script on https://github.com/daveio/whisperpush-unregister - but this yields nothing but Ruby errors (looks like code errors).
Does anyone know how to fix this problem?
Click to expand...
Click to collapse
MOD: Please delete my post. I didnt RTFM. (wrong Ruby version)

[TOOL] [ALL OS] Samsung AKSEED Challenge Calculator

Maybe some people have been wanting this or may run into needing it for something at some point. Some AT operations like IMEISIGN require an AKSEEDNO request and response to be fulfilled before continuing the process. This script will calculate the values you need to send back to the baseband given the set of 3 numbers the baseband gives you from the original request. The numbers the baseband gives back is different on each request to AKSEEDNO.
The script is written in Python, so it will work with any OS that supports Python.
Download and usage available on GitHub:
github.com/ghassani/akseed-calculator (maybe a mod can make this a link since I do not have permission to :[ )
Shout out to mraabhimself for his assistance
**FREE PALESTINE**

[Resolved] PLEASE HELP, no call id, my phone does not recognize the international country code

PLEASE HELP...
My phone is TCL M3G, LEWA OS, version 3.1 (multi language LEWA ROM ), android version 5.0.2 64bit.
(i know chinese phone etc, but ....)
I have call id problems (on phone and sms/mms), my phone does not recognize the international country code (prefixes).
Stock phone application in my phone, when I call my a number from my contacts for example +300123456789 all fine, but when I called the (same) number 0123456789 is unknown (because there is no +30 or +7).
What can I do?
Can I delete the stock phone app? Try TruePhone application and other applications, but nothing when there is an incoming or outgoing call ( from my contacts) does not have the call identifier.
So when I called the number with the international code of the country that my phone does not recognize the international country code .... and the number is unknown.
It is difficult to add at all my contacts number with country code and the number without the country code ..
Try different thinks of the Internet, but nothing....https://www.google.gr/search?hl=el&...=android+phone+doesn't+recognize+country+code and https://www.google.gr/search?biw=12......1c.1.64.serp..9.6.1460...30i10.nuNIzki2YMg
Try to make all my contacts in the international format, but when I call a number from my contacts, without international format (without a country code in the national format) does not have the call identifier.
This is a common problem for android phones, but the solution is deferent on deferent android versions .... I think. It is necessary to make changes on android system components, to make modifications on the ROM.
PLEASE HELP...
dedalos91 said:
PLEASE HELP...
My phone is TCL M3G, LEWA OS, version 3.1 (multi language LEWA ROM ), android version 5.0.2 64bit.
(i know chinese phone etc, but ....)
I have call id problems (on phone and sms/mms), my phone does not recognize the international country code (prefixes).
Stock phone application in my phone, when I call my a number from my contacts for example +300123456789 all fine, but when I called the (same) number 0123456789 is unknown (because there is no +30 or +7).
What can I do?
Can I delete the stock phone app? Try TruePhone application and other applications, but nothing when there is an incoming or outgoing call ( from my contacts) does not have the call identifier.
So when I called the number with the international code of the country that my phone does not recognize the international country code .... and the number is unknown.
It is difficult to add at all my contacts number with country code and the number without the country code ..
Try different thinks of the Internet, but nothing....https://www.google.gr/search?hl=el&...=android+phone+doesn't+recognize+country+code and https://www.google.gr/search?biw=12......1c.1.64.serp..9.6.1460...30i10.nuNIzki2YMg
Try to make all my contacts in the international format, but when I call a number from my contacts, without international format (without a country code in the national format) does not have the call identifier.
This is a common problem for android phones, but the solution is deferent on deferent android versions .... I think. It is necessary to make changes on android system components, to make modifications on the ROM.
PLEASE HELP...
Click to expand...
Click to collapse
Hello,
Finally in my case this is the solution (tested on my phone and work fine)....
After so much searching and reading on Internet the solution is the editing of the system file build.prop ("/system/build.prop").
This is the editing (edit some code and adding some new code):
# lewa begin, for number match
persist.env.c.phone.matchnum=10
# lewa end
# Country code fix,phone,sms
ro.phone.min_match=10
# Fix end
editing
persist.env.c.phone.matchnum=10 > change the number from 11 to 10
10 in my country is the total numbers of a phone number without international country code (+39 or 0039 etc), put the correct number for you...how match digits is on your country?
and
adding new code
# Country code fix,phone,sms
ro.phone.min_match=10
# Fix end
the text after "#" it is just a free text message.
After editing reboot your phone and maybe must delete your contacts (or clear data contacts storage) and restore contacts form SD card or from your Google account (synchronizing your contacts).
You must sure the changes on build.prop has saved (please check, open it via root explorer as text).
Make the changes like that:
via root explorer you can see the permissions of build.prop (save a copy of original file) > copy the build.prop on yous SD card > open it via text editor and make the editing > then delete the system/build.prop file > copy the editing build.prop file from your SD card to system/ > give it the correct permissions > clear call log > reboot your phone.
The solution is from here https://code.google.com/p/android/issues/detail?id=23092
THANKS

Fix 4g/LTE Data On Sprint With Lineage Base (Also GSI)

If You're Like Me And Have Sprint, But Having
Issues With 4g/LTE Data On Lineage Based Roms
(Including GSI), Then Here's The Fix. I've Done This
Multiple Times, And It's Worked Great. Everything
You Need Is In The Zip As Well.
=====================================
Once The Rom Is Fully Installed And Booted,
Go To Settings, Network & Internet, Mobile Network,
Advanced, And Access Point Names. You'll Be Adding
A NEW APN, Exactly As Below. Screenshots Attached
As Well.
=====================================
Name : Sprint
APN : x.ispsn
Proxy : Not Set
Port : Not Set
Username : Not Set
Password : Not Set
Server : Not Set
MMSC : http://mms.sprintpcs.com/servlets/mms/
MMS Proxy : Not Set
MMS Port : Not Set
MCC : 310 ***
MNC : 120 ***
Authentication Type : Not Set
APN Type : default,mms,supl,hipri,fota,ims,cbs
APN Protocol : IPv4/IPv6
APN Roaming Protocol : IPv4/IPv6
Bearer : Unspecified
MNVO Type : None
=====================================
Once The APN Has Been Added, Push The 3 Dots
Up Top, And Click Save. Then Make Sure The NEW
APN Is Selected.
=====================================
https://cp.sync.com/dl/f6482b210/ab97w3j2-uevmigxz-2fpjeehn-i64ig32i
Download And Unzip The Zip Provided (sprintfix.zip). Reboot Your
Phone Into Bootloader Mode. Once In Bootloader Mode, Open A
Command Prompt / Powershell In The Zip Folder By Holding Down
Shift, Right Clicking, And Then Selecting The Option For
"Open Command Prompt / Powershell Here"
=====================================
Directions For Command Prompt:
Type In The Following Command Without Quotes "mfastboot flash modem non-hlos.bin"
Once That Finishes, Type In The Next Command, Without Quotes "mfastboot erase carrier".
Then Finally, "mfastboot reboot".
Directions For Powershell:
Same As Command Prompt, EXCEPT: change "mfastboot" to ".\mfastboot".
=====================================
If You Mess With The APN Settings, Or Change It Around, You'll Have To Do
These Steps Again.
Showing 4g On Sprint
Pictures
good news for Sprint users
What's the point of SprintDM and Carrier Provisioning Service if 4G relies on a Modem & APN? The world may never know.
Thanks for this, now Fi users can also get full Sprint access (if they need it).
murrty said:
What's the point of SprintDM and Carrier Provisioning Service if 4G relies on a Modem & APN? The world may never know.
Thanks for this, now Fi users can also get full Sprint access (if they need it).
Click to expand...
Click to collapse
The verdict is out on whether this works for FI at the moment. Currently it's a guide for straight sprint. If someone gets this working with FI, please post
This doesn't work on Project FI because APN settings are disabled by the Project FI app.
michael28056 said:
This doesn't work on Project FI because APN settings are disabled by the Project FI app.
Click to expand...
Click to collapse
I have an idea for fi, give me a few and I'll post my suggestion. On the road at a red light lol
EDIT: Working on my idea now
If someone with FI, on a lineage base (or GSI) having issues with FI days could PM me, I have an idea I'd like tried before I post it.
Message sent I'm interested in being guinea pig.
Sorry, been sick the past couple days. I got a fi sim, and tried it out. Didn't work
I switched to project fi, this fix does work.
Tried this fix for the GSI 9.0 ROM, using Project FI. Everything else seems to work just fine. Keep getting the message about SprintDM stopping anytime I try to connect to Sprint. Either through Fi Activation or using dialer codes. Anyone else have the same issue?
Nick1801 said:
Tried this fix for the GSI 9.0 ROM, using Project FI. Everything else seems to work just fine. Keep getting the message about SprintDM stopping anytime I try to connect to Sprint. Either through Fi Activation or using dialer codes. Anyone else have the same issue?
Click to expand...
Click to collapse
Yes, Sprint will only connect to 3G as well, logcat said something about missing a Java file ( or class), the file is there so I'm going to open Java file and see if I can figure anything out, don't expect much from me though.
QWZR II said:
Yes, Sprint will only connect to 3G as well, logcat said something about missing a Java file ( or class), the file is there so I'm going to open Java file and see if I can figure anything out, don't expect much from me though.
Click to expand...
Click to collapse
Sprint doesn't even connect on 3g for me, as soon as it tries to connect with Sprint, I get the SprintDM.apk has closed error. Then it switches over to Tmo. I wouldn't even really mind if Tmo worked at all in my area. Hate to go back to stock just for Sprint lol. I was going to attempt to maybe replace the SprintDM.apk in the system files. I noticed the one in there has a build date from 1969.
Not sure if that even matter, might trip up some kind of security. Like when the date on Windows is set incorrectly? Just guessing. Going to stick with the Wi-Fi/Tmo service as long as I can, don't want to end the Pie love affair yet.
Nick1801 said:
Sprint doesn't even connect on 3g for me, as soon as it tries to connect with Sprint, I get the SprintDM.apk has closed error. Then it switches over to Tmo. I wouldn't even really mind if Tmo worked at all in my area. Hate to go back to stock just for Sprint lol. I was going to attempt to maybe replace the SprintDM.apk in the system files. I noticed the one in there has a build date from 1969.
Not sure if that even matter, might trip up some kind of security. Like when the date on Windows is set incorrectly? Just guessing. Going to stick with the Wi-Fi/Tmo service as long as I can, don't want to end the Pie love affair yet.
Click to expand...
Click to collapse
I was trying that, it won't install because it's a system app and the uid (not sure on the actual error) is mismatched. Looking it up online suggested either editing manifest xml or clearing odex file from priv app, which I couldn't find a way to do successfully.
QWZR II said:
I was trying that, it won't install because it's a system app and the uid (not sure on the actual error) is mismatched. Looking it up online suggested either editing manifest xml or clearing odex file from priv app, which I couldn't find a way to do that didn't involve "lucky patcher" which won't work if you've already removed using terminal debloater.
Click to expand...
Click to collapse
I'm just sticking with T-Mobile and Wifi for now. Don't want to go back to 8.1 after using 9. Maybe someone will have a fix eventually, I'm sure that's more likely than Moto actually releasing Pie this year.
Anymore information on if this works with Project Fi? I am on Project Fi and would like to run Lineage but went back to stock for the fact that my data for Sprint and US Cellular were not working. I had to leave my phone on T-Mobile all the time which is not optimal where I drive and live. I need my phone to be able to get data in remote locations through the different carriers. I ran LOS 15.1 Unofficial, Official and LOS 16 Unofficial. None of them had mobile data on Sprint or US Cellular. Only T-Mobile. I tried installing SprintDM in system to no avail.
A thought, I have had Fi since beginning. Now with US Cellular added, it's a must for my area of coverage. I live in a remote (cell wise) area and only US Cellular works. So my Moto X4 is stock until Pie updates for all above reasons. On my Nexus 5X I could not use any Lineage based roms because of the Sprint/Fi problem. From What I have found Lineage went from complete ASOP to some else after 14.X for certain system based files for carriers. Especially Sprint APN's. My knowledge is limited on how or why. Even with my returned Pixel 2 and now Pixel (unlocked Verizon) I have to stay with Google based app+apk's roms to have ALL Fi Carriers switching with out problems. I still can't use Lineage based roms + apks to get Carrier switching to work on my Pixel. So can somebody figure out how to still use original Moto X4 Fi App packages? That may fix it.
I have all 3 networks working with 4G on my phone on the latest version of LOS 16. I had to add in some files I pulled from the latest Pixel 3 Rom. I'm not sure if all the files I grabbed are needed since I'm not an expert by any means but what I added seemed to get all three networks working.
I haven't had much chance to test auto switching because I'm generally always on T-Mo.
I also flashed the NON-HLOS.bin from the latest stock rom as well following the instructions in OP's post. I didn't bother creating the apn.
After rebooting I cleared the data for the project-fi app and let the service re-activate.
Not sure if it matters but I also have the stock gapps package installed.
I'll attach the files I used showing the paths where I copied the files to. I just overwrote whichever files were already there. I would make a twrp zip to install these files but I'm not sure how to do that if someone else wants to take a crack at it feel free.
https://ln.sync.com/dl/b36c27e30/qvzjf7v2-jwmzmqy7-uxua4x76-cjy3brq2
slaytanic said:
If You're Like Me And Have Sprint, But Having
Issues With 4g/LTE Data On Lineage Based Roms
(Including GSI), Then Here's The Fix. I've Done This
Multiple Times, And It's Worked Great. Everything
You Need Is In The Zip As Well.
=====================================
Once The Rom Is Fully Installed And Booted,
Go To Settings, Network & Internet, Mobile Network,
Advanced, And Access Point Names. You'll Be Adding
A NEW APN, Exactly As Below. Screenshots Attached
As Well.
=====================================
Name : Sprint
APN : x.ispsn
Proxy : Not Set
Port : Not Set
Username : Not Set
Password : Not Set
Server : Not Set
MMSC : http://mms.sprintpcs.com/servlets/mms/
MMS Proxy : Not Set
MMS Port : Not Set
MCC : 310 ***
MNC : 120 ***
Authentication Type : Not Set
APN Type : default,mms,supl,hipri,fota,ims,cbs
APN Protocol : IPv4/IPv6
APN Roaming Protocol : IPv4/IPv6
Bearer : Unspecified
MNVO Type : None
=====================================
Once The APN Has Been Added, Push The 3 Dots
Up Top, And Click Save. Then Make Sure The NEW
APN Is Selected.
=====================================
https://ln.sync.com/dl/f6482b210/ab97w3j2-uevmigxz-2fpjeehn-i64ig32i
Download And Unzip The Zip Provided (sprintfix.zip). Reboot Your
Phone Into Bootloader Mode. Once In Bootloader Mode, Open A
Command Prompt / Powershell In The Zip Folder By Holding Down
Shift, Right Clicking, And Then Selecting The Option For
"Open Command Prompt / Powershell Here"
=====================================
Directions For Command Prompt:
Type In The Following Command Without Quotes "mfastboot flash modem non-hlos.bin"
Once That Finishes, Type In The Next Command, Without Quotes "mfastboot erase carrier".
Then Finally, "mfastboot reboot".
Directions For Powershell:
Same As Command Prompt, EXCEPT: change "mfastboot" to ".\mfastboot".
=====================================
If You Mess With The APN Settings, Or Change It Around, You'll Have To Do
These Steps Again.
Click to expand...
Click to collapse
The sprint-fix link is broken. Do you have a copy of it?

Categories

Resources