Gigaset GS290, how to root and install ZIP files?

Hello Folks,

I got a brand new Gigaset GS290 and installed /e/ OS on it. It runs pretty good so far! :slight_smile:
Considering to move my old apps and settings from my old phone (which runs /e/ OS also) I wonder how to root the phone to get my apps running (Titanium Backup)… I even wonder how to install a ZIP file (e.g. F-Droid - https://f-droid.org/repo/org.fdroid.fdroid.privileged.ota_2110.zip) to get the phone do what I want. :wink:

In short:

  • How to root the phone while /e/ OS and eRecovery are installed?
  • How to install ZIP files while /e/ OS and eRecovery are installed?

Thanks for any advice!

Kind regards
Christian

1 Like

Not any help? :frowning: [bump]

1 Like

I’m not an expert on the subject but I was given to understand that TWRP is needed inorder to flash zip files and the TWRP developers haven’t released a version of the software compatible with Gigaset phones yet.

I haven’t tried to root the phone yet because there is no TWRP available.

1 Like

Hey Gioni,

thanks for your reply! TWRP is not ready for the GS290. So one need to use the eRecovery (Fork from Lineage Recovery). The version from Dec. 2020 is broken, so no adb sideload possible. Meanwhile I found a newer eRecovery version here.
I didn’t had time to test it…
According to this thread it should fix the issue.
If sideloading will work I would use Magisk zip file to root the phone…

Thanks anyway!

kind regards
Christian

1 Like

Hi Christian,

Thanks for that. I did check to see if I could reboot into fastboot mode from my laptop but I lost my nerve there after. New phone and all that makes me cautious.

All the best,

Gioni.

Update: The linked eRecovery (v.0.14) enables the GS290 to be listed when typing adb devices on the terminal. But I cannot sideload another ZIP file nevertheless:

christian@christian-Swift-SF315-41G:~/firmwares/gs290$ adb version
Android Debug Bridge version 1.0.41
Version 30.0.5-6877874
Installed as /home/christian/adb-fastboot/platform-tools/adb
christian@christian-Swift-SF315-41G:~/firmwares/gs290$ adb devices 
List of devices attached
GS290CTM501231	recovery

christian@christian-Swift-SF315-41G:~/firmwares/gs290$ sudo adb sideload org.fdroid.fdroid.privileged.ota_2110.zip 
adb: sideload connection failed: closed
adb: trying pre-KitKat sideload method...
adb: pre-KitKat sideload connection failed: closed
christian@christian-Swift-SF315-41G:~/firmwares/gs290$

Does anyone have an idea what to do to get this work?

kind regards
Christian

I wasn’t able to sideload Magisk or F-Droid priviledged extension. In fact, the Magisk routine which patched the boot image caused the system to stop booting.

What I did instead, was doing it manually through the ADB recovery shell:

# boot into recovery, select mount /system and activate ADB

computer:/ # lsusb
Bus 001 Device 004: ID 0e8d:201c MediaTek Inc. 

# get recovery shell on device

adb shell

# verify that system partition is mounted

GS290:/ # mount
/dev/block/mmcblk0p31 on /mnt/system type ext4 (ro,seclabel,relatime)

# list all system apps on system partition

GS290:/ # ls -l /mnt/sytem/system/priv-app/
drwxr-xr-x 50 root root 4.0K 2009-01-01 00:00 .
drwxr-xr-x 19 root root 4.0K 2009-01-01 00:00 ..
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 BackupRestoreConfirmation
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 BlissLauncher
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 BlockedNumberProvider
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 CalendarProvider
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 CallLogBackup
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 CellBroadcastReceiver
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 ContactsProvider
drwxr-xr-x  2 root root 4.0K 2009-01-01 00:00 CtsShimPrivPrebuilt
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 DocumentsUI
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 DownloadProvider
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 DownloadProviderUi
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 DroidGuard
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 DynamicSystemInstallationService
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 ExtServices
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 ExternalStorageProvider
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 FakeStore
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 FusedLocation
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 GmsCore
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 InputDevices
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 LineageParts
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 LineageSettingsProvider
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 LineageSetupWizard
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 LocalTransport
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 ManagedProvisioning
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 MediaProvider
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 MmsService
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 MtpDocumentsProvider
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 NetworkPermissionConfig
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 NetworkStack
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 ONS
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 PackageInstaller
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 PermissionController
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 ProxyHandler
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 Seedvault
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 SettingsProvider
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 SharedStorageBackup
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 Shell
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 StatementService
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 SystemUIWithLegacyRecents
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 Tag
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 TeleService
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 Telecom
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 TelephonyProvider
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 TrebleApp2
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 Updater
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 UserDictionaryProvider
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 VpnDialogs
drwxr-xr-x  3 root root 4.0K 2009-01-01 00:00 WeatherProvider

# mount system partition writable

GS290:/mnt/system/system/priv-app # mount -o remount,rw /mnt/system

# create directories and adjust directory permissions

GS290:/ # mkdir /mnt/system/system/priv-app/F-DroidPrivilegedExtension
GS290:/ # chmod 755 /mnt/system/system/priv-app/F-DroidPrivilegedExtension
GS290:/ # touch /mnt/system/system/priv-app/F-DroidPrivilegedExtension -r /mnt/system/system/priv-app/Shell
GS290:/ # mkdir /mnt/system/system/priv-app/AuroraServices
GS290:/ # chmod 755 /mnt/system/system/priv-app/AuroraServices
GS290:/ # touch /mnt/system/system/priv-app/AuroraServices -r /mnt/system/system/priv-app/Shell
GS290:/ # mkdir /mnt/system/system/app/F-Droid
GS290:/ # chmod 755 /mnt/system/system/app/F-Droid
GS290:/ # touch /mnt/system/system/app/F-Droid -r /mnt/system/system/app/Weather

Then on another shell, I pushed the files from the official OTA zip files (unzip/rename first to match the conventions of /e/os:

# push files from computer
adb push push F-Droid.apk  /mnt/system/system/app/F-Droid/
adb push F-DroidPrivilegedExtension.apk  /mnt/system/system/priv-app/F-DroidPrivilegedExtension/
adb push privapp-permissions-org.fdroid.fdroid.privileged.xml /mnt/system/system/etc/permissions/
adb push AuroraServices.apk  /mnt/system/system/priv-app/AuroraServices/
adb push privapp-permissions-com.aurora.services.xml /mnt/system/system/etc/permissions/

The on the first terminal, continue to adjust permissions and file dates. I did it to be sure, but not every step might be necessary.

# adjust file permissions and modification dates on phone (just to be sure)
GS290:/ # chmod 644 /mnt/system/system/priv-app/F-DroidPrivilegedExtension/F-DroidPrivilegedExtension.apk
GS290:/ # chmod 644 /mnt/system/system/priv-app/AuroraServices/AuroraServices.apk
GS290:/ # chmod 644 /mnt/system/system/app/F-Droid/F-Droid.apk
GS290:/ # touch /mnt/system/system/etc/permissions/privapp-permissions-org.fdroid.fdroid.privileged.xml -r /mnt/system/system/etc/permissions/privapp-permissions-com.google.android.gms.xml
GS290:/ # touch /mnt/system/system/etc/permissions/privapp-permissions-com.aurora.services.xml -r /mnt/system/system/etc/permissions/privapp-permissions-com.google.android.gms.xml

# verify/adjust SELinux context

GS290:/ # ls -lZ mnt/system/system/app/Message/                                                                                                                
total 26848
-rw-r--r-- 1 root root u:object_r:system_file:s0 27787572 2009-01-01 00:00 Message.apk
drwxr-xr-x 3 root root u:object_r:system_file:s0     4096 2009-01-01 00:00 oat

# verify/adjust Android permissions settings/files (otherwise chmod 644 the copied files)

GS290:/ # ls -lZ /mnt/system/system/etc/permissions/privapp*                                                                                                    
-rw-r--r-- 1 root root u:object_r:system_file:s0   222 2009-01-01 00:00 privapp-permissions-com.android.vending.xml
-rw-r--r-- 1 root root u:object_r:system_file:s0   282 2021-02-03 13:35 privapp-permissions-com.aurora.services.xml
-rw-r--r-- 1 root root u:object_r:system_file:s0   450 2009-01-01 00:00 privapp-permissions-com.google.android.gms.xml
-rw-r--r-- 1 root root u:object_r:system_file:s0   219 2009-01-01 00:00 privapp-permissions-me.phh.treble.app.xml
-rw-r--r-- 1 root root u:object_r:system_file:s0   289 2019-11-23 06:09 privapp-permissions-org.fdroid.fdroid.privileged.xml
-rw-r--r-- 1 root root u:object_r:system_file:s0 20290 2009-01-01 00:00 privapp-permissions-platform.xml
-rw-r--r-- 1 root root u:object_r:system_file:s0   986 2009-01-01 00:00 privapp_whitelist_foundation.e.blisslauncher.xml
-rw-r--r-- 1 root root u:object_r:system_file:s0  1067 2009-01-01 00:00 privapp_whitelist_org.lineageos.lineageparts.xml
-rw-r--r-- 1 root root u:object_r:system_file:s0  1066 2009-01-01 00:00 privapp_whitelist_org.lineageos.lineagesettings.xml
-rw-r--r-- 1 root root u:object_r:system_file:s0  1518 2009-01-01 00:00 privapp_whitelist_org.lineageos.setupwizard.xml
-rw-r--r-- 1 root root u:object_r:system_file:s0   968 2009-01-01 00:00 privapp_whitelist_org.lineageos.updater.xml

Finally, unmount the system partition to avoid file corruption.

GS290:/ # umount /mnt/system

Now click power off on recovery or reboot. That worked for me, but will probably only last until the next system upgrade.

Be sure to understand what you are doing, there might be typos in my code!

I still hope to find a better solution, for instance through a working Magisk boot image which keeps the system partition untouched.

1 Like

Hi basat64g,

thanks for your help! The code looks pretty comprehensible. (There’s one push too much on adb push push F-Droid.apk /mnt/system/system/app/F-Droid/ though).
I’ll try that way as it seems to be the best solution so far. After that we should wait for TWRP to get ready for this device. Some people are working on that at least:


From the latter it may be possible to build a working TWRP right now. (There seems to be a good help on that at xda-developers.)

Thank you again for posting your instructions! :slight_smile:

kind regards
Christian

1 Like

Hello,
It seems there is already a TWRP recovery compiled for the GS290

https://build.lolinet.com/file/twrp/GS290/android-10.0/twrp-3.5.0-35-GS290.img

Not tested yet

David

3 Likes

I think I have the chance to test it tomorrow. Since I even unbricked the phone successfully already there’s no need to fear… :wink:

Thanks for link! :slight_smile:

kind regards
Christian

1 Like

haha, cool let us know if it works then I will install it :slight_smile:

Thanks,
David

It works for me. :slight_smile:
What I’ve tested so far:

  • Booting into recovery: success
  • User input for system partition decryption has a creepy color flickering and did not work for the very first try but I was able to unlock the partition using Mount menu and selecting “system”…
  • Sideload’ing F-Droid (for let it install updates without any user action) does _not_work :frowning: Don’t know if I need to be root for that before…).
  • Backup went through successfully, restore not tested yet.
  • Magisk installation via sideload leads to a bootloop which can be fixed by installing the original boot.img.

I assume the problems after sideload’ing aren’t related to TWRP itself.

Kind regards
Christian

which boot.img did you flash afterwards?
the one provided here?

EDIT: flashing the boot.img according to the instructions fixes the bootloop and magisk is gone.

Exactly that boot.img. Magisk is gone after flashing this of course since Magisk tries to patch the boot image to provide root access to the device. (Which leads to the boot loop at this time. :frowning: )

kind regards
Christian

The results are the same as using the standard recovery and sideloading those Programm Installation packages, i suppose. That seems to be more related to the system than recovery.

That’s true, possibly. But the current recovery version (0.14, date about 2021-01-26 ) does not support sideloading in my case at least.

Hi there,

this is for the sake of completeness:
Today my GS290 got stuck in TWRP when it tried to update to 0.15-q… from the System Updater. After struggling with flashing eRecovery and boot image and several unsuccessful reboot I can say that restoring a TWRP backup will work when Wipe’ing the device before the restoration process. :slight_smile:

Have a nice weekend and stay safe! :slight_smile:

Kind regards
Christian

1 Like

Hi there,
thanks for these explanations. I entered the Magisk loop described above (forgot to flash boot.img) but can’t go out of there now! Do you know how I can get back to TWRP (that I installed previously) to unpatch Magisk?

Just flash the original boot.img file linked for download in the installation instructions page.

Kind regards
Chris

I actually tried (although I have hard time getting into fastboot mode but I managed once, do you know the buttons?). so I
fastboot flash --disable-verity --disable-verification boot boot.img

(and even reapplied the full procedure) but still looping…
thanks
Stephane