Samsung Tab S2 9.7 - Installation LineageOS 15 et 16

Samsung Tab S2 9.7 - Installation LineageOS 15 et 16

Création : Debian 9.5 - Android 7.1 - LineageOS 15.1 (non officiel) - Heimdall 1.4.2 - TWRP_3.2.3-0

Ce document décrit les différentes étapes d'installation de la ROM LineageOs sur une Tablette Samsung S2 - 9,5" - VE à partir de la rom d'origine. Elle comprend les étapes suivantes :

1 - Préparation

2 - Installation de TWRP et sauvegarde du système orginal

3 - Installation de LineageOS15 et premier redémarrage

4 - Installation de MicroG (pour se substituer aux applications google)

5 - Réinstallation des applications

6 - Installation LineageOS16 et mises à jour

Références :

Sommaire

1 - Préparation migration

1.1 - Sauvegarde

Lors de l'installation de la nouvelle ROM toutes les données et applications présentes sur le périphérique et sur la carte SD externe seront effacées. Pour pouvoir les réinstaller rapidement, une fois la nouvelle ROM installée, faire un backup de ce que l'on souhaite transférer

Les copies entre le périphérique et le pc peuvent être effectuées au choix

1.1.1 - Sauvegarde des données utilisateur

    $ adb pull /storage/emulated/0 backup_data_tablet
$ adb pull /storage/4A31-BEAE/ backup_data_sdcard

1.1.2 - Sauvegarde des sms

Serveur SMTP : smtp.laposte.net
Port : 465
Sécurité : SSL/TLS
Nécessite authentification
Nom d'utilisateur : xxxxxx
Mot de passe : xxxxxx
Adresse e-mail de l'expéditeur
Adresse e-mail du destinataire
Objet et Corps

1.1.3 - Sauvegarde des contacts

1.1.4 - Sauvegarde de l'agenda

1.1.5 - Sauvegarde des applications utilisateur (sans les paramètres, ni données utilisateurs)

$ adb pull /storage/emulated/0/AppBackup AppBackup
$ cd AppBackup
$ rename 's/ /_/g' *.apk

1.2 - Caractéristiques

Menu Paramètres >> Mise à jour logicielle >> Téléchargement manuel des MAJ
Menu Paramètres >> A propos de la tablette >> Version Android 7.0
Le nom commercial Galaxy Tab S2
Le nom du modèle : SM-T819
Le nom du produit : gts210veltexx
Le nom de l'appareil : gts210velte
Le code produit SM-T819NZKEXEO
Le
AP ou PDA              = T819XXU2BRF4 - version de build du firmware
CP ou bande de base = T819XXU1BRD1 - version modem
CSC = T819XEO2BRG1 - Consumer Software Customization = version géographique, fournisseurs GSM

Note : Le type de modem est indiqué par XX = Europe dans AP et CP, la version géographique est indiqué par XEO = Pologne. Le code de la France est XEF.

1.3 - Modes développeur, download & recovery

1.3.1 Mode développeur

Taper 7 fois sur le Numéro de version
Le menu Options de développement apparaît
Déverrouillage OEM : Activer Autorisez le déverrouillage OEM - Le code PIN est demandé

1.3.2 Mode download

Presser simultanèment les touches : Home + Vol down + Start
ODIN MODE (HIGH SPEED
PRODUCT NAME : SM-T819
CURRENT BINARY: Samsung Official
FAP LOCK: OFF
WARRANTY VOID: 0x0
QUALCOMM SECUREBOOT : ENABLZ (CSB)
AP SWREV: S1, T1, H1,A1,AÉ,P1
SECURE DOWNLOAD: ENABLE

Pour sortir du mode Download et redémarrer

Presser simultanèment et maintenir environ 5 secondes les touches : Home + Vol up + Vol down + Start

1.3.3 Mode recovery

Presser simulanèment les touches : Home + Vol up + Start

Lorsque l'écran "Installing system update" s'affiche

appuyer sur la touche Vol up 

et attendre que le menu recovery s'affiche

Android Recovery
samsung/gts210veltexx/gts210velte
7.0/NRD90M/T819XXU2BRE1
----------------------------------------
Reboot system now
Reboot to bootloader
Apply update from ADB
Apply update from SD card
WIpe data/factory reset
Wipe cache partition
Mount /system
View recovery log
Run graphics test
Power off

Pour sortir du mode Recovery :

Presser simultanèment et maintenir environ 5 secondes les touches : Home + Vol up + Vol down + Start

1.4 - adb & heimdall

1.4.1 Installer adb

$ adb version
Android Debug Bridge version 1.0.36
Revision 1:7.0.0+r33-1
$ adb shell
gts210velte:/ $

Noter le nom de code de la tablette : gts210velte

1.4.3 Installer heimdall

$ heimdall version
v1.4.2
$ heimdall detect
Device detected
$ heimdall print-pit 
Heimdall v1.4.2
.....

Downloading device's PIT file...
PIT file download successful.

Entry Count: 43
Unknown 1: 1598902083
Unknown 2: 844251476
Unknown 3: 21325
Unknown 4: 14413
Unknown 5: 13625
Unknown 6: 50
Unknown 7: 0
Unknown 8: 0
.....

Ending session...
Rebooting device...
Releasing device interface...

1.5 - Sauvegarde de la table de partition

En mode download,

$ heimdall print-pit --no-reboot > pit_rom_stock.txt
$ heimdall download-pit --resume --output pit_rom_stock.pit

2 - Installation de TWRP

2.1 - Téléchargement

$ md5sum twrp-3.2.3-0-gts210velte.img
b9ef5da993070c83a7d9c66b14d9873a twrp-3.2.3-0-gts210velte.img
$ gpg --import public.asc
gpg: key 1D8597D7891A43DF: public key "TeamWin <admin@teamw.in>" imported
gpg: Total number processed: 1
gpg: imported: 1
$ gpg --verify twrp-3.2.3-0-gts210velte.img.asc twrp-3.2.3-0-gts210velte.img
gpg: Signature made mar. 07 août 2018 04:26:52 CEST
gpg: using RSA key 95707D42307C9D41D09BF7091D8597D7891A43DF
gpg: Good signature from "TeamWin <admin@teamw.in>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 9570 7D42 307C 9D41 D09B F709 1D85 97D7 891A 43DF

2.2 - Identification de la partition de recovery

$ heimdall detect
Device detected
$ heimdall print-pit  |grep -B12 recovery.img

--- Entry #18 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 19
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 176128
Partition Block Count: 65536
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: RECOVERY
Flash Filename: recovery.img

La partition de recovery a pour nom RECOVERY

2.3 - Flashage de la partition de recovery

# heimdall flash --RECOVERY twrp-3.2.3-0-gts210velte.img --no-reboot
.....

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading RECOVERY
100%
RECOVERY upload successful
.....

Le menu TWRP s'affiche après un instant.

2.4 - Sauvegarde système

$ adb pull /sdcard1/TWRP/BACKUPS/b36c608a/backup_system_etc_sauf_data_rom_stock/ ./

3 - Installation de LineageOS 15

3.1 - Nettoyage pour une "clean install"

3.2 - Installation de lineageOS

3.2.1 Téléchargement

Télécharger la dernière version de lineageOS et vérifier le téléchargement par la somme de contrôle sha1sum : Téléchargement rom lineageOS pour T819 - gts210vlte

3.2.2 Installation

$ adb push lineage-15.1-20180811_230908-UNOFFICIAL-gts210velte.zip /sdcard/
Install >> /sdcard >> lineage-15.1-20180811_230908-UNOFFICIAL-gts210velte.zip. 
This package supports bootloader (s) :..... T819XXU2BRB2, T819XXU2BRE1, T819XXU2BRE3 ....; 
this device has bootloader T819XXU2BRF4

soit la version de bootloader est trop ancienne, soit trop récente. Dans le cas présent, elle est trop récente et il suffit de l'ajouter manuellement dans le fichier "updater-script" de la rom lineageOS. Pour cela, avant de copier et installer la rom sur sdcard :

META-INF/com/google/android/updater-script

3.3 - Installation des droits root (optionnel)

$ sha256sum addonsu-remove-15.1-arm64-signed.zip 
e981cc7ca7d1acc3a8475e678f50aa11d64fa7fadcdd4c5bf777407af3ba952b addonsu-remove-15.1-arm64-signed.zip
$ sha256sum addonsu-15.1-arm64-signed.zip
b890e27937d9d14c9a22c66e4797fbc71bd854b6145e6be058326bc5796244ff addonsu-15.1-arm64-signed.zip
$ adb sideload addonsu-15.1-arm64-signed.zip

3.4 - Installation de fdroid privileged (optionnel)

$ wget https://f-droid.org/repo/org.fdroid.fdroid.privileged.ota_2070.zip
$ wget https://f-droid.org/repo/org.fdroid.fdroid.privileged.ota_2070.zip.as
$ gpg --verify org.fdroid.fdroid.privileged.ota_2070.zip.asc org.fdroid.fdroid.privileged.ota_2070.zip
gpg: Signature made ven. 20 oct. 2017 11:02:33 CEST
gpg: using RSA key 7A029E54DD5DCE7A
gpg: Good signature from "F-Droid <admin@f-droid.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 37D2 C987 89D8 3119 4839 4E3E 41E7 044E 1DBA 2E89
Subkey fingerprint: 802A 9799 0161 1234 6E1F EFF4 7A02 9E54 DD5D CE7A
$ adb sideload org.fdroid.fdroid.privileged.ota_2070.zip

3.5 - Redémarrage

Redémarrer la tablette et vérifier que lineageOS s'est correctement installé

Sélectionner le mode de stockage Adopted Storage ou Stockage externe amovible en conformité avec le formatage préalablement réalisé lors de l'étape "Nettoyage pour une "clean install""

3.6 - Signature spoofing (optionnel)

4 - Installation de microg

Installer microg comme décrit dans microG

4.1 - Préalable

On suppose l'installation des droits root, de fdroid et la "signature spoofing" installés

4.2 - Installation de gmscore

$ adb reboot
$ adb shell mount -o remount,rw /system
$ adb push microG_Services_Core_0.2.5.12879.apk /system/priv-app
microg https://microg.org/fdroid/repo
BusyBox_1.29.2.apk 
FakeGapps_2.0.apk
FakeStore_0.0.2.apk
F-Droid_1.3.1.apk
microG_DroidGuard_Helper_0.1.0.apk
microG_Services_Framework_Proxy_v0.1.0.apk
Mozilla_UnifiedNlp_Backend_1.4.0.apk
Nominatim_Geocoder_Backend_1.2.2.apk
Xposed_Downloader_0.5.apk (inutile puisque chargé par adb)
Xposed_Installer_3.1.5.apk

4.3 - Paramétrage de microG

4.4 - Vérifications

4.4.1 Yalp Store

4.4.2 Auto-vérification

Lancer Paramètres de microG >> Auto-vérification

No last known location...
Do not have location to test geocoder...
No UnifiedNlP was provided by the system within 10 seconds

Accorder manuellement les autorisations suivantes :

$ adb shell
gts210velte:/ $ su
gts210velte:/ # pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION
gts210velte:/ # pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION

4.4.3 Services de Localisation

4.4.4 Google Push Nofication

4.4.5 Certification SafetyNet

5 - Réinstallation des applications utilisateur

En mode utilisateur (device), réinstaller les applications sauvegardées précédemment

$ cd /chemin_vers_répertoire_backup_applications/
$ rename 's/ /_/g' *.apk
$ for i in *.apk; do adb install -r $i; done

6 - LineageOS 16

A noter :

L'installation "clean install" de la version 16 de LineageOS basée sur Android 9 est comparable à celle de la version 15 avec les écarts décrits ci-après :

6.1 - Installation de LineageOS16

$ wget -c https://sourceforge.net/projects/luk-lineageos/files/gts210velte/lineage-16.0/lineage-16.0-20181002_090736-UNOFFICIAL-gts210velte.zip/download -O lineage-16.0-20181002_090736-UNOFFICIAL-gts210velte.zip
$ $ sha1sum lineage-16.0-20181002_090736-UNOFFICIAL-gts210velte.zip
6ff185de90f234125a2cce762199360f00f0120f lineage-16.0-20181002_090736-UNOFFICIAL-gts210velte.zip
$ adb push lineage-16.0-20181002_090736-UNOFFICIAL-gts210velte.zip /sdcard/
Install >> /sdcard >> lineage-16.0-20181002_090736-UNOFFICIAL-gts210velte.zip 

6.2 - Droits super-utilisateur (optionnel)

Installer les droits super-utilisateur avec Magisk : voir Droits root

6.3 - Signature spoofing

Utiliser nanodroid-patcher du projet nanodroid : voir Signature spoofing

6.4 - MicroG

microg https://microg.org/fdroid/repo
Services_Core_0.2.6.13280.apk
FakeGapps_2.0.apk
FakeStore_0.0.2.apk
F-Droid_1.3.1.apk
microG_DroidGuard_Helper_0.1.0.apk
microG_Services_Framework_Proxy_v0.1.0.apk
Mozilla_UnifiedNlp_Backend_1.4.0.apk
Nominatim_Geocoder_Backend_1.2.2.apk
No last known location...
Do not have location to test geocoder...
No UnifiedNlP was provided by the system within 10 seconds

Accorder manuellement les autorisations suivantes :

$ adb shell
gts210velte:/ $ su
gts210velte:/ # pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION
gts210velte:/ # pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION

6.5 - Mise à jour LineageOS16

Pour installer une nouvelle version de LineageOS16 sans changement de version d'Android (nighly builds) : en mode Récupération TWRP