Creating a module to replace an executable in /system/sbin? - Magisk

There is an executable I am trying to replace in /system/sbin natively which appears in /sbin after booting, but doing so in a module doesn't appear to work since the sbin folder gets wiped in the modules directory after rebooting.
The executable appears to be extracted fine which I can see in /data/adb/modules_update/{mod}/system/sbin before rebooting, but after rebooting, the /data/adb/modules/{mod}/system folder is just empty.
I am looking at the module guide which also talks about overlay.d, but creating a overlay.d folder in the module folder doesn't appear to do anything (although the file does not get wiped unlike putting it in system).
Is this a bug or is there a different way of doing this? I am currently on Magisk 20.1.
Thanks!

I just realized that the overlay.d folder is inside the ramdisk of the boot image, rather than the module folder... I guess I will play around with it further and see how it goes...

It could also be a good idea to upload your module, module install log and the Magisk log from the reboot after installing.

Related

[Help] Creating Module for vendor partition changes

Hello Fellow Users,
Let me start with the fact that I have zero experience of making flash modules (TWRP/Magisk) and am just dabbling around.
Some background, I found a TWRP flash zip file which makes changes to vendor partition of Redmi Note 7 Pro (violet) running MIUI OS (Android Q) - this is a sound mod.
Now, with TWRP file the issue is that if it doesn't work or has any issues, we need to dirty flash ROM all times (or atleast dirty flash the vendor partition). There is no one-click remove option.
Hence I thought why can't the same be done via Magisk systemless and dabbled around a bit. Below is my experience of the last 2 days.
Now, coming to the original TWRP file - it copies/replaces three folders with included files to vendor partition. Path of folders is following
Code:
/vendor/etc
/vendor/lib/soundfx
/vendor/lib64/soundfx
These 3 folders and similarly named files within them already exist by default in the phone prior to flashing.
Now basis the Magisk guides I saw around and wiki from @Zackptg5 I did the following changes to the default template:
1) Edited customize.sh to define folders to be replaced
Code:
REPLACE="
/vendor/etc
/vendor/lib/soundfx
/vendor/lib64/soundfx"
2) Since Magisk will always look for the vendor under the system folder and so I moved the vendor folder under system folder
Basis same, created attached module and flashed and it installed.
But then three queries in my mind:
1) Are the new files actually replaced systemless and in-use? My concerns as don't see any intended change in sound
2) Is there a way to check if new files are being used o available to system?
3) Is this method of putting replace under customize.sh file the way out? While studying some similar modules making changes to vendor partition, I found that they have default (no change) customize.sh but rather make changes to common/post-fs-data.sh etc
So, looking forward to feedback from users experienced in making Magisk module. Thanks in advance for your time and efforts!
PS: attached is the WIP module which I wrote and also got installed in Magisk Manager
TLDR: How to make a Magisk Module using TWRP files to ensure systemless modification of folder/files in the vendor partition
1 - The REPLACE variable is used to replace the directories you specify with empty folders, not with what you want to add systemlessly. You might want to follow the advice written in the customize.sh file and read the documentation (@topjohnwu has everything explained there):
https://topjohnwu.github.io/Magisk/guides.html
Edit: If you do want to first "remove" (systemlessly, of course) everything in those folders, then keep them in the REPLACE variable. I just realised that it's a little unclear if that's what you want to do or not...
2 - That's the correct procedure. If all you want to do is to add or replace some files to your device, the only thing you need is to put those files in the /system directory of your module. That's it. The customize.sh file is used if you want to customise the installation logic of your module (not necessary if you're just adding files to your device) and post-fs-data.sh and service.sh are boot scripts to run code at boot (again not necessary if you're just adding files systemlessly to your device, see the linked docs for details).
Right now your module isn't adding anything, since the directories in the module's system folder are all empty. There's nothing to add. All it does is to replace those directories with empty ones (see #1 above). I'd say that using MMT is way overkill for such a simple module...
One you've installed a module Magisk will mount that modules files over your existing ones at boot. If the file under the real system path matches the one found in the module directory (under /data/adb/modules) everything is working as it should.
@Didgeridoohan Thanks for taking our time to give detailed reply and guidance
Finally was able to successfully install the module (named AudioEngine) and I do see files under /data/adb/modules but I have the following issue:
All these new files are under:
/data/adb/modules/AudioEngine/system/vendor folder and not under
/data/adb/modules/AudioEngine/vendor folder
Is that ok? If yes, why do we see /data/adb/modules/AudioEngine/vendor separately too?
Attached is final module as well as the screenshot of /data/adb/modules/AudioEngine/ as seen in file manager.
The /vendor folder is a symlink to /system/vendor, created by Magisk. That's just how Magisk works...
From your screenshot it looks like things are working as they should.
That uninstall script looks unnecessary though. The module isn't placing or altering anything outside the module folder, so when uninstalled there won't be any leftovers anyway.
im also try to do something similar with some audio libs in vendor partition for poco f2 with miui12 however if i add any libs to go into vendor/lib, for some strange reason, i lose wifi. theres no issues if vendor/lib/soundfx or vendor/lib64 is occupied with files just the lib directory only. the actual files that are going into lib are not replacing anything but are new files

