View Single Post
Posts: 1,417 | Thanked: 2,619 times | Joined on Jan 2011 @ Touring
#17
Now to change it form a phone to a a tablet in software

lifted from here: credit to: Death Mask Salesman on Aug 18 '16
https://android.stackexchange.com/qu...out-a-sim-card

Sucessfully tested on my S4 mini I9195 running LineageOS 14 for microG which now ignores its cellular radio not wasting energy desperately pinging for a cell tower we don't want it to bother with. Unfortunately due to the desires of state and corporate entities to keep tabs on us using the excuse of easy tracking for emergency services it is no surprise the satellite navigation is implemented on the cellular radio's chipset.
Wifi - Works
Bluetooth - Works
Broadcast FM Radio RX - Works
GPS - Appears to be Disabled
Hall Sensor(compass) - works
Cellular telephony and data - Disabled and status hidden
The Phone is now working as a tablet for all practical purposes, the first command given below disables the cellular telephony and data the change persists through reboots. This small ex-phone is now well suited to occasional carry when needed as a small handy pocket sized web-tablet tethered to my N900 via bluetooth PAN.
I suspect the cellular modem may cycle through a up period and send pings during power on before the OS loads and begins to ignore the cellular hardware This mod will not make your I9195 invisible to the cellular system in a safe reliable way or reliably protect your privacy. I have not tested the second way that uses a script only the su -c "setprop persist.radio.noril 1" solution but I have tested undoing it; reboot and phone and GPS are returned. The disabled GPS can sometimes be a problem so I will probably switch to the radioon and radiooff scripts solution so I can have satellite navigation as an option when needed.
__________________________________________


From the Terminal
Disabling RIL

If the operation is not to be performed frequently, a single line of code will be all that is needed:

Code:
su -c "setprop persist.radio.noril 1"
. This will make the phone ignore the Radio Interface Layer, thus ignoring the presence of the antenna. A reboot is required for the change to be in effect, and it will persist across reboots.

Plus, disabling RIL also makes the "No SIM Card icon vanish.
Enabling RIL

Enabling RIL again is just a matter of flags. As can be seen from the below example:
Code:
su -c "setprop persist.radio.noril 0"
, the command is equivalent, save for a 0 instead of a 1. As before, a reboot is needed.
As a custom function
__________________________________________________

I've also devised two functions to be added to the /system/etc/mkshrc file. Of course, it's usually needed to remount the /system partition as read-write, but the procedure will not be covered in this answer. (FYI in lineageOS with root enabled Amaze(with root enabled) file explorer to move mkshrc over to Documents then edit it by mounting it over USB MTP on my Ubuntu laptop then sending the edited mkshrc to overwrite the copy in /system/etc. Despite this this added lines to the file /system/etc/mkshrc and rebooting radioon and radiooff commands is not working so far for me)

This file takes care of various environment variables and aliases to be loaded by the Terminal once it is started, so fiddling with it is often discouraged. We can, though, add our personal functions and customizations just before the line that reads:

: place customisations above this line

. I would like to remind that : is a special shell builtin, and thus must be left untouched.
Disabling RIL

Here, we'll define a custom function radiooff, which will next be callable from the Terminal at will. The code is as follows:
Code:
# This function detaches a device from the cellular network
# Upon execution, a reboot must be performed
function radiooff {
 if [ "$(whoami)" != "root" ]; then
  echo "Error: must be executed as root."
  return 1
 fi

 if [ "$(getprop persist.radio.noril)" == "1" ]; then
  echo "Radio is already disabled."
  return 1
 fi

 setprop persist.radio.noril 1

 if [ "$(getprop persist.radio.noril)" == "1" ]; then
  echo "Radio is now disabled. Please reboot."
  return 0
 else
  echo "Error: unable to disable radio."
  return 1
 fi
}
. I'd like to remind that it's vital to place this code at the bottom of the file, but above the line mentioned at the start of this section.
Enable RIL

This function, as the comments explain, is the inverse of the radiooff function:
Code:
# This function connects a device back on the cellular network
# Upon execution, a reboot must be performed
function radioon {
 if [ "$(whoami)" != "root" ]; then
  echo "Error: must be executed as root."
  return 1
 fi

 if [ "$(getprop persist.radio.noril)" == "0" ]; then
  echo "Radio is already enabled."
  return 1
 fi

 setprop persist.radio.noril 0

 if [ "$(getprop persist.radio.noril)" == "0" ]; then
  echo "Radio is now enabled. Please reboot."
  return 0
 else
  echo "Error: unable to enable radio."
  return 1
 fi
}
. Upon saving the modifications, the functions radioon and radiooff will become available for use after the CyanogenMod Terminal application is started, or restarted. The procedure for using them is simply to enter the name of the needed function and enter.

It may be obvious, but the second solution will not work if the user uses a Terminal that is not CyanogenMod's.

(edit)
I am not too concerned with getting the radioon/off script working I have made a note in Documents with the noril command lines so if I need GPS or want to use it as a phone I have the tools to do so. If you figure it out leave a comment in the thread. I think I have what I needed when I began this exploration, I have a mostly FOSS mini tablet so I have a modern web browser while using my N900 as my primary phone. I want to leave everything I have tried as documentation for future users.

Last edited by biketool; 2019-11-18 at 10:47.
 

The Following 2 Users Say Thank You to biketool For This Useful Post: