yashsingh1/xdaforums huggingface dataset:
[Android Q&A, Help & Troubleshooting] StarMiner99:
i managed to extract the stock boot.img and recovery.img using this guide with some modifications:

How to use Wwr MTK + SP Flash tool to backup Mediatek rom

This is a step-by-step guide on how to use Wwr MTK tool & SP flash tool to backup Mediatek (MTK) firmware. We had previously created guides on how to backup or dump firmware from a Mediatek (MTK) devi

forum.hovatek.com

things i did different:

i could not preform the ram test to determine the size of emmc_user so i just used a random length(0x3a3e00000) later on WwR told me that emmc_user should be: 0xe8f800000 i used this value to again read the emmc_user region and loaded it into WwR and continued on the rutorial.

now with this information we should be able to patch boot.img using magisk and flash it to our devices to root it.

to flash your device do the following: reboot into fastboot mode (power + volume up and select fastboot) then in a terminal type:

to unlock the bootloader:

fastboot flashing unlock

to flash an image to your device:

fastboot flash <partition> <image>

the stock images and the scatter file will follow
[Android Q&A, Help & Troubleshooting] StarMiner99:
I managed to succesfully root my smartphone using magisk there was a single problem which is the following:

Android verified boot

you need to flash a new vbmeta image

i made my own empty vbmeta image and flashed it now its working and my smartphone is rooted
[Android Q&A, Help & Troubleshooting] StarMiner99:
[HOW TO ROOT AND HOW TO INSTALL TWRP]

DISCLAIMER:

I will not be responsible for any damage to you device !!!!

step 1 :

make a backup of your smartphone data

step 2 :

unlock your bootloader

1. go to settings -> about phone -> click a few times on the build number

2. go to settings -> system -> developer options -> allow OEM unlocking

step 3 :

install adb and fastboot on your computer

https://xdaforums.com/t/tool-minimal-adb-and-fastboot-2-9-18.2317790/ <- you can download a minimal version here

step 4 :

enable usb debugging

go to settings -> system -> developer options -> enable usb-debugging

step 5 :

open a console on your computer and do the adb and fastboot stuff

type the following commands into your cmd:

adb reboot bootloader <- this will reboot your smartphone into fastboot mode

wait until your phone enters fastboot mode

as soon as your phone entered fastboot mode type the following:

fastboot flashing unlock <- this will unlock your bootloader you have to press volume up to confirm it

then flash vbmeta and magisk patched:

fastboot flash vbmeta vbmeta_disabled.img <- this will flash the new vbmeta file

[ROOT]

fastboot flash boot magisk_patched-23000_tvNQq.img <- this will flash the new boot image

[TWRP]

fastboot flash recovery twrp.img <- this will flash the new recovery image

step 6 :

reboot your phone and reconfigure it

Youre Done!

EDIT: please download the twrp image from the official TWRP site: https://twrp.me/gigaset/gigasetgs4.html
[Android Q&A, Help & Troubleshooting] bmwdroid:
@StarMiner99 as I'm thinking about buying it I'm glad to know it can be rooted.
[Android Q&A, Help & Troubleshooting] StarMiner99:
well it was not easy to get the stock images xD
[Android Q&A, Help & Troubleshooting] StarMiner99:
im currently also trying to port lineage os and twrp to the gigaset gs4
[Android Q&A, Help & Troubleshooting] bmwdroid:
That's good to hear.

Although if it can be rooted it might be sufficient for me to kill all not needed apps via adb and use Magisk for AFWall+.

Actually I've read about the possibility of a GS version with a better camera so I might wait a while before getting one.
[Android Q&A, Help & Troubleshooting] StarMiner99:
well there arent any unneeded apps :P
[Android Q&A, Help & Troubleshooting] StarMiner99:
[STOCK ROM + SCATTER FILES + PRELOADER]

here are the stock rom files, the scatter file and the preloader in a zip archive

File on MEGA

mega.nz
[Android Q&A, Help & Troubleshooting] OnuGre:
Hey StarMiner99, is the ADUPS software updating malware in the image you uploaed still working? Could hyou please explain briefly how to flash this stock rom? I have adb and fastboot already running and a rooted device too.

