Project

General

Profile

ModemDisable » History » Revision 14

Revision 13 (Denis 'GNUtoo' Carikli, 04/18/2020 05:19 PM) → Revision 14/18 (Denis 'GNUtoo' Carikli, 04/18/2020 05:27 PM)

h1. Disabling the Modem 

 h2. Samsung-RIL devices 

 h3. Airplane Mode 

 On Replicant, samsung-RIL currently asks the modem to actually turn off its transmitters by going into a low power mode. 

 This means that the modem firmware is most probably not off and that its firmware is still running. The modem might even still be able to receive information, as it would enable it to connect back to the network way faster than if it was really off. 

 The [[ModemDisableResearch]] [[ModemIsolationResearch#Powering-off-the-modem|Modem isolation research page]] has more technical details on the issue, and pointers on how to potentially implement a modem power off. 

 h3. Powering off the modem 

 Since the modem's firmware is loaded by the CPU on boot, the modem will be nonfunctional if the CPU chooses not to load the modem firmware.    This can be used to achieve a more trustworthy off-like state. It should be noted that while this does reduce attack surface, there may still be ways for the modem to be activated (e.g. if the non-free bootloader running on the CPU sends a firmware to the modem). 

 To disable the modem on Samsung-RIL devices, follow these steps: 

 

 h4. Installation 

 From your PC, clone the user-scripts repository: 
 <pre> 
 git clone https://git.replicant.us/replicant/vendor_replicant-scripts -b replicant-6.0 
 </pre> 

 For the next steps, [[ADB]] needs to be set up and [[ADB#Accessing-root-shell|running as root]]. Connect the device to your PC. The scripts are in the @networking/modem@ folder. Run the setup script the folder to push the scripts to the device: 
 <pre> 
 cd vendor_replicant-scripts 
 cd networking/modem 
 ./setup.sh 
 </pre> 

 Then disconnect the device. Make sure [[UsageNotes#Enabling-root-access|root access for apps]] is enabled. 

 

 h4. Usage 

 Open a [[UsageNotes#Terminal-emulator|terminal emulator]]. If the terminal is not running as root, you can gain root by running: 
 <pre> 
 su 
 </pre>  

 To disable the modem, run the following command: 
 <pre> 
 disable_modem.sh 
 </pre> 
 It will then reboot the device to disable the modem. 

 To enable back the modem, run the following command: 
 <pre> 
 enable_modem.sh 
 </pre> 
 It will then reboot the device to re-enable the modem safely. 

 

 h2. Supported devices 

 

 h3. Replicant 6.0 

 As of April 2020, Replicant 6.0 only supports devices with libsamsung-ril or without modems. 

 So on all supported devices with a modem, the script is supposed to work. 

 Starting from Replicant 6.0 0004 RC1, the scripts are now shipped on the devices that have a modem. 

 

 h3. Before Replicant 6.0 

 Earlier Replicant versions supported devices with other modems protocol as well. This script didn't work on such devices. 

 The script may or may not work on older Replicant versions. Check if there is a branch for the older version you are interested in if you want to try.