yashsingh1/xdaforums huggingface dataset:
[Magisk] zgfg:
@pndwal , @sydney73

I use Viper4AndroidFX 2.7.1.2, the latest available module from Repo, and with simply adding SEPolicy rules to the script, everything works perfect on ny A11 (Status Normal, Processing Yes when playing) without the need for SEKinux Permissive mode.

Only the Legacy mode for Driver must be enabled

The same solution has been posted elswhere (incl. the main V4A FX thread on XDA by some user - IDK was that the origin), here is one my post from another thread with the how-to:

PS: The same was also discussed in this Magisk thread few months ago, actually there was another user who mentioned that solution here and brought me attention (unfortunately, cannot find his post now)
[Magisk] pndwal:
mmm. But it works out-of-the-box for me after setting Legacy mode, disabling then re-enabling module (2 reboots) as described... 🤔

Seems everyone needs Legacy mode though, but also seems to me no SELinux policy change is needed to reset the driver for this mode...

Has anyone else here tried resetting / fixing just by turning module off, then on again? ... Perhaps I'm missing something. PW
[Magisk] zgfg:
This way with SEPolicy rules in the script has advantage for me when updating my Xiaomi.eu weekly ROMs:

- Without, I had to go through the procedure with disabling, re-enabling V4A, maybe also AML (it was described in my post I mentioned), then reconfiguring again V4A app (its settings)

- However, upon I added SEPolicy rules section to the script, I can simply install the zip with new ROM, flash its boot.img (prepared in advance) patched by Magisk (flashing one after another in TWRP) , then I reboot and everything (incl. Viper4Android) works out of the box
[Magisk] 73sydney:
Theres not even legacy mode as an option for the version im using ...theres a compatibiliy mode switch, but thats it

Reason i and a lot of others use the Ichigo Viper zip is because its been the only one to work on A11 for us

Im not up to speed on all things Viper, as ive said before (and perhaps you dont understand my function here, lol) i just tend to repackage other peoples shizz to make it easier to use. Im all ears if theres better ways to do stuff
[Magisk] 73sydney:
Hehe, theres a better explanation of the sepolicy stuff :)
[Magisk] zgfg:
Since I have also A11, you can try that nethod with V4A 2.7.1.2 instead of your older 2.7.1.6

SEPolicy rules I mention do not include SELinux Permissive, just:

allow audioserver audioserver_tmpfs file { read write execute }

allow audioserver system_file file { execmod }

allow mediaserver mediaserver_tmpfs file { read write execute }

allow mediaserver system_file file { execmod }

allow audioserver unlabeled file { read write execute open getattr }

allow hal_audio_default hal_audio_default process { execmem }

allow hal_audio_default hal_audio_default_tmpfs file { execute }

allow hal_audio_default audio_data_file dir { search }

allow app app_data_file file { execute_no_trans }

allow mtk_hal_audio mtk_hal_audio_tmpfs file { execute }

The point (follow-up to my previous post) is that sepolicy.rule file seems to be executed only when module was installed (and therefore overrulled to default when I later update the ROM)

Whereas the same SEPolicy rules commands put to post-fs-data.sh script are executed on each reboot (if Magisk is installed and V4A module enabled) - hence the V4A works again out-of-the-box even upon updating the ROM
[Magisk] J.Michael:
sow -- female pig that has reproduced?

sow -- plant seeds?
[Magisk] zgfg:
Maybe (translation) what we called 'rapid fire' (day after day updates).

But then I don't understand where was the 'sow' problem with 29 🤓
[Magisk] pndwal:
Yup, I'm getting that adding script can save reboots (X2) needed to reset driver on initial installation. 😜 ...

However I had wondered if SELinux changes were actually a necessity on some devices. It seems simple reboots / reset will still do the trick for the less time-conscious users, at least on latest 2.7.2.1 (Magisk repo).

I think @zgfg has 2.7.2.1 working on Android MIUI.

Also, I just installed it on my Mi Pad 4, LOS 18.1 (ie. Android 11, Alpha Magisk), and was surprised to find it needed only mandatory reboot after module Installation to work! 😛

