[Samsung Galaxy M30 Guides, News, & Discussion] vdbhb59:
Hi All,

Today I successfully flashed the

PHH GSI

on my Samsung M305F. Sharing the guide on how to?..

Prerequisites:

1. Android 10 May Security Patch (June release). Get it here. Be on stock firmware, non rooted.

2. PHH/Havoc or any GSI you wish to flash. I suggest PHH one as it is regularly updated and has inbuilt FLOSS/FOSS apps build too, other than Vanila, GApps build too. Choose the GSI from the list here.

Boot with AB only. Seems this was due to some ROM compatibility issue and the FW of Samsung that time. Any Treble based ROM, based on our partition structure works now.

3. PHH Magisk (this is a modified Magisk for GSI images, and should work on any GSI). Please do not use any other Magisk or SuperSU for initial flash, else you will not boot. Trust me, I tried several time, and does not boot. Get the PHH Magisk here or here.

4. DM-Verity file. Download from here, here or check here for further reading.

5. TWRP for Android 10 for Samsung M30. Get it here or here.

6. USB-OTG. See #6 below for reason.

Instructions:

1. Flash Stock ROM from #1 above.

2. Ensure that you are connected to internet/mobile data so that OEM unlock option is visible. If not connected to Internet, OEM unlock will not show, as it needs to check over Samsung servers on start.

3. Wait for 15 minutes for KG state to check servers (this time frame can be less or more depending on your internet connection). Mine was 3-4 minutes. This is important for the next steps.

4. Reboot to download mode and flash the TWRP from ODIN, by selecting it in AP (auto-reboot should be unchecked). The full steps are available in the XDA post linked in #5 above.

5. Reboot to TWRP, and format data (not wipe). Reboot to TWRP again. This step is important for recovery to not get overridden by the stock recovery.

6. MTP on recovery and upon boot somehow still does not work on Linux or Windows, so copy your relevant files on USB-OTG. Akhil and Sahil are working on the recovery part of it. For normal system, that is an issue with all GSI's somehow.

7. Wipe /data, /cache and /internal storage, and then mount /data and /usb-otg.

8. Ensure /system and /vendor are not mounted, and only /data and /usb-otg are mounted. You can copy the files over from OTG to internal sd card, or directly work from OTG itself. Up to you.

9. Do not wipe anything else, and just flash as follows:

a. Flash the GSI Image (.img) file in /system partition from recovery.

b. Flash the Magisk PHH file given in the link above.

c. Flash the DM-Verity file from the link above.

10. Wipe dalvik/cache. Reboot to system.

Boot time should not be much, if you follow the steps properly. Mine took 3-4 minutes.

Post boot:

1. Inbuilt SuperSU will give binary error/update prompt. Not needed, and ignore it.

2. Once you have setup Magisk, you can then upgrade both manager and magisk itself. It will not bootloop. But for initial flashing use the Magisk given in the link, and no other, else you will bootloop.

3. MTP does not work. VoLTE, I am yet to check, so if someone can confirm that, it will be good.

4. USB-OTG works. So, you will have to use it for any file copying etc. Please format USB-OTG once from the phone, as it will otherwise give USB Error and your time would be wasted. So format from mobile first and then copy anything to USB.

5. I did not find any bugs till now. Not sure, if any present or not, as I booted today only, after 8 failed weeks.

VoLTE Fix: https://github.com/KhushrajRathod/VoLTE-Fix/

Credits:

1. Sahil_Sonar and Akhil99 for the working TWRP (finally) :)

2. MiyamuraNEET for helping me with flashing GSI, and giving me the link for correct DM-Verity. No other DM-Verity works.

3. phhusson for making a working GSI (especially FOSS/FLOSS one).

4. Samsung for making a BLOAT FILLED OS.

5. turbolukex5 for PHH Magisk.

6. vdbhb59 (of-course me) for not giving up, and for keeping on trying for the last 8-9 weeks.. :)

Let me know if anything is missed..