Thanks a lot!
[Android Q&A, Help & Troubleshooting] keinhaar:
any progress on this?

could i do something to help?
[Android Q&A, Help & Troubleshooting] UserSven:
First of all: Thank you very much! Everything has worked so far and the device is rooted.

But I still have one question. How does the device behave when the official updates from Gigaset are installed via OTA? The GS4 reports it would have security updates. Can I install them without losing root privileges? Does anyone already have experience? Thanks in advance!
[Android Q&A, Help & Troubleshooting] UserSven:
I have now simply installed the June 2021 update. The good news: It worked. The slightly less good news is that you have to flash the images again. But flashing also works with the latest version and the update check tells that there are no new updates. So it seems to work. (y)
[Android Q&A, Help & Troubleshooting] bmwdroid:
Which recovery do you use?

I've read in their forum that updating doesn't work when on TWRP.
[Android Q&A, Help & Troubleshooting] ChrisMucDev:
Why are you not just using the LineageOS GSI?

I have LineageOS17.1 running on my GS4 since Feb. without any issues so far.
[Android Q&A, Help & Troubleshooting] Wolfgang-Z:
Is there a tutorial on how to do that?
[Android Q&A, Help & Troubleshooting] ChrisMucDev:
Here is, what I did: (on your own risk)

As far as i can remember, i did not have any issues.

Step 1: Unlock your device

1. Enable Developer Options: Tap 10x on Build-Number (Setttings -> About the phone -> Build-Number)

2. Enable Bootloader Unlocking -> activate OEM-Unlock option (Settings -> System -> (More) -> Developer-Options)

3. Enable ADB Access -> Enable USB-Debugging / ADB (Settings -> System -> (More) -> Developer-Options)

4. (Set USB-Settings (Message-Center) from "No tx" to "PTP")

5. Connect phone to usb port, grant permissions on phone and check connection with `adb devices`

6. Boot to bootloader: `adb reboot bootloader`

7. Unlock Bootloader: `fastboot flashing unlock`

Step 2: Download GSI

1. Reboot your phone and install Treble Info App