I did this: installed Viper4Android FX from Magisk repo but instead of reboot immediately, opened Viper4Android FX App (it's already installed), let it install missing Neon driver then reboot, open Viper4Android FX, check driver status; it's Abnormal, select Legacy mode in settings, check driver status again and it's Normal / working! (No reset needed.)

Not sure if it's Android 11, AOSP standard ROM or other that allows swapping to Legacy mode to work immediately, but my RN8T on stock MIUI, Android 10 & Alpha Magisk needs driver reset incl. reboots to work. PW
[Magisk] 73sydney:
Well now im confused, because the module im working on had as one of its "clean up" goals to remove the duplication of sepolicy.rule AND post-fs-data.sh

Adding to the mix is Johns last changelog for Magisk 23 including:

[General] Several sepolicy.rule copy/installation fixes

I would assume by that it was fucntioning properly to apply any sepolicy.rule files in a modules folder...but maybe not?

So i guess Ichigo was hedging his bets with having both (sepolicy.rule & post-fs-data.sh), but maybe that was trying to account for different magisk versions. Think its safe to say choosing one way would be best going forwards as most should be on 23 at least by now, one would hope. So we think post-fs-data is preferable, from the sound of it...

fwiw, riru-momohider does the same thing - doubles down with sepolicy.rule & post-fs-data....

Maybe i need to reevaluate messing with viper :)
[Magisk] 73sydney:
Imma try your method, but last time i tried with the repo version, it did not end well :)

edit:

wont even download the apk lol

Log: line 214: curl not found :)

time for Zacks Cross Compiled Binaries it seems

...still think my ways quicker...jesus....

So, yeah that didnt go so well either - my device couldnt be more connected to the internet btw

So yeah, the repo way is looking super efficent :)

+ echo '- Testing internet connection'

- Testing internet connection

+ /data/adb/modules_update/ccbins/curl -Ls --connect-timeout 3 -I https://www.google.com

/data/user/0/ym.uovnvdolycep/cache/flash/update-binary: /data/adb/modules_update/ccbins/customize.sh: line 4: /data/adb/modules_update/ccbins/curl: not found

+ /data/adb/modules_update/ccbins/busybox- grep -q 'HTTP/.* 200'

/data/user/0/ym.uovnvdolycep/cache/flash/update-binary: /data/adb/modules_update/ccbins/customize.sh: line 4: /data/adb/modules_update/ccbins/busybox-: not found

+ /data/adb/modules_update/ccbins/busybox- ping -q -c 1 -W 1 google.com

+ /data/adb/modules_update/ccbins/busybox- grep -q 'HTTP/.* 200'

/data/user/0/ym.uovnvdolycep/cache/flash/update-binary: /data/adb/modules_update/ccbins/customize.sh: line 4: /data/adb/modules_update/ccbins/busybox-: not found

+ /data/adb/modules_update/ccbins/curl -Ls --connect-timeout 3 -I https://www.baidu.com

/data/user/0/ym.uovnvdolycep/cache/flash/update-binary: /data/adb/modules_update/ccbins/customize.sh: line 4: /data/adb/modules_update/ccbins/curl: not found

+ /data/adb/modules_update/ccbins/busybox- ping -q -c 1 -W 1 baidu.com

+ return 1

Nope, theres currently no way my device can download the apk through the repo module

I mean i can download any other module i like and have it work, just not that one....

I can download the file from the same path in the browser (path from install script): https://zackptg5.com/downloads/v4afx.apk/v4afx.apk

Saving so much time folks :)

update:

So installed the apk

Opened

Installed driver

Rebooted

Nope...Abnormal

Enabled Legacy...working

Same driver version btw

And then it hit me that the reason i hated the new viper gui was it changed the older easier to use presets, because of course they changed everything to make it harder to use your years old presets and to (try) monetize DDC profiles etc...monetize what was once free...and put analytics in there. Pox on that.

Will be reverting to the Ichigo one thanks
[Magisk] zgfg:
According to my post I quoted, I started with that procedure at the times of Magisk 21.6 (?)

It was a game changer for me at that point (simple weekly ROM updates)

If processing of SEPolicy rules changed with v23, I didn't care - I continued with the same simple ROM update procedures and did not play with the V4A sh script anymore

Anyway, I still don't understand why do you insist on the older V4A 2.7.1.6 (time ago I thought that going to an older V4A version would void the need for Legacy mode, but apparently you still need the Legacy driver mode)
[Magisk] pndwal:
Seriously guys and gals, the issue is self evident:

What with so many Alpha sprouts sown (or propagated) from one Magic branch, we need to fork the ground or the sows will mistake the root for breakfast and the problem is xposed. What's more, the solution is burried in the code!

But we have help to decipher it! "Indeed, the sow turned"... Yes! "Sudden sowization"! ...

To crush this a little, the inference has got to be that a sow could easily uproot the problem and reproduce it!... With 29. other. sows... And pigs might fly! ... just like Canaries?!

It's so obvious! "Magisk alpha discussion group:

The above is the problem", even if the problem is above me! 🤪

Really hope nothing is lost in translation. 😜
[Magisk] 73sydney:
Its exactly the same driver....just the gui is different, and no legacy toggle in the old one...and all my presets work, and i dont have to spend 20 minutes trying to get it to download or work :) and no default optedin analytics

Whats not to love?
[Magisk] oldfone:
I'm running LOS 17.1 on a Moto E 2015 (surnia) and have installed Magisk Manager 23.0. I have extracted boot.img from the LOS install zip file and patched this with MM. I the copied the patched boot.img via adb to my laptop and flashed with fastboot. I got no errors, but Magisk insn't installed. Any ideas what I might be doing wrong?
[Magisk] 73sydney:
did you use

fastboot boot <magisk patched image>

Or

fastboot flash boot <magisk patched image>

hint: the second one is correct
[Magisk] oldfone:
I did the second, so I must be doing something else wrong
[Magisk] Tianhe:
Maybe not the answer you are looking for but if you have TWRP available for your device than you can simply boot TWRP for installing Magisk ?
[Magisk] mixlex:
I always do the first one first just to see if everything is okay with the patched boot image. It will boot up and you can check in magisk manager to see if rooted. Only lasts until next reboot. If everything okay go ahead and fastboot flash boot patched boot image.
[Magisk] pndwal:
If you had Manager / App before current 23.0, you likely didn't un-hide (restore) it before updating App, and now have old app conflicting; best to locate in device settings, Manage apps.

Unless you have other issues, simply locating and removing hidden Manager (whatever you named it, 'Settings' etc) as well as new App, then reinstalling new app should fix issues.

Otherwise, you may have this / similar issue:

https://github.com/topjohnwu/Magisk/issues/4319 PW
[Magisk] FredMontteiro:
Hi guys, I'm using Translator because my English is average.

On the Magisk splash screen, under PACKAGE is described: com.topjohnwu.magisk.

But when you first tap "Check SafetyNet" a question arises asking if I allow download an extension.

After allowing, the description in Package changed, now it's not com.topjohnwu.magisk.

Is this normal, is it safe?
[Magisk] pndwal:
Well I don't think checking SafetyNet or downloading SN API changed it; that's just the proprietary (read not licenced for distribution with FOSS open source code) Google API you download seperately as your phone itself (not Magisk) is licensed for this w/ Google certification...

But did you also select Hide the Magisk app in settings? After that, package name is randomised. 😉 👍 PW
[Magisk] oldfone:
Good catch - I did indeed have another, hidden version of the app. Uninstalling both and then reinstalling did the trick. I had lost root after the last LOS update and then just stupidly thought I need to reinstall the app. Thanks for the rapid help!
[Magisk] oldfone:
I've done that in the past, but isn't that method now deprecated?
[Magisk] Tianhe:
Yes it is not the recommended method now but still works on many devices. I used it on Samsung One UI 3.1 (Android 11) recently and it worked.
[Magisk] zgfg:
If it worked before, it will still work on the same device with the same firmware and TWRP
[Magisk] Tianhe:
Works with upgraded firmware and updated TWRP too in most of the cases (as it did in mine) but I get your point.
[Magisk] Mistercraft38:
Hey, I Wanted to know if there is a way to get the Magisk tools (I'm mainly searching for magiskboot) on desktop. And also if there is precompiled binaries available somewhere

EDIT: I found out. If anyone else end in the same situation as me, just follow the steps for building Magisk on github. Once NDK configured, just type `./build.py binary magiskboot` and you'll find x86 and x86_64 executable in native/out folder
[Magisk] FredMontteiro:
Oh yes! I hid the magisk. The app has been renamed. That's it. Thank you very much! In this case I believe I have no security problem.
[Magisk] AidanWoolley:
I'm attempting to install magisk on a oneplus 5T with lineageOS 18.1 and openGApps pico. I think I've followed the instructions correctly: I installed lineageOS and openGApps and everything was working, and then I extracted the boot.img from the lineageOS zip, patched it and flashed it. This broke the installed GApps (none of the could find google play services) and I had to reinstall lineageOS and the GApps. Is this is a known issue? Did I follow the instructions wrong? Help much appreciated.
[Magisk] zgfg:
If the GApps install to Boot, then they were no more in your boot.img you extracted from the OS zip

If you had TWRP, you could have backed-up your Boot partition (with the GApps already installed) and then patch that boot.emmc.win (TWRP back-up) instead of the extracted boot.img (with no GApps)
[Magisk] pndwal:
🤔 I'm confused here; does GApps ever install to boot partition? ... Or do you mean Play Services (only) can install there? ...

My understanding is that GApps is (always?) in /system w/ parts in /data !? 🙃 PW
[Magisk] pndwal:
I'd say it's unusual.

Assuming you are 100% sure you patched / flashed boot image from exact LOS build you are currently using (which failure often affects/breaks network/data access, incl. Play services access) ie. you didn't muddle image files on PC etc, I have the following questions:

Did you notice issue with initial Magisk installation w/ MagiskHide disabled? (could give clues 😉)

Also, just in case, you didn't manually add any Google App processes to MagiskHide list (especially in Google Play services) did you?

Did you have data/internet access?

Did you try clearing data for Google Play services?

But seems all went well after you reinstalled. Do you now have Magisk / root?

If so, what did you do differently? (Changed flash order? Clean install? No reboots between flashes? Other?) PW
[Magisk] ipdev:
Could have just been a bad install/update.

The core of GApps needs to be compatible versions.

If one is out of sync with the other(s) you will have issues.

What version (and dates) of GApps and Lineage are you using?

My dumpling is running l18 (personal build), OpenGApps (personal build, need to check the date) and Magisk (canary).​

Backup what you want to save and store it off device.

Copy it to your computer, cloud storage, USB, ...

Try again with a complete clean flash.

Instead of flashing the magisk patched image, test by just booting it.

fastboot boot magisk_patched-VersionNumber_SomeThing.img

If Magisk is active, you can use the Direct Install option in Magisk.

or reboot back into bootloader and flash the patched boot image.

Cheers. :cowboy:
[Magisk] ipdev:
No GApps package that I know of modifies the boot image.

At least not currently (SDK30). ;)

