Encryption and Magisk

Hello everyone.

Please tell me how to correctly use encryption after installing all F-droid applications?

  1. I need to install all F-droid applications, then encrypt the device and install Magisk

  2. I need to install all F-droid applications + install Magisk and then encrypt?

I would appreciate your advice.

1 Like

I’d go with, encrypt → f-droid → magisk (because you install magisk from F-Droid, right?)

1 Like

Thank you for your answer.

Do I understand you correctly that you mean that first I encrypt my phone, then install all my favorite applications from F-droid and lastly install Magisk? I’m clarifying to be sure)

I download Magisk for my phone here GitHub - topjohnwu/Magisk: The Magic Mask for Android but I see that the link to the source code from F-droid leads to the same place, I assume that it is the same thing.

yes, as to have the least data needed to encrypt

I hope it’s the same thing, but there’s a reason you use F-Droid instead of downloading APKs from sites, right?

1 Like

It’s this message that makes people download magisk from github and not F-Droid.

However unlike magisk people prefer to download termux from F-Droid rather than github.

is F-Droid an Unknown Source for you? :slight_smile:

1 Like

Thanks for your answers.

I didn’t even know that F-droid has Magisk )) Magisk | F-Droid - Free and Open Source Android App Repository and UpgradeAll | F-Droid - Free and Open Source Android App Repository Thanks for letting me know!

I usually download the app from the developer’s website, imagine if I downloaded F-droid from the Play Market website and they wrote to me, and you don’t know what Play Market is?))

Perhaps your build is more reliable, I’ll try (test) If there are any other differences, please write for information.

The F-Droid build doesn’t have bootctl so it can’t switch slot for you. But it’s not important for me.

Why not including bootctl ?

I can’t build it.

What issues did you face building it ?

It’s part of AOSP. I don’t know how to build it cleanly.

I attempted to do it by getting the needed sources for bootctl but I can’t find <aidl/android/hardware/boot/IBootControl.h> nor
<aidl/android/hardware/boot/MergeStatus.h>

I found bootctl.cpp here bootctl - platform/system/extras - Git at Google

Here is my progress with sources
bootctl.zip (15.0 KB)

and this is the command I use for compilation

 ~/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=aarch64-none-linux-android21 --sysroot=${HOME}/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -fno-limit-debug-info  -fPIC -MD  bootctl.cpp -o bootctl  

The command assumes you have ndk 25.1.8937393 installed.
Note that the previous command builds the debug variant.

Are those headers required?

Hi . I tried your recommendation but it didn’t work…

Also I wanted to ask you what is the difference between:

  1. encrypt → f-droid apk → magisk

  2. encrypt + f-droid apk → magisk

Explanation of the photo. I encrypted the phone, then I wanted to install Magisk and got this message

your recovery must be able to support encryption… do try to find out if it can or use one that can

MergeStatus.h is included in BootControlClient.h and IBootControl.h is included in BootControlClient.cpp

What I could find is this boot/aidl/android/hardware/boot - platform/hardware/interfaces - Git at Google

They are .aidl files and not .h files
I have no idea but I guess they’re transformed into .h files during build.

Magisk doesn’t support flashing from recovery anymore. You should use the patched boot.img instead.

Interesting. I’ll have a try for the next update. Thanks!

Hi. Thanks for your reply.

I followed @Licaon_Kter advice and encrypted my phone to install Magisk later.

After encryption, I rebooted into Recovery and saw this window

I entered the password correctly but got the error “unable to mount storage”