Trying to create a magisk module to edit rootfs

I am attempting to create a magisk module that will "replace" a file in /system/etc. I have created the module and successfully installed it but the changes are not reflected upon booting multiple times. I can 'adb shell cat $MAGISK/system/etc/file.xml' and see the changes have not been made by magisk and I can adb shell cat system/etc/audio_policy_configuration.xml and see the files have not been altered in any way.
I just want to copy a fuggin file to system/etc. I have spent hours trying to research how to copy files to system with magisk modules but they are dead end roads.
I need someone to finally answer the question of how to copy a file using magisks built in module function. I can create and install the module but I am not understanding the process of actually copying the file. I thought anything you put in the system folder in the module template, that it would get used instead of the one in the actual read only system/etc. But I made the directories and file with changes I want, installed it but it doesn't show up in magisk manager and the changes arent made by the module.
Any and all help is appreciated
I've already replied here:
https://forum.xda-developers.com/t/...agisk-module-developers.3846678/post-84749791
But, in your post in that thread (please don't double post) you didn't mention anything about already having created a module.
If you have the module installed already but don't see any changes, provide the Magisk log. But, make sure you're on the latest Magisk Canary release first so that the log is more detailed.
Providing your module could also be a good idea, to see if it's built correctly.

How to properly compress Magisk module .zip

Hello,
I'm trying to create my own Magisk module based on working modules and referencing the module instructions. Before getting too far, I wanted to make sure that the compression process worked correctly.
So, I downloaded a .zip module from the Magisk app (e.g. Wifi5ghzdisabler), moved .zip to my Ubuntu 20.04 PC using Google Drive, extracted the .zip (using Extract Here in Files context menu), compressed the module folder back to a .zip file (using Compress... in Files context menu) and then moved the new .zip back to the phone using Google Drive. No changes to any files were made. Then, I tried to install it from storage in the Magisk app (v23.0) on a OnePlus Nord N100 running Android 10, but I encountered the following error.
Installation Failed!
- Copying zip to temp directory
! Unzip error
Is this a compression issue or a permissions issue on the phone? I'm probably missing something simple. Thanks in advance.
DanHoliday said:
Hello,
I'm trying to create my own Magisk module based on working modules and referencing the module instructions. Before getting too far, I wanted to make sure that the compression process worked correctly.
So, I downloaded a .zip module from the Magisk app (e.g. Wifi5ghzdisabler), moved .zip to my Ubuntu 20.04 PC using Google Drive, extracted the .zip (using Extract Here in Files context menu), compressed the module folder back to a .zip file (using Compress... in Files context menu) and then moved the new .zip back to the phone using Google Drive. No changes to any files were made. Then, I tried to install it from storage in the Magisk app (v23.0) on a OnePlus Nord N100 running Android 10, but I encountered the following error.
Installation Failed!
- Copying zip to temp directory
! Unzip error
Is this a compression issue or a permissions issue on the phone? I'm probably missing something simple. Thanks in advance.
Click to expand...
Click to collapse
You should upload your zip.
Thanks for the reply.
I've attached the original WiFi5GhzDisabler-v1(1).zip module downloaded from inside the Magisk app.
I've also attached WiFi5GhzDisabler-v1(1)-re-compressed.zip after downloading, extracting and re-compressing the original module it as described in my first post. I didn't make any changes to the files/folders themselves. I did notice they are different sizes (6.1KB original versus 8.6KB re-compressed).
I'm trying to learn more about the correct compression process/tool for these modules. I searched the forum and found a thread with a similar issue. Basically, the OP shared a .zip file that didn't work and another member did something and uploaded a "fixed" version with minimal insight into how it was done.
[HELP] This zip is not a Magisk Module
I would assume there isn't anything wrong with the files in the original module since it was probably reviewed before it was hosted in the Magisk app. It is also strange that the .zip file downloaded from the github repos for various modules don't work for me either, but that may be a separate issue.
Any ideas? The instructions do not include how to compress the module.
Take a close look at the original zip again, and compare it to the one you recompressed. You've put all the files in a directory inside the zip, in comparison to putting them directly in the root of the zip...
There's your problem.
Didgeridoohan said:
You've put all the files in a directory inside the zip, in comparison to putting them directly in the root of the zip...
There's your problem.
Click to expand...
Click to collapse
You're exactly right. I was incorrectly zipping the module folder itself rather than the files inside the folder. As you correctly pointed out, this creates a folder inside the zip that adds an extra layer between the files and the root of the zip.
Wow, what a simple mistake. With your help, the recompressed module installs fine now. I was able to install my own module too!
Thank you so much for your help. My issue has been resolved.

Cannot mount file to system

I've created a module to edit /system/vendor/etc/mixer_paths_tavil.xml but it doesn't work, it used to work but since I got the "Audio Modification Library" module installed it won't change that file. I've attacehed the module down below in case if anything's wrong with it that I couldn't see, my phone is LG G7, thanks in advance.
If you have several modules that replaces the same file, only one module will get their file mounted. In your case it sounds like AML takes precedence. I can't quite remember now how that's decided (maybe installation order)...
One solution would be to edit the xml file in AML instead of in your module, but that would get overwritten whenever there's a change/update to AML.
Another way, that remedies the problem if the above solution, is to create a boot script that edits the AML file on each boot. That way you don't have to worry about the AML xml file being altered by a change/update to AML.
Of course, AML was created to help with just this situation. Having several audio mods trying to replace the same file (and failing). You might want to look into the docs for AML on how to utilise that part natively in your module.
There are limits to the systemless mask, so you'll have to be a little creative. As you can see above, there are options...

General [Bounty] Viper4android fix

So I'm not sure if I'm doing this the right way, but I think in an effort to get experienced devs to take a look into our viper4android driver loop issue a bounty is in order.
I have tried every method I could find to get viper4android to work on our OnePlus 10 pro with no success.
Below I'll start a list of pledgers who are willing to pay the bounty when/if a fix is found. I'll add to the list as other pledgers come forward. Any pledge amount helps.
•ecera -$50
•Aldonski - $10
On a side note, I'll be willing to test any fixes that are thrown my way. I'm also ready to provide any files or logs that are requested. Also, if you guys/gals want to tag some members that may be willing to take on this task please do so. Thanks.
@shadowstep @dorimanx @zgfg @vczilla @Juniiim
Hope you guys don't mind me tagging you. From posts I have read of yours, you guys know your stuff. Or maybe you can recommend someone who will be interested in the bounty.
So I'm guessing a little basic info would be helpful. The OnePlus 10 pro is running oos12, the normal post-fs-data.sh fix where vendor/etc and odm/etc "audio_effects.xml" is binded doesn't work(as expected since the file doesn't exist under vendor/etc on this device.) I'll attach a photo where audio_effects.xml can be found on this device. Another thing to note is that the viper4android.zip by @shadowstep actually adds audio_effects.xml &.conf to vendor/etc. But trying to bind this newly created audio_effects.xml to the one in odm/etc doesn't make any changes to the one in odm. I'm also unable to launch the viper4android app using his version, but installing the apk again allows me to open the app. I'm just not sure if that affects anything as far as the functionality of his module. I could though bind the audio_effects.xml located in vendor/etc/audio/sku_cape to the odm/etc one, but driver loop persists. I'm out of ideas I've literally tried every module(aml, jdsp, ainur, acp, v4a from the magisk repo, other versions of v4a zips in different orders/ combinations. Nothing has worked so far.
Aldo - $10
great ideea mate
try this:
remove all sound mods you have added, including the module from magisk and the viper app!
reboot!
Install attached Audio-Modification-Library_v4_0-OS12-op10
reboot!
install com.pittvandewitt.viperfx_2.7.2.1-2721.apk
open the viper app, and click install drivers.
phone auto reboot.
copy attached post-fs-data.sh to /data/adb/modules/ViPER4AndroidFX/ (use adb or rooted file manager)
REBOOT, do not open the app!!!!
now if we hit the FIX, if you will open the app it's should not ask to install drivers.
if it's stop asking, check the state, if it's not NORMAL then tick the Legacy Mode, and check state.
should be Status Normal.
I hope this will work for you.
ecera said:
So I'm guessing a little basic info would be helpful. The OnePlus 10 pro is running oos12, the normal post-fs-data.sh fix where vendor/etc and odm/etc "audio_effects.xml" is binded doesn't work(as expected since the file doesn't exist under vendor/etc on this device.) I'll attach a photo where audio_effects.xml can be found on this device. Another thing to note is that the viper4android.zip by @shadowstep actually adds audio_effects.xml &.conf to vendor/etc. But trying to bind this newly created audio_effects.xml to the one in odm/etc doesn't make any changes to the one in odm. I'm also unable to launch the viper4android app using his version, but installing the apk again allows me to open the app. I'm just not sure if that affects anything as far as the functionality of his module. I could though bind the audio_effects.xml located in vendor/etc/audio/sku_cape to the odm/etc one, but driver loop persists. I'm out of ideas I've literally tried every module(aml, jdsp, ainur, acp, v4a from the magisk repo, other versions of v4a zips in different orders/ combinations. Nothing has worked so far.
Click to expand...
Click to collapse
I could give you suggestions/hints based on how I made it to work on my phone - but it was Xiaomi with stock A11, not your OnePlus 10 with oos12:
https://forum.xda-developers.com/t/...ndroid-10-11-12-devices.4213647/post-86870983
Anyway, before we start, please disable ALL audio moudules (any V4A, AML, etc you may have) and REBOOT
And then please respond/confirm the following:
1) Check, does your system show the same content (one should be mounted to another) for /system/vendor/etc and vendor/etc ?
You can use a root explorer like MiXPlorer or you cah check with ls command in terminal window, and when you boot with the Magisk root.
I.e, do not check from a custom recovery (mounting points must be properly in place when system/Android + Magisk are booted)
2) Check, does your system show the same content (one should be mounted to another) for /system/odm/etc and /odm/etc ?
3) Do you have audio_effects.xml in the following folders (with /vendor = /system/vendor and /odm = /system/odm as mentioned above):
/odm/etc
/vendor/etc/
/vendor/etc/audio/sku_cape
/vendor/etc/audio/sku_diwali
/vendor/etc/audio/sku_taro
4) Do you also have audio_effects.conf in the same folders as listed in 3) - if not, list in which of the folders you do have the conf file
For 1) and 2), we need to be sure if standard montings (as needed for V4A to mount files and work on your system).
For 3) and 4), we need to be sure if you originally (without the intervention from any audio module like the previous installation of V4A or AML, etc)
do have the audio_effects.xml and audio_effects.conf files in all those folders, or in which of them exactly
dorimanx said:
try this:
remove all sound mods you have added, including the module from magisk and the viper app!
reboot!
Install attached Audio-Modification-Library_v4_0-OS12-op10
reboot!
install com.pittvandewitt.viperfx_2.7.2.1-2721.apk
open the viper app, and click install drivers.
phone auto reboot.
copy attached post-fs-data.sh to /data/adb/modules/ViPER4AndroidFX/ (use adb or rooted file manager)
REBOOT, do not open the app!!!!
now if we hit the FIX, if you will open the app it's should not ask to install drivers.
if it's stop asking, check the state, if it's not NORMAL then tick the Legacy Mode, and check state.
should be Status Normal.
I hope this will work for you.
Click to expand...
Click to collapse
Thank you for responding! I'm going to test out your methods first, I will report back.
Edit: so I tried the method you suggested and unfortunately driver loop persists. So what I noticed is that audio_effects.xml in all directories on this phone remain untouched. They remain "stock". Also, under /data/adb/modules/aml or /Viper4Androidfx in the system folder in both directories subfolders were created, but remain empty. Not sure if there's any info you would like to take from the phone that I could get for you? I took a few screenshots, not sure if that'll help. I started clean with no mods and I took these after attempting the fix.
zgfg said:
I could give you suggestions/hints based on how I made it to work on my phone - but it was Xiaomi with stock A11, not your OnePlus 10 with oos12:
https://forum.xda-developers.com/t/...ndroid-10-11-12-devices.4213647/post-86870983
Anyway, before we start, please disable ALL audio moudules (any V4A, AML, etc you may have) and REBOOT
And then please respond/confirm the following:
1) Check, does your system show the same content (one should be mounted to another) for /system/vendor/etc and vendor/etc ?
You can use a root explorer like MiXPlorer or you cah check with ls command in terminal window, and when you boot with the Magisk root.
I.e, do not check from a custom recovery (mounting points must be properly in place when system/Android + Magisk are booted)
2) Check, does your system show the same content (one should be mounted to another) for /system/odm/etc and /odm/etc ?
3) Do you have audio_effects.xml in the following folders (with /vendor = /system/vendor and /odm = /system/odm as mentioned above):
/odm/etc
/vendor/etc/
/vendor/etc/audio/sku_cape
/vendor/etc/audio/sku_diwali
/vendor/etc/audio/sku_taro
4) Do you also have audio_effects.conf in the same folders as listed in 3) - if not, list in which of the folders you do have the conf file
For 1) and 2), we need to be sure if standard montings (as needed for V4A to mount files and work on your system).
For 3) and 4), we need to be sure if you originally (without the intervention from any audio module like the previous installation of V4A or AML, etc)
do have the audio_effects.xml and audio_effects.conf files in all those folders, or in which of them exactly
Click to expand...
Click to collapse
1) Ok, so /system/vendor/etc and /vendor/etc does show the same content. I'd note that audio_effects.xml and .conf are both missing in this directory from an untouched unmodified standpoint though.
2) system/odm/etc is non-existent on this phone. Odm/etc is there though. There is /vendor/odm/etc and shows the same content as odm/etc.
3) audio_effects.xml exists in the following locations.
- /odm/etc
- /vendor/etc/audio/sku_cape
- /vendor/etc/audio/sku_diwali
- /vendor/etc/audio/sku_taro
It is absent in
- /vendor/etc
4) audio_effects.conf exists under
- /vendor/etc/audio/sku_cape
- /vendor/etc/audio/sku_diwali
- /vendor/etc/audio/sku_taro
- /system/etc or /etc
It is absent from
- /odm/etc
- /vendor/etc
Again thanks so much for giving this a shot.
ecera said:
1) Ok, so /system/vendor/etc and /vendor/etc does show the same content. I'd note that audio_effects.xml and .conf are both missing in this directory from an untouched unmodified standpoint though.
2) system/odm/etc is non-existent on this phone. Odm/etc is there though. There is /vendor/odm/etc and shows the same content as odm/etc.
3) audio_effects.xml exists in the following locations.
- /odm/etc
- /vendor/etc/audio/sku_cape
- /vendor/etc/audio/sku_diwali
- /vendor/etc/audio/sku_taro
It is absent in
- /vendor/etc
4) audio_effects.conf exists under
- /vendor/etc/audio/sku_cape
- /vendor/etc/audio/sku_diwali
- /vendor/etc/audio/sku_taro
- /system/etc or /etc
It is absent from
- /odm/etc
- /vendor/etc
Again thanks so much for giving this a shot.
Click to expand...
Click to collapse
Ok, thanks
Then shortly based on 1) and 2):
/odm/etc
/vendor/odm/etc
/system/vendor/odm/etc
are all pointing to the same?
ecera said:
1) Ok, so /system/vendor/etc and /vendor/etc does show the same content. I'd note that audio_effects.xml and .conf are both missing in this directory from an untouched unmodified standpoint though.
2) system/odm/etc is non-existent on this phone. Odm/etc is there though. There is /vendor/odm/etc and shows the same content as odm/etc.
3) audio_effects.xml exists in the following locations.
- /odm/etc
- /vendor/etc/audio/sku_cape
- /vendor/etc/audio/sku_diwali
- /vendor/etc/audio/sku_taro
It is absent in
- /vendor/etc
4) audio_effects.conf exists under
- /vendor/etc/audio/sku_cape
- /vendor/etc/audio/sku_diwali
- /vendor/etc/audio/sku_taro
- /system/etc or /etc
It is absent from
- /odm/etc
- /vendor/etc
Again thanks so much for giving this a shot.
Click to expand...
Click to collapse
Following up, please have again all audio modules uninstlled, reboot and then follow:
- Install the official V4A FX module
- Reboot
- Run V4A app, it will complain that there is no driver installed and it will attempt to install
REBOOT but THEN DO NOT RUN V4A app yet!
1) Instead:
- go to /data/adb/modules/ViPER4AndroidFX/system/vendor
- there must be a subfolder etc with audio_effects.xml and audio_effects.conf
- check are those xml and conf files 'patched' by V4A as on my attached screenshots (they should be)?
2) Create the following system of folders:
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc (that one must have been existed)
/data/adb/modules/ViPER4AndroidFX/system/vendor/odm/etc
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc/audio/sku_cape
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc/audio/sku_diwali
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc/audio/sku_taro
Copy that patched audio_effects.xml from:
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc
to the newly created folders:
/data/adb/modules/ViPER4AndroidFX/system/vendor/odm/etc
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc/audio/sku_cape
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc/audio/sku_diwali
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc/audio/sku_taro
Copy also that patched audio_effects.conf from:
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc
for the beginning only to:
/data/adb/modules/ViPER4AndroidFX/system/vendor/odm/etc
Copy also the attached post-fs-data.sh to /data/adb/modules/ViPER4AndroidFX
3) Then reboot, again DO NOT RUN V4A app but first check:
- do you still have the created folders and files from (1) and (2) in /data/adb/modules/ViPER4AndroidFX/system/vendor/...
Also, now in the 'real' folders, starting from root / (no more in /data/adb/modules...):
/vendor/etc
/vendor/odm/etc
/vendor/etc/audio/sku_cape
/vendor/etc/audio/sku_diwali
/vendor/etc/audio/sku_taro
- check if every of them now contains your patched audio_effects.xml from (1).
- and check if the first two contain the patched audio_effects.conf also from (1).
(they are actually not copied there but Magisk must have mounted them from /data/adb/modules/ViPER4AndroidFX/system/vendor/...)
Pls check and confirm.
Then open V4a app and if it does no more complain, switch to Legacy mode and enjoy
4) If V4a app does not pass yet but still complains that driver is missing, it will delete everything that you did in (2).
Hence reboot, redo step (2) again but this time copy both the patched audio_effects.xml and audio_effects.conf from:
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc
to all those folders:
/data/adb/modules/ViPER4AndroidFX/system/vendor/odm/etc
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc/audio/sku_cape
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc/audio/sku_diwali
Reboot, again do not run yet V4A app but check if all the 'real' folders (starting from root /) contain the patched audio_effects.xml and audio_effects.conf:
/vendor/etc
/vendor/odm/etc
/vendor/etc/audio/sku_cape
/vendor/etc/audio/sku_diwali
/vendor/etc/audio/sku_taro
Pls check/confirm.
Now try again V4A app (with Legacy mode)...
Not sure would V4A app now really work but that was based on what you previously confirmed about your folders, trying to adapt how V4A mounts the patched xml and conf files to your case
zgfg said:
Ok, thanks
Then shortly based on 1) and 2):
/odm/etc
/vendor/odm/etc
/system/vendor/odm/etc
are all pointing to the same?
Click to expand...
Click to collapse
Yes, sorry had to drop the kiddo off at school. But, yeah they all point to the same.
ecera said:
Yes, sorry had to drop the kiddo off at school. But, yeah they all point to the same.
Click to expand...
Click to collapse
Ok, try the follow up, my subsequent post above. Let's see the results
@zgfg I installed the official viper magisk module, rebooted, opened the app, allowed the driver to install, rebooted, didn't open the viper app, went to /data/adb/modules/Viper4AndroidFX/system/vendor, it's empty. Besides a lib folder.
@zgfg something interesting though, I copied audio_effects.xml and .conf from /vendor/etc/audio/sku_cape and created a folder named "etc" in /data/adb/modules/Viper4AndroidFX/system/vendor and copied them there. Now, in /vendor/etc both audio_effects.xml & .conf exist. They aren't "patched" though.
ecera said:
@zgfg something interesting though, I copied audio_effects.xml and .conf from /vendor/etc/audio/sku_cape and created a folder named "etc" in /data/adb/modules/Viper4AndroidFX/system/vendor and copied them there. Now, in /vendor/etc both audio_effects.xml & .conf exist. They aren't "patched" though.
Click to expand...
Click to collapse
Yes, of course, that's the way how mounting works (and how all modules, including V4A utilize that)
Everything that Magisk finds in
/data/adb/modules/<some module folder>/system/<subfolders>/<file>
will be mounted to
system/<subfolders>/<file>
Eg, if you use Systemless hosts and AdAway in the root mode, then AdAway writes to:
/data/adb/modules/hosts/system/etc/hosts
and Magisk mounts that (upon reboot) to:
/system/etc/hosts
---
You could try to run V4A app now with your 'fake' XML and conf files in /vendor/etc (although I'm not sure how would VA app react when it already finds the XML and conf file in /data/adb/modules/Viper4AndroidFX/system/vendor/etc - the same place where it must write its own patched files with the same names)
to check would it then find the (mounted) XML and conf file from /vendor/etc
and would it create the corresponding patched files in its /data/adb/... folder
If it does, then you could continue with my previous post
@zgfg so following your instructions everything is working as far as binding all the locations. The only one that is not sticking is /data/adb/modules/ViPER4AndroidFX/system/vendor/odm/etc. I'm able to copy the patched audio_effects.xml and .conf in there, but they aren't reflecting in the "real" folder (/system/vendor/odm/etc/ or odm/etc.
ecera said:
@zgfg so following your instructions everything is working as far as binding all the locations. The only one that is not sticking is /data/adb/modules/ViPER4AndroidFX/system/vendor/odm/etc. I'm able to copy the patched audio_effects.xml and .conf in there, but they aren't reflecting in the "real" folder (/system/vendor/odm/etc/ or odm/etc.
Click to expand...
Click to collapse
Ok, then copy the attached post-fs-data.sh to /data/adb/modules/ViPER4AndroidFX
(Instead of the previously given sh file)
In the sh script you will see two mount -o bind commands, one for XML and the other for conf, like:
mount -o bind /data/adb/modules/ViPER4AndroidFX/system/vendor/etc/audio_effects.xml /system/vendor/odm/etc/audio_effects.xml
Their purpose is to manually mount from:
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc
to:
/system/vendor/odm/etc/
And REBOOT
Hence again, in the first path (folder) the patched XML and conf files must be present
If it doesn't work you can try shortening the second folder path (both for XML and conf) to:
/vendor/odm/etc
or even to:
/odm/etc
zgfg said:
Ok, then copy the attached post-fs-data.sh to /data/adb/modules/ViPER4AndroidFX
(Instead of the previously given sh file)
In the sh script you will see two mount -o bind commands, one for XML and the other for conf, like:
mount -o bind /data/adb/modules/ViPER4AndroidFX/system/vendor//audio_effects.xml /system/vendor/odm/etc/audio_effects.xml
Their purpose is to manually mount from:
/data/adb/modules/ViPER4AndroidFX/system/vendor/etc
to:
/system/vendor/odm/etc/
And REBOOT
Hence again, in the first path (folder) the patched XML and conf files must be present
If it doesn't work you can try shortening the second folder path (both for XML and conf) to:
/vendor/odm/etc
or even to:
/odm/etc
Click to expand...
Click to collapse
That works as far as binding the existing audio_effects.xml that is located in /odm/etc. The .conf file doesn't appear in /odm/etc/. It does appear in /system/etc/ which I was able to mount a patched version by creating a corresponding folder in /data/adb/modules/Viper4AndroidFX/system/etc.
So I think it's safe to say that every audio_effects.xml & .conf are patched at this point.
Driver loop still persists though, I read one member point out that if he ran dumpsys media.audio_flinger, he noticed that the OnePlus 10 pro is using lib64 audio folders instead of the regular lib folders. It seems like viper tries to use the regular lib folder since the lib files that are patched are under lib and not lib64. Not sure how significant that is.
ecera said:
That works as far as binding the existing audio_effects.xml that is located in /odm/etc. The .conf file doesn't appear in /odm/etc/. It does appear in /system/etc/ which I was able to mount a patched version by creating a corresponding folder in /data/adb/modules/Viper4AndroidFX/system/etc.
So I think it's safe to say that every audio_effects.xml & .conf are patched at this point.
Driver loop still persists though...
Click to expand...
Click to collapse
I see now that in post #9 you already wrote that conf file was originally not present in /odm/etc, hence you don't need to bind it there (remove the corresponding mount -o bind command from sh file)
Now, upon the V4A still looped, did you check, do you still have all the folders and files in /data/adb/modules/ViPER4AndroidFX (you previously created) in place.
Ie, are the patched XML and conf files still in 'real' folders after you rebooted?
If so, you are lucky (you don't need to start all over again) - but then copy the whole structure:
/data/adb/modules/ViPER4AndroidFX
to eg (not a nice place to keep but it will be close to your hands and will not harm):
/data/adb/ViPER4AndroidFX
Then you can experiment further if you have an idea what to do with the libs
If, at any moment, V4A (by looping) deletes what you had in /data/adb/modules/ViPER4AndroidFX
you could then easily repair it from your copy, reboot and continue experimenting
---
If you zip and attach the complete content of that /data/adb/modules/ViPER4AndroidFX
I can give you then a flashable zip (module) file that you could easily install through Magisk app to start from that 'frozen' point all over again
ecera said:
Driver loop still persists though, I read one member point out that if he ran dumpsys media.audio_flinger, he noticed that the OnePlus 10 pro is using lib64 audio folders instead of the regular lib folders. It seems like viper tries to use the regular lib folder since the lib files that are patched are under lib and not lib64. Not sure how significant that is.
Click to expand...
Click to collapse
Regarding the lib vs lib64:
Check in the patched audio_effects.conf file
There should be a number of libraries listed as:
path /vendor/lib/soundfx/*.so
Are they really listed with /vendor/lib/
or with
vendor/lib64/
---
Disable the V4A module (through Magisk app or by placing an empty file named disable into /data/adb/modules/ViPER4AndroidFX - Magisk app by itself disables a particular module that way) and REBOOT and then check the original, not-patched conf file in those 'real' folders and check if it refers to lib or lib64
PS: Check those not-patched conf files in all four locations you said you had them in the post #9
Also, with the disabled V4A module, run su and then your dumpsys command directly from Terminal app and look does it list /vendor/lib/soundfx/ or /vendor/lib64/soundfx/ libraries

Categories

Resources