(https://play.google.com/store/apps/details?id=tk.hack5.treblecheck&hl=en&gl=US)

GS4 should support AB-Partitions

2. Download GSI: https://sourceforge.net/projects/andyyan-gsi/files/

For GS4: treble_arm64_bv*

Step 3: Install GSI

1. Boot to recovery: `adb reboot recovery` or Volume Down + Power

2. Wipe data

3. Wipe cache

4. Enter fastboot

5. Flash GSI: `fastboot flash system <extracted-gsi-image>`

6. Reboot and enjoy

*. (just in case it does not boot, reboot to recovery -> enter fastboot and flash vbmeta: `fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img`)

This vbmeta-image should work (see post #6): https://xdaforums.com/attachments/vbmeta_disabled-img.5325563/
[Android Q&A, Help & Troubleshooting] Wolfgang-Z:
I think I'll wait for a twrp port. This seems a little too risky without the ability to do a backup first
[Android Q&A, Help & Troubleshooting] ChrisMucDev:
I don't want to persuade you to do it, but maybe I can take some of the fear away. As you are flashing just the system partition, your recovery still remains untouched. So, as long as you have the stock ROM, you could go back anytime. I created a stock ROM backup with SP Flash Tool (see post #4), and in post #12 you'll find a link to download the stock ROM, created by StarMiner99.

Maybe (not checked) you can also do a backup of the system-partition only, using adb shell, dd and adb pull

```

$ adb shell

# dd of=/sdcard/system.img if=/dev/block/mmcblkXXXX

# exit

$ adb pull /sdcard/system.img

```
[Android Q&A, Help & Troubleshooting] realinfoman:
Hi, thanks for the work for GS4.

I tried the root method with vmeta and patched magisk -> it works but security net test fails. a new magisk install fails, because /dev/block/mmcblk0p33 is r/o. Is there any hint to get it r/w?

afte a time, i tried to flash lineage gsi -> it doesnt work. I get "operation not permitted" when fastboot reaches the 4th partition to flash.

I tried fastboot after adb reboot bootloader and adb reboot recovery -> selected fastboot

Both Fastmodes modes seems to be different. My attempt to flash lineage leads to bootloop and flashing vbmeta didnt help. Only sp flash and stockrom helped to get gs4 working again.

Are there additional steps to get lineage gsi on this phone?
[Android Q&A, Help & Troubleshooting] Napfuzius:
I am quite new to the topic. Are there any informations about flashing in general? I did a S5 mini flash with instructions. What @ChrisMucDev does is then a bit unclear to me. Can you help?
[Android Q&A, Help & Troubleshooting] RealSly:
If you have problems finding the Fastboot driver, here is a download link.
[Android Q&A, Help & Troubleshooting] RealSly:
I had a firmware update yesterday. After the update, root access was gone. Therefore, I have re-flashed the boot.img and the vbmeta.img. After the restart, I had root access again, but WLAN and Bluetooth no longer work.

I need help urgently, please.
[Android Q&A, Help & Troubleshooting] StarMiner99:
I haven't updated yet. Because im currently not at home but ill take a look at it as soon as im at home. A quick fix would be flashing the stock boot.img provided in one of my posts(#12). But first of all try a quick reboot.
[Android Q&A, Help & Troubleshooting] StarMiner99:
Also good to know about the gsi i didnt know what it was or that it existed.
[Android Q&A, Help & Troubleshooting] StarMiner99:
I just downloaded the update and because they are saved under /data/ota_package i was able to copy the zip update file.
[Android Q&A, Help & Troubleshooting] StarMiner99:
you need to bee in fastbootd not fastboot just boot into recovery and select fastboot it will work then.

also only flash the SYSTEM partition.
[Android Q&A, Help & Troubleshooting] StarMiner99:
I managed to port TWRP to the Gigaset GS4 using this tool: https://awesomeopensource.com/project/SebaUbuntu/TWRP-device-tree-generator and copying the stock fstab files from the recovery ramdisk.

GitHub repo:

GitHub - StarMiner99/android_device_Gigaset_Gigaset_GS4_twrp: TWRP Device Tree for Gigaset GS4

TWRP Device Tree for Gigaset GS4. Contribute to StarMiner99/android_device_Gigaset_Gigaset_GS4_twrp development by creating an account on GitHub.

github.com

There currently is one major problem i could use help with:

TWRP mounts the userdata partition but only displays weird folder names. Probably because the storage is encrypted

Does anyone know if TWRP supports Encryption and if yes how to enable it in the device tree.

Current Status:

userdata is unreadable

Blocking checks

- [x] Correct screen/recovery size

- [x] Working Touch, screen

- [-] Backup to internal/microSD <-- microsd only /data encryption breaks this

- [-] Restore from internal/microSD <--- /\

- [x] reboot to system

- [x] ADB

Medium checks

- [ ] update.zip sideload <-- normal adb probably broke this one (worked before)

- [x] UI colors (red/blue inversions)

- [x] Screen goes off and on

- [-] F2FS/EXT4 Support, exFAT/NTFS where supported <-- f2fs not working. Fat32 is also working

- [x] all important partitions listed in mount/backup lists <-- in backup list everything is displayed as 0mb as soon as you make a backup the partition sizes get updated. Data is broken because of encryption.

- [?] backup/restore to/from external (USB-OTG) storage (not supported by the device) <-- probably yes

- [x] backup/restore to/from adb (https://gerrit.omnirom.org/#/c/15943/)

- [ ] decrypt /data

- [-] Correct date <-- change time zone in settings. Time isnt visible due to the front camera resets after every reboot :\

Minor checks

- [x] MTP export <--- internal storage is accesible via mtp after first reboot

- [x] reboot to bootloader

- [x] reboot to recovery

- [x] poweroff <-- sometimes triggers a reboot

- [x] battery level

- [x] temperature

- [?] encrypted backups <-- cant find a button to encrypt it so i dont know

- [?] input devices via USB (USB-OTG) - keyboard, mouse and disks (not supported by the device)

- [?] USB mass storage export

- [x] set brightness

- [x] vibrate

- [?] screenshot <-- idk i have linux (there is a script for windows)

- [ ] partition SD card <-- unable to remove partition table
[Android Q&A, Help & Troubleshooting] SOFO888:
Is there an update of TWRP?

Is it still possible to root?
[Android Q&A, Help & Troubleshooting] StarMiner99:
I am working on making the TWRP Build official.

And yes it is still possible to root.
[Android Q&A, Help & Troubleshooting] StarMiner99:
I added instructions on how to install twrp to this post https://xdaforums.com/t/root-gigaset-gs4.4219439/post-85111317

I also added the twrp recovery image
[Android Q&A, Help & Troubleshooting] BigOneT:
Hello,

is there a chance to root and make TWRP for the new Gigaset GS5 ????

its a MediaTek Helio G85.... there many devices with this MediaTek e.g. Redmi Note 9
[Android Q&A, Help & Troubleshooting] QuentinAP:
PS C:\adb> Fastboot Flashing Unlock

...

FAILED (Remote: Not implemented.)

completed. Total time: 0.004s

_

send 'vbmeta' (4 KB)...

OK [ 0.002s]

write 'vbmeta'...

FAILED (Remote: Blinking lock indicator is locked. Please unlock first!)

can someone help me????

PS C:\adb> Fastboot Flashing Unlock

...

FAILED (Remote: Nicht implementiert.)

beendet. Gesamtzeit: 0.004s

_

'vbmeta' senden (4 KB)...

OK [ 0,002s]

'vbmeta' schreiben...

FAILED (Remote: Blinkendes Sperrkennzeichen ist gesperrt. Bitte zuerst entsperren!)

kann mir jemand helfen????
[Android Q&A, Help & Troubleshooting] Hansi_K:
Hello,

I hope to find some knowledgeable GS4 users here as I have a problem with TWRP:

I wanted to replace the bootloader of the GS4 with TWRP but without rooting the GS4.

So I followed the instructions from Android: Install and set up TWRP recovery - here's how.

and did everything exactly like that.

I already had experience with the Samsung S5Neo and also installed and used the TWRP there.

Everything worked as far as it went - only no TWRP worked.

After that I unlocked the bootloader following this guide Android Smartphone Hack - Unlock Bootloader, Root & Install Custom ROM & Recovery, resulting in a bootloop.

After power on and boot logo, this writing appears:

"Red Status

The following options are available:

1. recovery - results in bootloop

2. fastboot - I can install something ...

3. normal - results in bootloop

Now I don't know exactly what to enter for Fastboot, can anyone help me?

Many thanks in advance.
[Android Q&A, Help & Troubleshooting] StarMiner99:
The latest version of the official android was probably installed, but the twrp is made for the previous version.

To solve this problem:

1. https://mega.nz/file/aA5CAS4K#WymTFPY-XYe7H1wTdSDbJ_2goUEazRKwrLKCdFLmYVQ <- here I uploaded the extracted firmware for exactly such cases, just download and unzip it

2. fastboot flash boot boot.img and fastboot flash recovery recovery.img

try that and your smartphone should work again

as soon as i get around to it i will update twrp for the latest version

Vermutlich war die neuste version vom offizielen android installiert, das twrp ist aber für die version davor gemacht.

Um dieses problem zu lösen:

1. https://mega.nz/file/aA5CAS4K#WymTFPY-XYe7H1wTdSDbJ_2goUEazRKwrLKCdFLmYVQ <- hier hab ich die extrahierte firmware für genau solche fälle hochgeladen einfach runterladen und entpacken

2. fastboot flash boot boot.img und fastboot flash recovery recovery.img

versuch das mal dann sollte dein smartphone wieder funktionieren

sobald ich dazu komme, werde ich twrp updaten für die neuste version
[Android Q&A, Help & Troubleshooting] Hansi_K:
Oh, thank you very much. I'll try that out right away!
[Android Q&A, Help & Troubleshooting] Hansi_K:
Hello StarMiner99

Unfortunately it does not work.

The following is displayed:

"

C:\Minimal ADB and Fastboot>fastboot flash boot D:\boot.img

target reported max download size of 134217728 bytes

sending 'boot' (32768 KB)...

OKAY [ 0.781s]

writing 'boot'...

FAILED (remote: not allowed in locked state)

finished. total time: 0.793s

C:\Minimal ADB and Fastboot>fastboot flash recovery D:\recovery.img

target reported max download size of 134217728 bytes

sending 'recovery' (32768 KB)...

OKAY [ 0.782s]

writing 'recovery'...

FAILED (remote: not allowed in locked state)

finished. total time: 0.794s"

What can I do to allow this?
[Android Q&A, Help & Troubleshooting] bmwdroid:
@Hansi_K did you:

fastboot oem unlock?

And btw Idk if path should be included in the command.

I did it without "D:\" on an identically constructed Fairphone.
[Android Q&A, Help & Troubleshooting] SOFO888:
Is it possible to unlock the boot loader through ADB?
[Android Q&A, Help & Troubleshooting] Hansi_K:
Thank you for the answer. I only have the option mentioned above to enter something via fastboot. That's why I can't answer that!
[Android Q&A, Help & Troubleshooting] Hansi_K:
Thank you for the answer.

Yes, I had entered that before the bootloop. Now it does nothing.
[Android Q&A, Help & Troubleshooting] SOFO888:
I found this.

Maybe it helps:

https://xdaforums.com/t/failed-remo...ng-an-error-when-i-try-to-flash-twrp.4332847/
[Android Q&A, Help & Troubleshooting] realinfoman:
Hello, I have Issues with Android 10 V14. VOWIFI and VOLTE is not working anymore. My Wife has also an GS4 and she was lucky to install (OTA) Android 11 and everything works.

I tried to upgrade a few days later and i got only V14 from Android 10.

Are there downloadlinks for GS4 Android 11 or for Android 10 V12?

Or is there a possibility to extract Android 11 from my wife's phone and to install to my phone without dataloss?
[Android Q&A, Help & Troubleshooting] Hansi_K:
Hello StarMiner99

I have now tried to flash the boot.img via ADB-fastboot. Unfortunately it does not work and the following message appears:

„C:\Minimal ADB and Fastboot>fastboot flash boot D:\boot.img

target reported max download size of 134217728 bytes

sending 'boot' (32768 KB)...

OKAY [ 0.781s]

writing 'boot'...

FAILED (remote: not allowed in locked state)

finished. total time: 0.792s“

What can I do?
[Android Q&A, Help & Troubleshooting] Hansi_K:
Hello, I have not found anywhere a solution how to get my GS4 fixed again.

Therefore, I wrote again to the support with the request of a repair, which should not be impossible for a manufacturer.

They have now repaired the GS4 and I will keep my hands off any further attempts.
[Android Q&A, Help & Troubleshooting] SOFO888:
At least your device works again.

Just a question: did you have to pay for the fix at the manufacturer?
[Android Q&A, Help & Troubleshooting] Hansi_K:
I have not yet received an invoice. The repair quote is €25.
[Android Q&A, Help & Troubleshooting] malvinas2:
Is this working for the last update of Android 10, 5th of january 2022? Kernel 4.14.141

Last update because now I get a message to update to Android 11. Or would it even work for Android 11?
[Android Q&A, Help & Troubleshooting] realinfoman:
Yes its working! I 'm using root with Android 11 and V13 Update.

1. To Upgrade to 11 or Update from earlier Android 11 Versions remove root, (i.e flash stock boot.img to phone)

2. Do the Update /Upgrade

3 extract new boot.img (save and make a backup of stock boot.img it to do step 1 !!!! for later updates)

4. patch boot.img with magisk

5. flash vbmeta_disabled from page 1 of this thread and patched boot.img to your phone.

6. you are ready and enjoy.

Warning, do not you use a boot.img which does not match the version. It could be that bluetooth or wlan dont work. (My experience :)) Thats the reason for extract and patch the boot.img for every new version/update of GS4 Software.
[Android Q&A, Help & Troubleshooting] HeldVomErdbeerfeld0:
> Yes its working! I 'm using root with Android 11 and V13 Update.

This sounds great.

But i fail a bit before ... Trying to get into twrp

$ fastboot flashing unlock
(bootloader) Start unlock flow
OKAY [ 39.875s]
Finished. Total time: 39.875s

$ fastboot flash recovery twrp-3.5.2_10-0-Gigaset_GS4.img
Sending 'recovery' (25088 KB) OKAY [ 0.958s]
Writing 'recovery' OKAY [ 0.351s]
Finished. Total time: 1.319s

$ fastboot reboot
Rebooting OKAY [ 0.003s]
Finished. Total time: 0.053s

But how do i get into TWRP ?

Booting into fastboot - ✅ no problem

Booting System - ✅ no problem

Booting into recorery => i only get into gigaset recoverty :unsure:

Is there any key combination i have to use?
[Android Q&A, Help & Troubleshooting] bmwdroid:
Afaik it's not possible to have two recoveries at the same time.

To me it looks, as if you didn't flash twrp at all or not correctly.

Did you boot into recovery directly after flashing TWRP?

Best imo to shut down the device and reboot into recovery manually later.
[Android Q&A, Help & Troubleshooting] HeldVomErdbeerfeld0:
I followed https://twrp.me/gigaset/gigasetgs4.html#fastboot-install (Fastboot Install Method)

adb reboot bootloader
fastboot flash recovery twrp-3.5.2_10-0-Gigaset_GS4.img
fastboot reboot

There were no error messages (see #53) only *Okays*
[Android Q&A, Help & Troubleshooting] bmwdroid:
@HeldVomErdbeerfeld0 didn't answer this:

Did you boot into recovery directly after flashing TWRP?

perhaps it works better:

fastboot reboot recovery
[Android Q&A, Help & Troubleshooting] HeldVomErdbeerfeld0:
Thanks ... just tried it again with flashing and afterwards fastboot reboot recovery

but this also resulted in the same behaviour:

gigaset screen with note "device is unlocked ... booting in 5 secs"

black screen

gigaset screen with note "device is unlocked ... booting in 5 secs" again

gigaset screen without note

booting system

holding VOL-UP while reboot:

gigaset screen with note "device is unlocked ... booting in 5 secs"

black screen

"select boot mode" screen: i select "recovery"

gigaset screen with note "device is unlocked ... booting in 5 secs"

black screen

gigaset screen with note "device is unlocked ... booting in 5 secs" again

gigaset screen without note

booting system

Also following key combinations did not work either :(

VOL-UP + PWR button

VOL-UP + VOL-DOWN

VOL-DOWN + PWR Button
[Android Q&A, Help & Troubleshooting] bmwdroid:
Just checked :

You didn't follow what it says there.

Perhaps it helps doing it the way they say.

If not I'm at the end of my wit.
[Android Q&A, Help & Troubleshooting] HeldVomErdbeerfeld0:
@bmwdroid

Thanks for your help .... but renaming image doesnt work either :(

unfortunately i just accidently flashed twrp into boot 😩 god damn it ...

reflashing the boot and vbmeta and recovery from stock rom only allow me to get into fastboot mode or original recovery (once after flashing it) ...

but everything else ends in a bootloop :(

trying factory reset from original recovery fails with mesage "FOTA not found"
[Android Q&A, Help & Troubleshooting] leroses:
Hello!

I'm new and I want to ask: Ist there any chance to get twrp by android scatter file and then flash with sp flash tool. With adb I always get a boot loop. Thanks for answering!
[Android Q&A, Help & Troubleshooting] realinfoman:
what is the advantage of twrp? i have root without twrp.
[Android Q&A, Help & Troubleshooting] bmwdroid:
Twrp gives you more options as standard recovery usually does.

Backing up partitions, restoring, aso.

But I don't know what stock GS4 recovery offers.

Only had the Vollaphone which has same hardware afaik.
[Android Q&A, Help & Troubleshooting] Beelzeb00b:
was looking for TWRP for a GX6, but all i could find is this thread. Anyone else an idea if TWRP would be available for newer gigaset phones?
[Android Q&A, Help & Troubleshooting] leroses:
Dear Community! Does TWRP 10 also work with the updated Android 11 of GS4? Appreciate any reaction!
[Android Q&A, Help & Troubleshooting] leroses:
Hello! Does anybody have the current boot.img from the last system update 5th Avril 2023 (android 11)? I don't have TWRP, so I can't extract boot.img. With the current boot.img I want to root with Magisk (patching the file). Thanks a lot!