A GApps install places the necessary files into the read-only partitions.

system, system/app, system/etc, priv-app, .....

User configuration and GApps updates are in /data

Not a great example but, I made a Magisk Module a while back (for testing).

I was testing something for MagiskHidePropsConfig at the time.

Could not remount the AOSP GSI as Read-Write in TWRP so..

Magisk overlay to the rescue. ;)

Hope it helps explain what a GApps install normally does.​

mModule_sGapps - GitHub - Link

Cheers. :cowboy:
[Magisk] pndwal:
Yes, thanks, for making it clear.

Further, I am aware that a number of systemless GApps packages exist. I didn't mention these as they were not applicable to the member's issue.

Users should be aware that there may be unexpected issues using such a systemless GApps package however.

For example Magisk Hide means Magisk unmounts modules to hide them, so, if I understand it correctly, when, say, Google Play services is called (opened), the GApps module itself will simultaneously be unmounted and the 'app' crashes. PW
[Magisk] zgfg:
I don't know how it goes when manually installing GApps. But according to his description, he lost his previously installed GApps when he returned to the original boot.img (patched by Magisk). And then he was again able to install GApps

He could test something else. Install GApps and then flash his extracted boot img (not patched by Magisk), to make sure it was really not about Magisk but about replacing boot.img upon the installation of GApps
[Magisk] pndwal:
Well, broke access to Google Play services anyway

Well, apparently after he first patched / flashed

Well, after he reinstalled OS

Sure.

The statements I found confusing (actually, I just think they're incorrect) however, were:

🤔 GApps don't install to boot... ever... So they wouldn't be in boot whether installed, extracted, stock, patched, backed up or other! 😬

And this:

🤔 Except that there would be no difference! ... Boot doesn't change at all after flashing GApps. Neither have it.

TWRP backup boot.emmc.win file is an alternative to downloading / extracting boot image from a ROM for those with compatible TWRP, but resulting image should be identical!

Nb. A Magisk zip will alter the partition and subsequent backup, but GApps zip won't! They're two very different beasts. 😉

GApps work fine with stock kernel, ramdisk etc so don't require any changes, and a GApps package is just a means of distributing often stock-standard Google Apps for legal and practical reasons.

Magisk on the other hand requires code injected into a ramdisk to boot with SU privileges, so necessarily alters a boot image, whether boot or recovery.

Sorry! 🙃 PW
[Magisk] zgfg:
Still, if installed Gapps didn't need/affect Boot, there is no explanation why after replacing the boot img with original one + Magisk, he lost GApps and needed to install GApps again
[Magisk] pndwal:
Installing GApps doesn't need/affect boot.

As noted above, those are your words. 😬

He (or she?) never said any GApps were lost, only "This broke the installed GApps (none of the[m] could find google play services)"

And I hinted at a few possibilities re. why access to Google Play services might not work here:

https://xdaforums.com/t/magisk-general-support-discussion.3432382/post-85406199

You well know Magisk can affect Play Services, especially if MagiskHide is on / extra processes hidden.

May be other errors made too. Muddled / mismatched boot image is a regular culprit in wifi / network data Issues for instance.

Could be a number of possibilities/ explanations at this stage - just not GApps install itself affecting boot partition. 😉

Maybe he needed to, maybe he didn't... Impossible to tell yet. PW
[Magisk] bonedriven:
Hello, the context is this:

A Pixel 2 phone that had LOS 17 running with magisk rooted.

Successfully upgraded to latest LOS 18.1 and everything runs well except that I lost root, with only the Magisk app still installed on the phone (as expected).

Followed the "patch image method" from Magisk guide:

) Extract boot.img from google factory downloads, as magisk app showed I have ramdisk.

) Patch the file to get a magisk-patch-*.img

) Do the "fastboot flash magisk-patch-*.img

