FORUMS
Remove All Ads from XDA

[RECOVERY] TWRP for Galaxy A70

2,763 posts
Thanks Meter: 10,312
 
Post Reply Email Thread
This is TWRP for the Galaxy A70.
I won’t describe what this recovery does or features it has, because these are redundant information. You should know what TWRP is good for if you are going to flash this.

I’d recommend to read everything in this post, if you care about your expensive phone.

Let’s start with the installation process
  1. First of all you need to modify the vbmeta partition which handles partition verification.
    You can do that by simply following the on the how to root your device guide https://forum.xda-developers.com/gal...-odin-t3930099
    (If you don’t want to flash all the partitions you can also just extract the patched vbmeta image and flash only that image).
  2. Once the modified vbmeta image was flashed you probably have to wipe your data.
  3. When your device boots successfully you can set it up, make sure OEM unlock is greyed out/enabled in developer settings (if it doesn't show up, connect to a network first) and then boot into download mode and flash the TWRP recovery (if you want to preserve root access you need to patch the recovery image first in Magisk).
  4. Enjoy TWRP!

So that was the easy part. The hard part is to completely read these following points!
  • Things you have to consider when preserving root with TWRP
    The Galaxy A70 is a system-as-root device (https://source.android.com/devices/b...system-as-root). That means Magisk can no longer be installed in the boot image and the only other way to have Magisk installed without a modified system or vendor partition is the recovery partition (that’s why you have to patch the TWRP image). Generally that shouldn’t cause any problems, but when Magisk is only installed on the recovery partition, then that also means the device must boot from recovery, so the kernel in the recovery partition must be compatible with system, vendor and all other partitions (firmware etc.). Now here comes the big problem! TWRP only works with a custom kernel and Samsung doesn’t always release their kernel sources on time, that means you might be stuck with an older firmware if you want to preserve root access and want to have TWRP installed. As for now the latest firmware isn’t compatible with the kernel source Samsung has uploaded and you must be on an older version to have Magisk working with TWRP. I can’t give you the exact firmware versions which will work the a patched TWRP image, because there are different variants of this phone (A705FN, A705GM, etc.). Either search this thread for advice or find it out for yourself. If the patched TWRP bricks your device, you can just flash the stock rom again.
  • Encryption/Decryption
    Decryption works on this TWRP release, but only partially. That means you have to open the Settings Application first on your phone and disable a feature called strong protection. You can find it in Settings->Biometrics and scurity>Other security settings. It doesn’t matter when you disable it. Flash TWRP first and disable it, fine. Disable it and flash TWRP afterwards, fine. Never disable it, also fine, TWRP just fails to decrypt your data, but won’t do any harm. This feature probably is Strongbox, something Google has introduced with Android 9 (https://developer.android.com/traini...icles/keystore). I am not sure though, I didn’t really put much research into that.

There is not much else to say for now. If you run into problems, then make a detailed post and I will extend this first post if necessary.

Developers specific details
  • Sources
    https://github.com/Grarak/android_device_samsung_a70q
    https://github.com/Grarak/android_device_samsung_a70q
    Kernel sources are a combination of SM-A705GM_SWA_PP_Opensource and SM-A705MN_LA_PP_Opensource (A705MN as base and DTS files from A705GM)
  • TWRP modifications
    For decryption you have to comment out some code.
    In https://github.com/omnirom/android_b...eyStorage4.cpp look for the function bool retrieveKey and comment out the if statement if (auth.usesKeymaster()). This should be always true!
  • Recovery image size
    For some reason the ramdisk has a size limit, so I used LZMA compression to get its size down as much as possible.
  • During kernel compilation you will run into a DTC error. Apparently Samsung didn’t bother to update their DTC source in the kernel and you have to use their precompiled binary. I edited my kernel sources to automatically use their dtc binary.

Credits

Downloads
https://github.com/Grarak/android_de..._a70q/releases (Also changelog)
Note The download is a zip file, unpack it and you will get the recovery image. To flash it in Odin pack it as tar with 7zip or a compression tool of your liking.
The Following 24 Users Say Thank You to Grarak For This Useful Post: [ View ]
 
 
9th August 2019, 12:57 PM |#2  
Grarak's Avatar
OP Recognized Developer
Flag Vienna
Thanks Meter: 10,312
 
Donate to Me
More
FAQ
  • When TWRP can't work with Magisk, then what's the point of this?
    TWRP can work with Magisk, if the firmware you have is compatible. (Read first post).
    But yes, right now there are no reasons to have TWRP installed, but you have to start development somewhere and having a working custom recovery is a pretty good first step.
The Following 9 Users Say Thank You to Grarak For This Useful Post: [ View ]
9th August 2019, 01:07 PM |#3  
haky 86's Avatar
Recognized Contributor
Flag Hama (Syria)
Thanks Meter: 7,239
 
Donate to Me
More
nice work, I'll buy the phone in this 2 days to start some works.
The Following 12 Users Say Thank You to haky 86 For This Useful Post: [ View ] Gift haky 86 Ad-Free
9th August 2019, 01:43 PM |#4  
Member
Flag Nagpur
Thanks Meter: 3
 
More
Thanks bro 😍

Screenshot please
9th August 2019, 02:54 PM |#5  
BK☑️'s Avatar
Member
Flag 🌉🌁🏙🌄🏙🌃🌇⛺🌆🏙🌅🌃🌉🏙⛺
Thanks Meter: 39
 
More
thanks alot ! development can start on this phone ! (i confirm twrp work)
The Following User Says Thank You to BK☑️ For This Useful Post: [ View ] Gift BK☑️ Ad-Free
9th August 2019, 03:33 PM |#6  
devilhunter47's Avatar
Senior Member
Flag Kottayam
Thanks Meter: 354
 
More
Quote:
Originally Posted by BK☑️

thanks alot ! development can start on this phone ! (i confirm twrp work)

Which version do you have?
9th August 2019, 03:45 PM |#7  
BK☑️'s Avatar
Member
Flag 🌉🌁🏙🌄🏙🌃🌇⛺🌆🏙🌅🌃🌉🏙⛺
Thanks Meter: 39
 
More
Quote:
Originally Posted by devilhunter47

Which version do you have?

TWRP version is 3.3.1

actual firmware is A705FNXXU3ASG6_A705FNOXM3ASG6_BTU (july security patch) (United kingdom)

prev. firmware was A705FNXXU1ASE4_A705FNOXM1ASE4_XEF (may security patch) (France)

edit 1 : the ui freeze completly when phone is booted up , had to flash all back

i'm going to flash A705FNXXU1ASD1_A705FNOXM1ASD1_BTU (april security patch) (United kingdom) and see if it boot correctly...

edit 2 : cant flash previous firmware due to 'security reasons' ,i flashed back stock recovery, it doesnt freeze anymore, i guess we will have to wait for a custom kernel
The Following User Says Thank You to BK☑️ For This Useful Post: [ View ] Gift BK☑️ Ad-Free
9th August 2019, 07:14 PM |#8  
kristiansja's Avatar
Member
Thanks Meter: 5
 
More
cant you use this to flash GSI images and then use magisk? or does that not bypass the boot image problem?
9th August 2019, 10:38 PM |#9  
BK☑️'s Avatar
Member
Flag 🌉🌁🏙🌄🏙🌃🌇⛺🌆🏙🌅🌃🌉🏙⛺
Thanks Meter: 39
 
More
MTP
Quote:
Originally Posted by Grarak

FAQ

  • When TWRP can't work with Magisk, then what's the point of this?
    TWRP can work with Magisk, if the firmware you have is compatible. (Read first post).
    But yes, right now there are no reasons to have TWRP installed, but you have to start development somewhere and having a working custom recovery is a pretty good first step.

MTP doesnt work in this build
edit: it work in this build thanks
---------- Post added at 09:38 PM ---------- Previous post was at 09:30 PM ----------

Quote:
Originally Posted by kristiansja

cant you use this to flash GSI images and then use magisk? or does that not bypass the boot image problem?

i dont think this build is made for treble roms, so probably not
9th August 2019, 10:47 PM |#10  
Grarak's Avatar
OP Recognized Developer
Flag Vienna
Thanks Meter: 10,312
 
Donate to Me
More
Quote:
Originally Posted by BK

MTP doesnt work in this build

Uploaded the wrong version. Fixed
The Following 3 Users Say Thank You to Grarak For This Useful Post: [ View ]
9th August 2019, 10:57 PM |#11  
BK☑️'s Avatar
Member
Flag 🌉🌁🏙🌄🏙🌃🌇⛺🌆🏙🌅🌃🌉🏙⛺
Thanks Meter: 39
 
More
Quote:
Originally Posted by Grarak

Uploaded the wrong version. Fixed

lemme check

---------- Post added at 09:57 PM ---------- Previous post was at 09:52 PM ----------

Quote:
Originally Posted by BK

lemme check

edit : it work now thanks!
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes