Project

General

Profile

ModemDisable » History » Version 18

Denis 'GNUtoo' Carikli, 11/09/2020 06:00 PM
update root to new link

1 1 Jeremy Rand
h1. Disabling the Modem
2
3
h2. Samsung-RIL devices
4
5 3 Denis 'GNUtoo' Carikli
h3. Airplane Mode
6 1 Jeremy Rand
7 4 Denis 'GNUtoo' Carikli
On Replicant, samsung-RIL currently asks the modem to actually turn off its transmitters by going into a low power mode.
8 3 Denis 'GNUtoo' Carikli
9 4 Denis 'GNUtoo' Carikli
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.
10 3 Denis 'GNUtoo' Carikli
11 16 Denis 'GNUtoo' Carikli
The [[ModemDisableResearch]] has more technical details on the issue.
12 3 Denis 'GNUtoo' Carikli
13
h3. Powering off the modem
14
15
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).
16
17 1 Jeremy Rand
To disable the modem on Samsung-RIL devices, follow these steps:
18
19 3 Denis 'GNUtoo' Carikli
h4. Installation
20 1 Jeremy Rand
21 17 Denis 'GNUtoo' Carikli
The script should be shipped in Replicant 6.0 0004 RC2.
22
23
If you run a Replicant version that is before 6.0 0004 RC2, you will need to install the scripts.
24
25
To do that, from your PC, clone the user-scripts repository:
26 1 Jeremy Rand
<pre>
27 6 dl lud
git clone https://git.replicant.us/replicant/vendor_replicant-scripts -b replicant-6.0
28 1 Jeremy Rand
</pre>
29
30
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:
31
<pre>
32 8 Denis 'GNUtoo' Carikli
cd vendor_replicant-scripts
33
cd networking/modem
34 1 Jeremy Rand
./setup.sh
35
</pre>
36
37 18 Denis 'GNUtoo' Carikli
Then disconnect the device. Make sure [[EnablingRootAccess|root access for apps]] is enabled.
38 1 Jeremy Rand
39 3 Denis 'GNUtoo' Carikli
h4. Usage
40 1 Jeremy Rand
41
Open a [[UsageNotes#Terminal-emulator|terminal emulator]]. If the terminal is not running as root, you can gain root by running:
42
<pre>
43
su
44
</pre> 
45
46 9 Denis 'GNUtoo' Carikli
To disable the modem, run the following command:
47 1 Jeremy Rand
<pre>
48 15 Denis 'GNUtoo' Carikli
modem.sh off
49 1 Jeremy Rand
</pre>
50 15 Denis 'GNUtoo' Carikli
It will then disable the modem and reboot.
51 9 Denis 'GNUtoo' Carikli
52
To enable back the modem, run the following command:
53 1 Jeremy Rand
<pre>
54 15 Denis 'GNUtoo' Carikli
modem.sh on
55 1 Jeremy Rand
</pre>
56 15 Denis 'GNUtoo' Carikli
It will then enable the modem and reboot.
57 1 Jeremy Rand
58 11 Denis 'GNUtoo' Carikli
h2. Supported devices
59 1 Jeremy Rand
60 10 Denis 'GNUtoo' Carikli
h3. Replicant 6.0
61
62
As of April 2020, Replicant 6.0 only supports devices with libsamsung-ril or without modems.
63
64 13 Denis 'GNUtoo' Carikli
So on all supported devices with a modem, the script is supposed to work.
65
66 10 Denis 'GNUtoo' Carikli
Starting from Replicant 6.0 0004 RC1, the scripts are now shipped on the devices that have a modem.
67
68
h3. Before Replicant 6.0
69
70
Earlier Replicant versions supported devices with other modems protocol as well. This script didn't work on such devices.
71 12 Denis 'GNUtoo' Carikli
72
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.