Using Easer/Tasker/Shell to turn off second SIM slot - OnePlus 6 Questions & Answers

Hi,
I use two SIM cards on my OnePlus 6 (rooted OOS 10.3.0); one for personal use and one for work.
I've been trying to find a suitable shell command that turns off the second SIM-slot (SIM2) which has my work SIM in it.
The idea is to combine the command with automation software like Easer, to turn the second SIM off for specific hours of day.
You currently have to go to the phone settings and disable the second SIM manually.
After searching the internet I found this thread on stackoverflow: LINK
The suggested solution says to use what is called service call function:
Code:
service call phone x i32 y i32 z
Where:
x = index number you fetched previously,
y = your subscription ID (generally, SIM1 = 0, SIM2 = 1)
z = whether on (1) or off (0)
I tried digging up the correct x value as suggested on stackoverflow and came up with the following command:
Code:
service call phone 178 i32 1 i32 0
However, after running this command as root on Termux terminal, it outputs a lot of text and nothing seems to happen to SIM2. It doesn't turn off.
I've attached the output of running the command.
I wouldn't want to just randomly call some functions by changing the x to a different number. Who knows what you might do to your phone, as you're running the command as root after all.
What gives? Am I just using the wrong function call? If so, then what is the correct one?
Any tips or leads on what to do?

Related

Wrong country code Verizon

This problem probably has an easy solution but I just cant figure it out.
So im Swedish and I ordered a tp2 Verizon and unlocked it with unlock program.
Got everything to work, gsm and umts.
But when I dial numbers ex: 070 65 11 65 (swedish cellphone number)
I see on the screen it adds (1) 070 65 11 65 wich I guess is the
american or english country code.
Now if I type in +46 (Swedish country code)
in front of the cell number and and subtract the 0
+46 70 65 11 65
Everything works.
But for convenience I don't want to have type in my country code for every
cell number.
How do I fix this?
Ive been in region settings on the phone and changed to Swedish.
Someone please help
settings. personal. phone. then i think gsm services
Thanks but it didn't work.
It seems logical the settings to change that would be there though.
I played around with settings on location setting in there. Didn't change anything.
The settings i have on gsm settins are the following:
Call barring
Caller ID
Voice mail and text messages
Pin/pin2
Location setting
tty mode
Time synchronizaion
Am I missing any settings?
I also tried rebooting in cdma mode without gsm sim card and changing
country to Sweden in the cdma settings. Then rebooting again with sim card in gsm
mode.
I didnt try this before but i can call local land line number no problems
but if i try a swedish cellphone number without country code it still
wants to add (1) in front of it.
So annoying.
Any ideas?
hklm-->software-->OEM-->phonesetting and then choose autoprepend_1 and change the "Data" value from 1 to 0.
Ok so im guessing that hklm means changing some registry setting.
I haven't done that before.
Can you recomend a good app for this?
Besides this do you think that this problem might be tied to
using a verizon stock rom and that verizon is an american operator?
If i change to an international rom later do you think I would have this problem?
I know of no international cdma roms. use phm regedit or even easier use CEregreditor from computer with phone connected by activesync.
I used resco explorer 2010,
I didnt have autopretend setting on Phonesetting.
I had something called assisted dialing, wich is something that comes up
whenever i dial a number it says above the number dialing (assisted dialing)
That setting seems to be on (1)
And I have audioredial no value set,
The rest is
Bandtype
Callbarring
CalledId
CallforwardingGsm
CallWaiting
CurrentCountrySetting (no value set)
DNDMode
EmergencyCallAlert
FDN
LocationSetting
NBCDSetting
NetworkService
NetworkType
OutOfCoverageAlert
PIN
RoamingAlert
SwicthNAM
TimeSync
TtyMode
VMailTextMSG
VoiceMail
VoicePrivacy
After a closer I look I found
ShowAutoPrependPage under phonesetting
I changed that value from 0 to 1 but nothing happend.
damn..
Rhodium 500,
thanks for your help and pointing me in the right direction.
Really appreciate it.
I disabled "Assisted Calling" in registry settings and that solved my problems
it was to easy
1-click the call button to see the dial keypad
2- click menu
3- choose global smart dialing
4- disable global smart dialing
5- press ok
abvmoose and others,
How do I turn on Assisted Dialing? I have no entries under HKLM-->SOFTWARE-->OEM-->PhoneSetting--> AssistedDialing?
Please let me know the entries in this folder so I can turn assisted dialing on.
Thanks!

[Q] Android Services Help

