change system settings from script - Android Q&A, Help & Troubleshooting

Goodmorning everyone,
If possible, I would like to be able to change system settings via script or cmd command.
I'll explain.
I have a xiaomi mi 9 t dual sim, sim 1 is default for calls and sim 2 for internet.
I need to use the internet even in a call, so I would like to change the default sim for internet from sim 2 to sim 1 during the call.
I can do automation with macroandroid or similar, but I need to run a script that does the switch.
it's possible?
Thanks

if u r using miui that is easy to do via Settings,
and below is 2nd way, worked for many roms
need root and termux.
$ su
$ settings list global |grep sim
multi_sim_data_call=1
multi_sim_sms=1
multi_sim_sms_prompt=1
multi_sim_voice_call=2
ok,now change to 2nd sim
$ settings put multi_sim_data_call 2
back to 1st
$ settings put multi_sim_data_call 1
different roms may have different key value.

Related

[Q] install whatsapp twice ,, same phone ?

hi,
I have two numbers and i want to use two separate whatsapp on the same device
i used it on iPhone but can't do it with Android
any help please
In android, all the apps are bind to a unique package name (for example, com.developer.bestapp). The package name is set by developer and can't be changed by user. That name must differ from every other app because two apps with same package name == conflict.
Because of that, I afraid you just can't do that by now.
i dont think you can install ANY app twice, on the same phone, whether different number or not. are you using a Dual SIM phone? or change the SIM manually? if you change it manually, you can install it and enter the newly put in SIM's number everytime you change your SIM, which may not be very convenient though.
Hope that helped!

[Q] No SIM card - After rooting LG G3 and changing to GSM, it is not detecting SIM

I got a Sprint LS990 ZV6 phone from ebay. I decided to use it in T-Mobile, so rooted it. After following so many steps, the phone is not accepting any SIM card when I switch to GSM.
I followed below steps.
- Downgraded phone to ZV4 from ZV6
- Rooted the phone using Stump root
- Changed the carrier options as per http://forum.xda-developers.com/sprint-lg-g3/general/unlock-sim-gsm-how-to-t2853594
- Added APN settings for T-mobile changed network pref
- Inserted my SIM and rebooted the phone.... I shows No SIM card (the SIM is working properly in other phones & I tried couple of SIMs nothing works)
Can anyone please tell me after downgrading & rooting the phone, will it show Active SIM for GSM (i.e. signal bar not with red cross and No SIM icon).
If anyone faced this issue and resolved it, please help me also on this. I have been struggling from more than 2 months to fix it.
Try this http://forum.xda-developers.com/sprint-lg-g3/general/how-to-gsm-unlock-t2961099 I made it and listed people that confirmed it working if you need help pm me or them.
Finally after following below steps it worked
GSM Unlock for Sprint LG G3 (Works for US GSM Carriers & International Carriers)
1. Root the device using StumpRoot - Download here http://forum.xda-developers.com/lg-g...rizon-t2850906
2. Install SuperSU & Root Explorer & 920 Text Editor (or you can use Rom Tool Box for build.prop editing)
3. Copy build.prop from /system/build.prop to /sdcard
4. Open /sdcard/build.prop in 920 Text Editor
5. Edit line 268 and change ro.build.target_operator=SPR to ro.build.target_operator=spr
6. Save the file
7. Go to root explorer and copy build.prop from /sdcard to /system/ - try and delete existing build.prop and then copying the one from /sdcard instead of overwriting the existing file. I've encountered bootloops when overwriting build.prop
8. change permissions on /system/build.prop file you just copied to "rw - r - r". This is very important - when you copy and paste build.prop it loses the correct permissions and incorrect permissions will result in bootloop
9. reboot the device
10. It should now be unlocked. You will be unable to change the Network mode under "Mobile Networks" which will be grayed out so use the app "Network" from the play store to change the modem to "GSM (auto PRL)
11. In a few seconds you should see a signal. If not reboot the device once again and it should work.
12. Download "Tweakker" from the play store to get to APN settings and configure required APN settings for your carrier. After you are done with this step, you should have 3G/HSPA+ or Edge connectivity
1619415 said:
Try this http://forum.xda-developers.com/sprint-lg-g3/general/how-to-gsm-unlock-t2961099 I made it and listed people that confirmed it working if you need help pm me or them.
Click to expand...
Click to collapse
Thank you. I was using these steps as well.
Now the next search is using this phone in T-Mobile or at&t for LTE.
Does any one got any spell for this
As far as I know you cannot use LTE due to the face our device does not support it.