reboot and get boot loop

For now I followed the manual upgrade guide again from LOS upgrade instruction and the phone can work again, but it's like before as there's no root.
[Magisk] pndwal:
You need to patch boot image matching your current ROM!... I don't think Google supplies images for custom LineageOS! 😉

Extract boot.img from current LOS package, or take TWRP backup incl. boot partition, locate and patch that (either as .win or renamed to .img file).

👍 PW.
[Magisk] bonedriven:
OK. Now I am going to study the new knowledge of android phone about "how to extract .img from a payload". Using android phone is great, it teaches you android knowledge that becomes useless every few months.
[Magisk] 73sydney:
Actually that knowledge gets used often as has been around for more than 6 months, and will be around 6 months from now :)

And to help you, in my sig (and here) is an easy (if youre running windows x64) tool to extract the boot image from payload.bin (inside the ROM zip).

1) download payload_dumper-win64.zip and extract

2) extract payload.bin from ROM and put in payload_dumper-win64\payload_input folder

3) run payload_dumper.exe

4) monitor payload_output folder - once theres more than boot.img in there, you can kill the process if yuo liek to avoid extracting all the images

5) copy boot.img file to device

6) patch with magisk

7) move magisk_patched.img back to PC

8) flash with fastboot flash boot <magisk_patched.img>

9) reboot with fastboot reboot

Holler if you are not using windows, theres a tool for every OS...

Some ROM devs will include a boot.img file separately (like ABC ROM), some wont. But now you have the knowledge, and a tool for those
[Magisk] zgfg:
It depends on vendors. Usually OTA or ROMs can be downloaded as zip files, just open and find the boot.img inside. Nothing new and no rocket science here. If you use a good file explorer like MiXPlorer, you can manipulate zip archives directly on the phone

Regarding your 'every few months' - I personally use the method of extracting and patching the img since 2018 (on various phones) and it didn't become "useless knowkedge".

Although all but one of my phones I played with Magisk on them did have proper TWRP, I liked that method more than flashing the Magisk zip through TWRP, but don't plan now to repeat the reason since that has also been discussed many times in this thread

Btw, the method has been also described all the time in the Magisk documentation - not just for the last six months or so.

Find an old Magisk Manager v16 or something, install and you will see that Select and Patch the image file has been present already in the prehistoric times
[Magisk] justDave:
If you downloaded Lineage from the official site, the boot image for each build is available for download. Just use that - no need to extract.

I suspect that your problem is an incompatible module. Try booting up in safe mode, which will disable all your modules. Get root working and then try reenabling your modules one by one (or binary search).
[Magisk] nostraslo:
I just upgraded my Samsung Galaxy Note 10 from Android 10 to Android 11. After that, I have a problem with Magisk. The Magisk is not installed anymore.

At Android 10 I had to boot with keys combination (power + volume up). This combination does not work anymore.

What did I miss ? Help, please.
[Magisk] pndwal:
Assuming you have installed Android to recovery again you will actually still have root, but will need to boot via recovery as before.

You need recovery key combo and updated method.

Key combo is likely Power + Bixby + Volume Up or similar, but update to One UI 3.0 additionally requires user to plug in a USB-C data cable connected to PC, or USB-C earphones. 😉

Be sure to release keys immediately on vibration / splash screen as before.

Many articles on this change, eg

https://www.androidsage.com/2020/12...ode-on-samsungs-one-ui-3-0-android-11-update/

🤠 PW