Phone Administration
Install
You will completely wipe everything on the phone,
install rescue system "TWRP", system "LineageOS",
and apps from repository "F-droid".
Modernize
Before installing a custom system,
first upgrade to newest upstream-provided system
as some upgrades may include firmware changes kept on special storage,
which survives system reset or wipeout of user data:
- Fully charge the phone.
- Turn on the phone, booting into Nomal mode.
- Optionally do a factory reset:
If not immediately presented with an initial setup wizard
(or in any case just to be extra cautious),
at Settings -> System -> Reset options,
do a factory reset.
- Minimally complete the initial setup wizard.
- Update the system
(Play Store updates are irrelevant and can be stopped),
and repeat (after each reboot) until no system update is offered.
Samsung Galaxy S10 or newer requires unlocking
(skip this for older Samsung Galaxy S phones):
- Fully charge the phone.
- Turn on the phone, booting into Nomal mode.
- Enable developer setting:
At Settings -> About phone,
tab many times on Build number.
- at Settings -> System -> Advanced -> Developer options,
enable OEM mode.
- Enter Download mode:
Disconnect any cables and turn off the phone,
press and hold VOL-DOWN and SIDE buttons (and keep them held down!),
then connect USB-to-PC data cable,
release the held buttons when a warning screen appears,
long-press VOL-UP button,
and confirm doing a full system reset.
Install rescue system
Rescue system is installed using the tool Heimdall,
and apps are initially installed using fdroidcl.
First install those tools onto your Debian system:
sudo apt install heimdall-flash fdroidcl
Next, locate newest rescue system for your phone:
https://twrp.me/Devices/
Downloading newest rescue system needs faking the refererhint
(here using Samsung Galaxy S3 International Exynos as example):
wget --referer=https://eu.dl.twrp.me/i9300/twrp-3.2.1-0-i9300.img.html https://eu.dl.twrp.me/i9300/twrp-3.2.1-0-i9300.img
Install rescue system onto phone using Heimdall:
- Fully charge the phone.
- Boot into Download mode:
Disconnect any cables and turn off the phone,
press and hold VOL-DOWN and SIDE buttons (and keep them held down!),
then connect USB-to-PC data cable
(or on Galaxy S9 or older,
press and hold POWER until logo appears after ~2 seconds),
release held buttons when a warning screen appears,
and press VOL-UP button.
- Connect USB-to-PC data cable (if not already done in previous step).
- Execute from terminal:
heimdall flash --no-reboot --RECOVERY twrp-[TAB...].img
Phone screen tells you to not turn off,
but when terminal is done you can ignore that
and either turn off the phone go directly to next section.
Recovery
When taking over a phone from someone else,
or loosing full-disk-encryption password and needing to start over,
reset most possible.
First optionally recover data as needed, if possible.
Then wipe data and system partitions:
- Fully charge the phone.
- Boot into Recovery mode:
Disconnect any cables and turn off the phone,
connect USB-to-PC data cable,
press and hold VOL-UP and SIDE buttons (and keep them held down!),
press and hold POWER as well
(or on Galaxy S9 or older,
press and hold POWER only until logo appears after ~2 seconds),
release held buttons when TWRP intro screen appears,
and [Swipe] to enter home screen.
- Select Wipe, Format Data; type "yes"
- Select HOME, Reboot, Recovery (avoid installing any addons if offered!)
- [Swipe] to enter rescue mode
- Select Wipe, Advanced wipe, check all except "Micro SD card" and "USB OTG", [Swipe]
- Select HOME, Reboot, Poweroff (avoid installing any addons if offered!)
To install system after this (and phone is fully charged!),
you can skip step 8 above and go directly to step 5 below.
Install system
Locate and download newest system for your phone
(use menu icon in top left corner):
https://download.lineageos.org/
Install system onto phone:
- Fully charge the phone.
- Boot into Recovery mode:
(see above).
- Select Wipe; [Swipe]
- Select Home, Advanced, ADB Sideload; [Swipe]
- Connect USB-to-PC data cable (if not already done in previous step).
- Execute from terminal:
adb sideload lineage-[TAB...]-signed.zip (takes ~2 minutes)
- Select HOME, Wipe; [Swipe]
- Select HOME, Reboot, System (avoid installing any addons if offered!)
Initial boot after fresh install takes ~3 minutes on a Samsung S3,
probably less on a newer phone.
Add F-droid appstore integration
- Fully charge the phone.
- Boot into Recovery mode:
(see above).
- Select Home, Advanced, ADB Sideload; [Swipe]
- Execute from terminal:
fdroidcl update
fdroidcl download org.fdroid.fdroid.privileged.ota
- Connect USB-to-PC data cable.
- Execute from terminal:
adb sideload ~/.cache/fdroidcl/apks/org.fdroid.fdroid.privileged.ota_[TAB...].zip
- Select HOME, Reboot, System (avoid installing any addons if offered!)
Boot takes ~30 seconds
Add selected apps, including F-droid appstore
- Enable developer setting:
At Settings -> About phone,
tab many times on Build number.
- at Settings -> System -> Advanced -> Developer options,
enable Android Debugging.
- Connect USB-to-PC data cable.
- Execute from terminal:
fdroidcl install org.dmfs.tasks at.bitfire.davdroid org.birthdayadapter com.zegoggles.smssync org.smssecure.smssecure
fdroidcl install org.sufficientlysecure.viewer com.llamacorp.equate
fdroidcl install net.kismetwireless.android.smarterwifimanager
fdroidcl install com.fsck.k9 org.sufficientlysecure.keychain eu.siacs.conversations
fdroidcl install net.osmand.plus com.vonglasow.michael.satstat com.rareventure.gps2 de.schildbach.oeffi
If terminal commands fail,
you can test if permissions for doing ADB connections work
with the more generic command "adb shell".
Customize
Before you add anything personal - e.g. passwords,
you are recommended to activate full-disk encryption
at Settings -> Security -> Encryption -> Encrypt phone.
Ideas for further customization and use:
https://couchdesign.dk/phone/android/init/
|