Hi,
I'm trying to write some scripts that will turn on/off various functions of my rooted phone running a Cyanogen 6 based ROM (especially those functions that can't be programmatically manipulated through standard apps on non-rooted phones).
One approach I figured (Approach 1), would be to simply write 1/0 in the sqlite settings database for various settings (/data/data/com.android.providers.settings/databases/settings.db). However, simply writing on/off there does not automatically turn on/off those functions. After a reboot this will work though.
Another approach (Approach 2) would be to call various services with various parameters. For example this:
wifi on: service call wifi 13 i32 1
wifi off: service call wifi 13 i32 0
Will turn on/off the Wifi.
My questions are:
Which of these 2 approaches would you recommend?
Do you recommend any other approaches?
For "Approach 1", do you know of another way (besides rebooting the phone) that would force the phone to take the new settings in the database into consideration?
For "Approach 2", where could I find some documentation so that I will know how to manipulate the other services? (I'm interested especially in: GPS, Mobile Networks Location, 2G/3G switch, Data connection, Background data connection, Ringer, Auto sync)
Thanks,
Andrei
adding few more commands
This is not the answer, but I've found few more commands which can be helpful.
#service call connectivity 14 i32 1 -> Mobile Data ON (NEED ROOT)
#service call connectivity 14 i32 0 -> Mobile Data OFF (NEED ROOT)
#service call connectivity 12 i32 1 -> Background service ON
#service call connectivity 12 i32 0 -> Background service OFF
maybe a late reply, almost 2 years sincs op.
i look up information about the service interface directly from the aidl files, these files are well documented.
so for the example you gave, look at IWifiManager.aidl, the methods are numbered in sequence (starting at 1). the 13 entry is for setWifiEnabled(Bool), notice that i32 is encoding an integer into a boolean value.
for more information, the underlying system of IPC in android is managed by Binder.

Really need your help quickly. Orange Message Centre Number?

Basically, earlier today for some reason my Nexus S was refusing to send a text to a particular person, it just kept saying message not sent. In a stupid attempt to fix it, I googled for assistance and ended up changing the SMSC number or whatever it is and now I can't send a text to anyone.
I've been searching around and got a converter site where I convert the SMSC number. I was told you enter your phone carrier's SMSC (which is Orange for me) so I found that out to be: +447973100973 and there was an alternative +447973100974, neither work though.
So, I put that in and converted and got this: AT+CMGW=24
079144973701904711000A9210299232900000AA0CC8F71D14969741F977FD07. Googling told me that it's the first sixteen numbers in the second line you enter in the SMSC bit on your phone, so I did that, pressed update and still none of my messages are sending.
Have I got the carrier's SMSC number wrong? There's also a 'Receiver' box on that converting website but that already had the numbers 0192292309 in it. Tried everything I can but I'm at a loose end now and very frustrated. PLEASE can anyone shed some light and help me fix my phone? Thank you.
Anyone please? I really need to sort this.
Seems like you had the right idea but you put in too many digits. The highlighted part has 18 digits, not the 16 you're supposed to have. Not sure if that was just an error or not. Anyway, assuming those carrier SMSCs are correct, you should be entering either 0791449737019037 or 0791449737019047 in the SMSC field.
That was an error on my part asharptm but thanks.
Does anyone think setting it back to factory settings will help? What will that do exactly, wipe out my Apps, Messages, Contacts and basically put the phone to what it was when I got it?
Also, heard putting your sim in someone else's phone, entering the SMSC in their phone and then back into your own might help?
Tried that there daleski and still not sending unfortunately. Thanks for your help though.
Does anyone think setting it back to factory settings will help? What will that do exactly, wipe out my Apps, Messages, Contacts and basically put the phone to what it was when I got it?
Also, heard putting your sim in someone else's phone, entering the SMSC in their phone and then back into your own might help?
---
Incase this helps, when I enter *#*#*4636#*#* and go to Phone Information, this is everything it says:
IMEI: 354494040425305
Phone Number: ************ (obviously has my real number)
Current Network: Orange
[Run Ping Test]
Ping IPAddr:
Ping Host Name:
HTTP Client test:
Signal strength: -93 dBm 10 asu
Location: LAC = 5be CID = c053
Neighbouring CID: UNKNOWN
Roaming: Not roaming
GSM Service: In Service
GRPS service: Disconnected
Network type: GPRS
Message waiting: false
Call redirect: false
Call status: Idle
Radio resets: 0
Data Attempts: 0
Data Successes: 0
GSM disconnects: ========DATA========
Stade: DcInactiveState disconnected with last try at 12:59am
fail because No Error
=========================
PPP sent: 251 pkts, 49035 bytes
PPP received: 220 pkts, 98928 bytes
Number of PPP reset since boot: 0
Set preferred network type: ( has several choices, the one in bold is the one selected)
WCDMA preferred
GSM only
WCDMA only
GSM auto (PRL)
CDMA auto (PRL)
CDMA only
EvDo only
GSM/CDMA auto (PRL)
Unknown
==================
[Turn Off Radio]
SMSC: (Box for me to enter number) [Update] [Refresh]
Toggle DNS check 0.0.0.0 not allowed
DEM specific Info/Settings (grayed out and cannot click)
Click to expand...
Click to collapse

[Q] How to save the system changes?

Hello! I have a question! I have Droid Maxx, Droid Mini? Droid Ultra and I want to use in CDMA networks my operator, but without the use of RUIM card as still use GSM, for this I want to flash settings on my CDMA operator. I change using SQLite Editor line subscription_mode = 0 to 1 in com.android.providers / settings / global
But after rebooting subscription_mode value returns to 0 and then I can not do anything.
Please show me the way how to make that value subscription_mode not reset to 0, and 1 left on.
?
Managed to change?
matros2000 said:
Hello! I have a question! I have Droid Maxx, Droid Mini? Droid Ultra and I want to use in CDMA networks my operator, but without the use of RUIM card as still use GSM, for this I want to flash settings on my CDMA operator. I change using SQLite Editor line subscription_mode = 0 to 1 in com.android.providers / settings / global
But after rebooting subscription_mode value returns to 0 and then I can not do anything.
Please show me the way how to make that value subscription_mode not reset to 0, and 1 left on.
Click to expand...
Click to collapse
I have no idea about the settings you are attempting to modify, but my guess about values not sticking would be - you need write protection off. How to get write protection off, that's another question answer to which depends on a few variables - your current version, assembly date, update history. You need to obtain root, if possible, which would allow you to write to system and modify the setting you need.

[GUIDE] Toggle SIM card using command line

I want to share how to toggle SIM card using command line.
Execute below command using root
service call phone 158 i32 <SIM_SLOT> i32 <SIM_STATE>
Where <SIM_SLOT> is
0 = SIM 1
1 = SIM 2
Where <SIM_STATE> is
1 = SIM on
0 = SIM off
For example:
- Turn off SIM 2 command: service call phone 158 i32 1 i32 0
- Turn on SIM 2 command: service call phone 158 i32 1 i32 1
Now, I can turn SIM on or off using Tasker
Credit: kylemd from [GUIDE] [ROOT] Switch off individual SIMs with Tasker.
Thanks for the guide
Edit- Figured it out from the credited link:
service call phone 158 i32 0/1 i32 0/1
Where the red 0/1 represents:
0 = SIM 1
1 = SIM 2
And the blue 0/1 represents:
0 = OFF
1 = ON
I tried this out. While I was able to turn off the SIM, it didn't turn back on until after a reboot. Any idea why?
oreo27 said:
Edit- Figured it out from the credited link:
service call phone 158 i32 0/1 i32 0/1
Where the red 0/1 represents:
0 = SIM 1
1 = SIM 2
And the blue 0/1 represents:
0 = OFF
1 = ON
I tried this out. While I was able to turn off the SIM, it didn't turn back on until after a reboot. Any idea why?
Click to expand...
Click to collapse
Sorry, I've correct command line.
I don't have any issue turn back on any SIM, no need to reboot to turn it on.
Here is a possible commmands
Enable SIM 1: service call phone 158 i32 0 i32 1
Disable SIM 1: service call phone 158 i32 0 i32 0
Enable SIM 2: service call phone 158 i32 1 i32 1
Disable SIM 2: service call phone 158 i32 1 i32 0
mnirun said:
Sorry, I've correct command line.
I don't have any issue turn back on any SIM, no need to reboot to turn it on.
Here is a possible commmands
Enable SIM 1: service call phone 158 i32 0 i32 1
Disable SIM 1: service call phone 158 i32 0 i32 0
Enable SIM 2: service call phone 158 i32 1 i32 1
Disable SIM 2: service call phone 158 i32 1 i32 0
Click to expand...
Click to collapse
No worries! Yes, I was able to change the status without rebooting when using the correct syntax.
it doesn't work in mi mix2 global 8.5.8 anyone knows the correct address?
What about data ? Is there anything like that to switch data connectivity between slots ?
Cheers,
Tony
I think this is only for stock rom?
Tried turning off sim one on with validus os, and both Sims are disabled
Sent from my Mi A1 using Tapatalk
ToRvaLDs said:
it doesn't work in mi mix2 global 8.5.8 anyone knows the correct address?
Click to expand...
Click to collapse
It's 159 (based on 8.4.27_8.0 Global ROM), it should be the same on global 8.5.8
The command work on my X00TD running Oreo 8.1, but its only DATA/Connectivity toggle. Is there a command to switch On/Off SimCard?.
I'm looking for this command because one of my SimCard doesn't have good signal reception, thus the battery drain faster.

Categories

Resources