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.
Related
Situation: I want Tasker to turn on 3G/4G when certain apps are launched, and then restore the phone to the previous state before the app was launched. For example, if 3G/4G was already on, then it should leave it on. If it was off, then turn 3G/4G off.
My tasker profile:
CONDITION: On App launch (Chrome, Maps, etc)
EXECUTE:
Set Variable %WIMAXprior to 0 if %WIMAX is NOT SET ... (assigns value of 0 if 3G/4G is turned off)
Set Variable %WIMAXprior to 1 if %WIMAX is SET ... (assigns value of 1 if 3G/4G is turned on)
Mobile Data ON
EXIT ACTION:
Set Mobile Data OFF if %WIMAXprior = 0
Set Mobile Data ON if %WIMAXprior = 1
Unfortunately, I can't get it to work. After quite a bit of testing, I think the problem is that Tasker is unable to read the Wimax status. As a debug feature, I asked Tasker to say aloud the value of the variable %WIMAXprior and it reads "0", whether or not 3G/4G was enabled before the task was launched.
Does anyone have any ideas?
coHi,
Big time noob here - first smart phone and I take a look at the clock and discover it has the following permissions:
This app can access the following on your phone:
- Your personal information (read contact data, read user defined dictionary, write contact data)
- Services that cost you money (directly call phone numbers)
- Your location (coarse (network based), location, fine (GPS) location
- Network communication (control near field communication, Bluetooth connections, full internet acess)
- Your accounts (use the authentication credentials of an account)
- Storage (modify/delete SD card contents)
- Phone Calls (read phone state and identity)
- Hardware controls (change your audio settings)
- System tools (bluetooth administration, change wi-fi state, change wimax state, change your ui settings, disable keylock, display system-level alerts, modify global system settings, mount and unmount filesystems, prevent phone from sleeping, retrieve rnning applications, write sync settings.
Am I right to be worried about this? This is the clock. It looks like some sort of spyware or something. This app was pre-installed and I can't uninstall it. I tried stopping it but don't know if that worked or not. I tried rooting the phone but I'm a noob of noobs and couldn't find a driver. I bought the phone from hongkonggeek.
Anyone any advice?
Has anyone worked out how to force the Wifi Calling Preferred setting to Wifi Preferred in Android 10, when the option has been disabled by carrier setting? A while back there was a non-invasive ADB command that didn't require root, but it never worked for Pie.
Understand carriers may want to disable this setting for support reasons, but when you live on the edge of multiple cells where VoWifi works really well, 4G intermittently works well, but in 3G people can't hear you, being able to prefer Wifi Calling would be super helpful. In my case, once the call slips to 3G, I may as well hang up.
Any suggestions would be appreciated.
Following.
Might be controlled by carrier, not by device of user. With T-Mobile Germany it shows mobile network preferred within home network and Wifi preferred when roaming.
I was trying the adb command too on my pixel 3 xl but seems its now ignored on Android 10.
But what I have found is a similar settings. I am new so I cant post a link, but do a goole search for KEY_CARRIER_DEFAULT_WFC_IMS_MODE_INT and it will be the first link (android developper pages)
You see that it was added in API level 29, and level 29 = Android 10. The previous settings disappeard from thoses pages too.
This settings seems to be inside "android.telephony" (on the left colum) -> android.telephony.CarrierConfigManager
The problem I have is I'm not a developper/modder so I have no idead how to change the setting inside android.telephony (is it the phone app?)
KEY_CARRIER_DEFAULT_WFC_IMS_MODE_INT
Added in API level 29
public static final String KEY_CARRIER_DEFAULT_WFC_IMS_MODE_INT
Default mode for WFC over IMS on home network:
0: Wi-Fi only
1: prefer mobile network
2: prefer Wi-Fi
Constant Value: "carrier_default_wfc_ims_mode_int"
KEY_CARRIER_DEFAULT_WFC_IMS_ROAMING_MODE_INT
Added in API level 29
public static final String KEY_CARRIER_DEFAULT_WFC_IMS_ROAMING_MODE_INT
Default mode for WFC over IMS on roaming network. See KEY_CARRIER_DEFAULT_WFC_IMS_MODE_INT for meaning of values.
Constant Value: "carrier_default_wfc_ims_roaming_mode_int"
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?
Hi everyone,
Has anyone here had any success capturing VoLTE network traffic on a smartphone?
Some context:
I have tested a rooted Redmi Note 9S so far. When registered on an LTE network with a VoLTE-enabled SIM, two network interfaces are added in Android, one of which is used for data connection and the other for IMS/VoLTE (I have examined the output of "logcat -b radio" on the phone to confirm this). The two interfaces are usually named rmnet_data1 and rmnet_data2, and rmnet_data1 is usually used for data. By using tcpdump, the data traffic can be captured without any problems. But when I run tcpdump on the VoLTE interface, almost no traffic is captured even when making a VoLTE call.
By examining the outputs of other Android tools and even built-in linux network statistics, and then reading a bit about it, I am now almost certain that VoLTE traffic is completely handled by the baseband, and it doesn't reach the regular OS (Android) at all. This old post from 2013 provides some info on this development in smartphones.
There are vendor-specific tools like QXDM (from Qualcomm) for troubleshooting baseband communications. But I haven't used them, and I wonder if they provide a way to "capture" the VoLTE traffic, e.g. in a pcap file.
I would be thankful if someone can provide me with an answer or a direction to explore.