xt1528

I got one of these xt1528 phones but im on ATT can this be done? I heard it can somewhere in settings and Network app and change too LTE/GSM PRL instead of LTE/CDMA. Also if im able to change my apn to ATT would i also be able to rom and root or does that involve unlocked bootloader?
1. No, you cannot perm root
2. No, there's no BL unlock method
http://forum.xda-developers.com/showthread.php?t=3098953
Ace42 said:
1. No, you cannot perm root
2. No, there's no BL unlock method
http://forum.xda-developers.com/showthread.php?t=3098953
Click to expand...
Click to collapse
Is there a temp root if i had this working GSM?
Stupid question, but to clarify, the Verizon model will NOT work on ATT? Thanks!
cell2011 said:
Is there a temp root if i had this working GSM?
Click to expand...
Click to collapse
There is temp root via Kingroot for the Verizon model, but /system remains read-only and you can't flash a custom recovery.
You don't need to root to enable GSM.
robotapocalypse said:
Stupid question, but to clarify, the Verizon model will NOT work on ATT? Thanks!
Click to expand...
Click to collapse
The Verizon will indeed work on AT&T, but it's lacking AT&T's main LTE Band 17. Has 2G EDGE on 850MHz & 1900MHz, 3G HSPA+ on 850MHz & 1900MHz, and LTE on bands 2 and 4. You'll need to follow this guide to enable GSM compatibility: http://forum.xda-developers.com/moto-e-2015/general/how-to-verizon-moto-e-2015-gsm-network-t3098953
xtermmin said:
The Verizon will indeed work on AT&T, but it's lacking AT&T's main LTE Band 17. Has 2G EDGE on 850MHz & 1900MHz, 3G HSPA+ on 850MHz & 1900MHz, and LTE on bands 2 and 4. You'll need to follow this guide to enable GSM compatibility: http://forum.xda-developers.com/moto-e-2015/general/how-to-verizon-moto-e-2015-gsm-network-t3098953
Click to expand...
Click to collapse
I'm missing something then. I stuck my Straight Talk sim in and it says "not a verizon sim". I've entered the APN settings with no results. I must be missing something.
robotapocalypse said:
I'm missing something then. I stuck my Straight Talk sim in and it says "not a verizon sim". I've entered the APN settings with no results. I must be missing something.
Click to expand...
Click to collapse
Did you follow the linked guide to enable GSM?
You'll get a "Not A Verizon SIM" message every time you reboot. It's part of the Verizon ROM.
To disable it, disable com.motorola.setupwizard.
If you also disable vzwAPNpermissions.apk and vzwAPNservice.apk, you'll only have to do the linked instructions once, instead of each time you swap SIMs.
xtermmin said:
Did you follow the linked guide to enable GSM?
You'll get a "Not A Verizon SIM" message every time you reboot. It's part of the Verizon ROM.
To disable it, disable com.motorola.setupwizard.
If you also disable vzwAPNpermissions.apk and vzwAPNservice.apk, you'll only have to do the linked instructions once, instead of each time you swap SIMs.
Click to expand...
Click to collapse
I did follow the guide. Perhaps I need to re-enter my APN settings. Thanks!
It looks like I just didn't enter the ADB commands exactly right the first time. It's all good now, thanks!
<<To disable it, disable com.motorola.setupwizard.
If you also disable vzwAPNpermissions.apk and vzwAPNservice.apk, you'll only have to do the linked instructions once, instead of each time you swap SIMs>>
Did you disable with this string in adb mode (cmd prompt) ?
wogeboy said:
<<To disable it, disable com.motorola.setupwizard.
If you also disable vzwAPNpermissions.apk and vzwAPNservice.apk, you'll only have to do the linked instructions once, instead of each time you swap SIMs>>
Did you disable with this string in adb mode (cmd prompt) ?
Click to expand...
Click to collapse
Going by what was said in this post, the debloater package that is floating around XDA Dev: http://forum.xda-developers.com/showpost.php?p=64058197&postcount=739
I'm assuming they're referring to http://forum.xda-developers.com/android/software/debloater-remove-carrier-bloat-t2998294
Can probably do it manually via ADB but I don't know what the package names for vzwAPNpermissions.apk and vzwAPNservice.apk are.
The command to use is probably along the lines of:
adb shell pm disable com.package.name.com
wogeboy said:
<<To disable it, disable com.motorola.setupwizard.
If you also disable vzwAPNpermissions.apk and vzwAPNservice.apk, you'll only have to do the linked instructions once, instead of each time you swap SIMs>>
Did you disable with this string in adb mode (cmd prompt) ?
Click to expand...
Click to collapse
Got it! I misunderstood you. Using debloater.exe I got it working.
http://rootjunkysdl.com/getdownload.php?file=Gates/DeBloater/Debloater-setup-v3.90.exe
Debloater how did you get it working on moto xt1528 from verizon
robotapocalypse said:
Got it! I misunderstood you. Using debloater.exe I got it working.
How did you get it working, I also download the debloater.exe, I install it, then I click this services : com.verizon.permissions.vzwappapn and
com.vzw.apnservice to disable them, but I still need to clear the cache providers and do the settings put global preferred_network ,,, etc if I exchange the sim card, even if it is the same carrier
Click to expand...
Click to collapse
robotapocalypse said:
Got it! I misunderstood you. Using debloater.exe I got it working.
How did you get it working, I also download the debloater.exe, I install it, then I click this services : com.verizon.permissions.vzwappapn and
com.vzw.apnservice to disable them, but I still need to clear the cache providers and do the settings put global preferred_network ,,, etc if I exchange the sim card, even if it is the same carrier
Click to expand...
Click to collapse
This guide will unlock your Motorola Moto E (XT1528) 2nd Generation 2015 from Verizon,
so you can use your phone on any gsm carrier
All the info is from this site: http://forum.xda-developers.com
Dowload zip file https://www.dropbox.com/s/jhrwmvd4hdzxf21/XT1528 Unlock Guide by ElChinoSiu.rar?dl=0
First Install MotorolaDeviceManager to install drivers
Then go to:
1 Settings
2 About phone
3 Build Number (Click it 10 times until get Developer Options)
4 Developer Options
5 USB Debugging ON
6 "PUT YOUR DEVICE IN AIRPLANE MODE"
7 Connect phone to PC
8 Open ADB Windows folder
9 Inside the folder press shif + right click
10 Click Open a command windows here
(Should say something like this: C:\Users\Your-Name\Desktop\adb-windows>
11 Type or copy: adb devices
Should see something like this:
"List of devices attached
TA104098CI device"
12 Type or copy: adb shell
Should see something like this:
"[email protected]_cdma:/ $"
13 Now type this strings one by one and hit enter:
pm clear com.android.providers.telephony
settings put global preferred_network_mode 9
settings put global preferred_network_mode1 9
settings put global preferred_network_mode2 9
OPTIONAL:
pm hide com.motorola.setupwizard.phoneservice
pm hide com.motorola.setupwizard.devicesetup
pm hide com.motorola.setupwizard.controller
pm hide com.motorola.vzw.settings.extensions
pm hide com.vznavigator.Generic
pm hide com.android.cellbroadcastreceiver
pm hide com.fusionone.android.sync.vzbuaclient
14 Restart phone or type: adb reboot
15 Turnoff AirplaneMode
16 Change APN Settings
If Your wanna swap sim follow this steps:
1 Close all apps
2 Go to your phone Settings
3 More
4 Cellular Network and leave it open
5 Airplane Mode ON
6 Remove Sim 1
7 Insert Sim 2
8 Open Network App
9 Change LTE/CDMA auto(PRL) to LTE/GSM auto(PRL)
10 Go to settings and check if Preferred Network Type is set to 4g if not select it
11 Open Network App again
12 Turn on radio
13 Now Airplane Mode OFF
And that is it,,, Check Your APN Settings
Do this every time you want to swap sims
Thanks to xdadeveloper and all people here that help us
NOTE:
The Debloater method to disable com.verizon.permissions.vzwappapn and com.vzw.apnservice did not work for me,
Is there anyone in this forum that has successful swap sim with out using the network app or using Debloater on Verizon Moto E model XT1528
elchinosiu said:
NOTE:
The Debloater method to disable com.verizon.permissions.vzwappapn and com.vzw.apnservice did not work for me,
Is there anyone in this forum that has successful swap sim with out using the network app or using Debloater on Verizon Moto E model XT1528
Click to expand...
Click to collapse
Do you mean Debloater won't disable these apps ? Or that it still won't help the SIM swap without going back to adb ?
bibikalka said:
Do you mean Debloater won't disable these apps ? Or that it still won't help the SIM swap without going back to adb ?
Click to expand...
Click to collapse
Debloater still won't help the SIM swap, i have to do it either adb or the network app
elchinosiu said:
...
If Your wanna swap sim follow this steps:
1 Close all apps
2 Go to your phone Settings
3 More
4 Cellular Network and leave it open
5 Airplane Mode ON
6 Remove Sim 1
7 Insert Sim 2
8 Open Network App
9 Change LTE/CDMA auto(PRL) to LTE/GSM auto(PRL)
10 Go to settings and check if Preferred Network Type is set to 4g if not select it
11 Open Network App again
12 Turn on radio
13 Now Airplane Mode OFF
And that is it,,, Check Your APN Settings
Do this every time you want to swap sims
Thanks to xdadeveloper and all people here that help us
NOTE:
The Debloater method to disable com.verizon.permissions.vzwappapn and com.vzw.apnservice did not work for me,
Is there anyone in this forum that has successful swap sim with out using the network app or using Debloater on Verizon Moto E model XT1528
Click to expand...
Click to collapse
elchinosiu said:
Debloater still won't help the SIM swap, i have to do it either adb or the network app
Click to expand...
Click to collapse
I just tested this, and this SIM swap worked without adb !!! Awesome !!! It's not that cumbersome either, just follow these simple steps.
Now, is it really necessary to turn on the radio in Network app first ? Also, could I just turn off Airplane mode, and then use Network app to change the network type ? Or will it run something that would screw up things such that I have to use adb ?
Not able to find the zip file in dropbox
Hi,
I am not able to locate the zip file, can you please suggest alternate location for the zip file.
Regards,
Narayana
elchinosiu said:
This guide will unlock your Motorola Moto E (XT1528) 2nd Generation 2015 from Verizon,
so you can use your phone on any gsm carrier
All the info is from this site: http://forum.xda-developers.com
Dowload zip file https://www.dropbox.com/s/jhrwmvd4hdzxf21/XT1528 Unlock Guide by ElChinoSiu.rar?dl=0
First Install MotorolaDeviceManager to install drivers
Then go to:
1 Settings
2 About phone
3 Build Number (Click it 10 times until get Developer Options)
4 Developer Options
5 USB Debugging ON
6 "PUT YOUR DEVICE IN AIRPLANE MODE"
7 Connect phone to PC
8 Open ADB Windows folder
9 Inside the folder press shif + right click
10 Click Open a command windows here
(Should say something like this: C:\Users\Your-Name\Desktop\adb-windows>
11 Type or copy: adb devices
Should see something like this:
"List of devices attached
TA104098CI device"
12 Type or copy: adb shell
Should see something like this:
"[email protected]_cdma:/ $"
13 Now type this strings one by one and hit enter:
pm clear com.android.providers.telephony
settings put global preferred_network_mode 9
settings put global preferred_network_mode1 9
settings put global preferred_network_mode2 9
OPTIONAL:
pm hide com.motorola.setupwizard.phoneservice
pm hide com.motorola.setupwizard.devicesetup
pm hide com.motorola.setupwizard.controller
pm hide com.motorola.vzw.settings.extensions
pm hide com.vznavigator.Generic
pm hide com.android.cellbroadcastreceiver
pm hide com.fusionone.android.sync.vzbuaclient
14 Restart phone or type: adb reboot
15 Turnoff AirplaneMode
16 Change APN Settings
If Your wanna swap sim follow this steps:
1 Close all apps
2 Go to your phone Settings
3 More
4 Cellular Network and leave it open
5 Airplane Mode ON
6 Remove Sim 1
7 Insert Sim 2
8 Open Network App
9 Change LTE/CDMA auto(PRL) to LTE/GSM auto(PRL)
10 Go to settings and check if Preferred Network Type is set to 4g if not select it
11 Open Network App again
12 Turn on radio
13 Now Airplane Mode OFF
And that is it,,, Check Your APN Settings
Do this every time you want to swap sims
Thanks to xdadeveloper and all people here that help us
NOTE:
The Debloater method to disable com.verizon.permissions.vzwappapn and com.vzw.apnservice did not work for me,
Is there anyone in this forum that has successful swap sim with out using the network app or using Debloater on Verizon Moto E model XT1528
Click to expand...
Click to collapse
pnrao3 said:
Hi,
I am not able to locate the zip file, can you please suggest alternate location for the zip file.
Regards,
Narayana
Click to expand...
Click to collapse
No need. Follow the guides in the General forum.
http://forum.xda-developers.com/moto-e-2015/general/help-confirm-5-1-how-to-verizon-moto-e-t3264258

[Need Help] Remove remembered WiFi APs.

Hello,
I would like to clear all WiFi configurations from an app (programmatically) but not found any solution.
What I tried and it doesn't work.
WifiManager.removeNetwork
I try to use WifiManager.removeNetwork and found that it doesn't work on Android M+
then I try to set WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN to 0 with the command:
Code:
settings put global wifi_device_owner_configs_lockdown 0
and then try to WifiManager.removeNetwork again but it still doesn't work.
Remove configurations from /data/misc/wifi/wpa_supplicant.conf
Turn off WiFi then modify /data/misc/wifi/wpa_supplicant.conf and re-enable WiFi again. This method work properly on Galaxy S8 but doesn't work on Sony X Performance (my customer's main device)
WifiManager.factoryReset
This method used by Network Settings Reset (in Settings) but it is hidden and requires system privilege.
Use service call wifi <code>
To call WifiManager.factoryReset from a shell, you can use service call wifi <code> however the code depends on the Android version and the Manufacturer modifications. I found that code of factoryReset method is 63 on Android 7.0 and 7.1.1 but it doesn't work on my devices.
Device Owner
found that Device Owner App can make system setting modification, however to make an app as Device Owner requires to remove all account from device. (after make app as device owner, I can use WifiManager.removeNetwork to remove any Aps)
http://florent-dupont.blogspot.fr/2015/01/android-shell-command-dpm-device-policy.html
Can you please suggest me other solutions? (ROOT is acceptable but not a system app)
Thank you.
The "service call wifi" is soo much depending on the Android version.
On Android 9 the call for resetting wifi to factory default is:
adb shell service call wifi 59 s16 wlan0
The proper call number can be found in the IWifiManager function. Like for Android 9:
android/android-9.0.0_r35 : android/net/wifi/IWifiManager.java
Count "case TRANSACTION_" from first to last. That gives you the call number. Pretty basic but it works!
To remove stored wifi networks:
cmd netpolicy list wifi-networks #to get list, index 0...
To remove network:
service call wifi 16 i32 1 #remove the second network in the list
(note 3rd doesn't become 2nd after this command!)
No root needed.
Remember this is for Android 9! Other versions may have other call numbers.
Edit: latest wifimanager here
Cheers

Definitive APN editing guide - Useful for CDMA MVNO users

I spent hours trying to get my APN editing when I did a factory reset on my Nexus 6p. Android 8.1 made editing APNs a royal pain if you are using a CDMA carrier. There are lots of threads spread around on getting Total Wireless, Tracfone, and other carriers working form MMS and internet. A lot of the solutions I found worked most of the way but I needed tethering and finally rooted to be able to edit and get tethering.
The options I have found are
Root your phone and do some SU commands
Pop an alternate carrier sim in and edit the apn (I have not been able to fully test as I don't have an alternate sim)
Use adb to open the apn add dialog while the sim is ejected (result does not allow tethering but local data works)
1) Have a rooted phone. Place phone in airplane mode. Enter the commands shown in <brackets> (don't include the <> symbols). Open a command prompt and enter <adb shell>. Get a su prompt by entering <su>. Modify the verizon apn to point to the correct apn server <content update --uri content://telephony/carriers --bind apn:s:"TRACFONE.VZWENTP" mmsc:s"http://mms.vtext.com/servelets/mms" --where "name='Verizon'"> Your data and mms should start working and tether should work as well.
2) Use a T-mobile, AT&T or similar sim and enter the total wireless (or MVNO settings of your choice) APN settings. Remove alternate sim and insert MVNO sim. Go to APN settings and select the new APN.
3) Have your screen unlocked on your phone. At a shell prompt enter <adb shell am start -a android.intent.action.INSERT content://telephony/carriers --ei simId -1> Enter the MVNO APN settings found on google and save. It may give an error if you enter DUN profile. I was not able to get tether to work this way so I used method 1.
Feel free to add other methods that work. Make note of the software version you are utilizing.
isaacws said:
I spent hours trying to get my APN editing when I did a factory reset on my Nexus 6p. Android 8.1 made editing APNs a royal pain if you are using a CDMA carrier. There are lots of threads spread around on getting Total Wireless, Tracfone, and other carriers working form MMS and internet. A lot of the solutions I found worked most of the way but I needed tethering and finally rooted to be able to edit and get tethering.
The options I have found are
Root your phone and do some SU commands
Pop an alternate carrier sim in and edit the apn (I have not been able to fully test as I don't have an alternate sim)
Use adb to open the apn add dialog while the sim is ejected (result does not allow tethering but local data works)
1) Have a rooted phone. Place phone in airplane mode. Enter the commands shown in <brackets> (don't include the <> symbols). Open a command prompt and enter <adb shell>. Get a su prompt by entering <su>. Modify the verizon apn to point to the correct apn server <content update --uri content://telephony/carriers --bind apn:s:"TRACFONE.VZWENTP" mmsc:s"http://mms.vtext.com/servelets/mms" --where "name='Verizon'"> Your data and mms should start working and tether should work as well.
2) Use a T-mobile, AT&T or similar sim and enter the total wireless (or MVNO settings of your choice) APN settings. Remove alternate sim and insert MVNO sim. Go to APN settings and select the new APN.
3) Have your screen unlocked on your phone. At a shell prompt enter <adb shell am start -a android.intent.action.INSERT content://telephony/carriers --ei simId -1> Enter the MVNO APN settings found on google and save. It may give an error if you enter DUN profile. I was not able to get tether to work this way so I used method 1.
Feel free to add other methods that work. Make note of the software version you are utilizing.
Click to expand...
Click to collapse
Well I have to eat crow. I thought this was working great but I can either have tether or mms but not both. Method 3 allows MMS to work but not tether. Method 1 allows tether and data to work but not MMS!!!!!
NO ROOT NEEDED --- For anyone still having this issue, I have an LG G7 with a Sprint locked APN and I tried every single method I could find online but this is the only thing that worked for me and it worked perfectly:
APN problem and mobile data
Returning from a trip abroad, my Canadian Public Mobile service stopped providing mobile data. The problem was that the APN parameters for ...
cikitsa.blogspot.com
Original post is ---
Android 8.1 - How to edit cellular APN?
Trying to get Pixel XL 8.1 activated on Total Wireless (Verizon MVNO) to work with data (i.e., cellular APN). Calling and texting work, so I am (almost) certain it is a cellular APN issue. I go into Settings -> Networks -> Mobile Data ->...
forum.xda-developers.com

Categories

Resources