revanced-library icon indicating copy to clipboard operation
revanced-library copied to clipboard

bug: Mounting doesn't apply the patch

Open brosssh opened this issue 6 months ago • 41 comments

Bug description

Using latest cli, when mouting patches aren't applied. The app is the same as stock. Clean installing with the same patches does indeed work, I can see patches being applied in the app.

Command used: java -jar revanced-cli-5.0.1-all.jar patch -p patches-1.6.1.rvp myapk.apk --install --mount

Working command (without mounting): java -jar revanced-cli-5.0.1-all.jar patch -p patches-1.6.1.rvp myapk.apk --install

Error logs

No useful logs.

Solution

No response

Additional context

No response

Acknowledgements

  • [x] I have checked all open and closed bug reports and this is not a duplicate.
  • [x] I have chosen an appropriate title.
  • [x] All requested information has been provided properly.

brosssh avatar Jul 10 '25 15:07 brosssh

Check, if the mount script works or errors at some line by manually running it

oSumAtrIX avatar Jul 10 '25 18:07 oSumAtrIX

Are the scripts meant to be used with overlayfs ?? Maybe be the script doesn't support magic mount.

Vaibhav1579 avatar Jul 10 '25 19:07 Vaibhav1579

If a fix is considered please add support for Apatch too it's really annoying to keep building and flashing revanced modules 😢 .

Vaibhav1579 avatar Jul 10 '25 20:07 Vaibhav1579

You can modify the mount script to support apatch. Besides the latest library should already be supporting it. It uses magisk mount mirror only when available. Also what do you mean "with overlayfs"

oSumAtrIX avatar Jul 10 '25 20:07 oSumAtrIX

Image

You can modify the mount script to support apatch. Besides the latest library should already be supporting it. It uses magisk mount mirror only when available. Also what do you mean "with overlayfs"

The latest releases have been switched from OverlayFs to use Magic mount and using the releases before this release fixes the mount issues in apatch 11039. Even if you force OverlayFs in the latest builds the mount scripts doesn't seem to work only reverting to old Apatch releases seems to help.

Vaibhav1579 avatar Jul 10 '25 20:07 Vaibhav1579

Run the mount script manually and check for errors likewise

oSumAtrIX avatar Jul 10 '25 20:07 oSumAtrIX

The mount seems to work when you first patch it but it isn't persistent when rebooting the device, the app reverts to stock every reboot.

Vaibhav1579 avatar Jul 10 '25 20:07 Vaibhav1579

Then check the logs on boot

oSumAtrIX avatar Jul 10 '25 20:07 oSumAtrIX

Then check the logs on boot

Where do i get them from though ??

Vaibhav1579 avatar Jul 10 '25 20:07 Vaibhav1579

rename the script, add a new one in its place and pipe the output to a file with "./origscript.sh > log.txt"

oSumAtrIX avatar Jul 10 '25 20:07 oSumAtrIX

Let me repatch the app and do a mount install will provide you the logs by tomorrow.

Vaibhav1579 avatar Jul 10 '25 20:07 Vaibhav1579

rename the script, add a new one in its place and pipe the output to a file with "./origscript.sh > log.txt"

Ok i tried this but the logs are completely empty ??

#!/system/bin/sh ./com.google.android.youtube.sh > log.txt

Mount using Magisk mirror, if available.

MAGISKTMP="$( magisk --path )" || MAGISKTMP=/sbin MIRROR="$MAGISKTMP/.magisk/mirror" if [ ! -f $MIRROR ]; then MIRROR="" fi

until [ "$(getprop sys.boot_completed)" = 1 ]; do sleep 3; done until [ -d "/sdcard/Android" ]; do sleep 1; done

Unmount any existing installation to prevent multiple unnecessary mounts.

grep com.google.android.youtube /proc/mounts | while read -r line; do echo $line | cut -d " " -f 2 | sed "s/apk.*/apk/" | xargs -r umount -l; done

base_path=/data/adb/revanced/com.google.android.youtube/base.apk stock_path=$(pm path com.google.android.youtube | grep base | sed "s/package://g" )

chcon u:object_r:apk_data_file:s0 $base_path mount -o bind $MIRROR$base_path $stock_path

Kill the app to force it to restart the mounted APK in case it is already running

am force-stop com.google.android.youtube

Vaibhav1579 avatar Jul 10 '25 21:07 Vaibhav1579

also tried chmod +x /data/adb/service.d/com.google.android.youtube.sh in termux doesn't seem to give any output in termux or mount the app. Tried chmod +x /data/adb/service.d/com.google.android.youtube.sh > ./log.txt the txt file is empty.

Vaibhav1579 avatar Jul 10 '25 21:07 Vaibhav1579

I used chat gpt it told me to add a couple of lines i added exec -x and another line after this which caused the script to loop and recreate the log.txt idk what it did but my phone started lagging really badly. Deleting the script didn't help too the lag was still there. I hope my phone is ok 🥲.

Vaibhav1579 avatar Jul 10 '25 22:07 Vaibhav1579

And yea the log was still empty which suggests it just doesnt work during boot ??

Vaibhav1579 avatar Jul 10 '25 22:07 Vaibhav1579

No, an error needs to occur

oSumAtrIX avatar Jul 11 '25 10:07 oSumAtrIX

No, an error needs to occur

I don't get it then cause the script does work i think as the log.txt is produced it's just it's completely empty.

Vaibhav1579 avatar Jul 11 '25 10:07 Vaibhav1579

echo every variable to log.txr

oSumAtrIX avatar Jul 11 '25 10:07 oSumAtrIX

echo every variable to log.txr

Umm how ? what should i add in the .sh file

Vaibhav1579 avatar Jul 11 '25 10:07 Vaibhav1579

Please use chatgpt for such questions

oSumAtrIX avatar Jul 11 '25 10:07 oSumAtrIX

Please use chatgpt for such questions

Got the logs.

youtube.log

Vaibhav1579 avatar Jul 11 '25 10:07 Vaibhav1579

Wait it mounted it this time howw, ofcourse when i want to debug it, it doesn't reproduce the issue now. 😭

Vaibhav1579 avatar Jul 11 '25 10:07 Vaibhav1579

@Vaibhav1579 thanks for the help, I'm not familiar with all this mounting process. I've noticed that I can correctly mount via the manager, while on the cli I can't.

brosssh avatar Jul 11 '25 10:07 brosssh

@Vaibhav1579 thanks for the help, I'm not familiar with all this mounting process. I've noticed that I can correctly mount via the manager, while on the cli I can't.

On the cli it should work too just fine as both the manager and the cli use the same method did you give shell root access ?

Vaibhav1579 avatar Jul 11 '25 10:07 Vaibhav1579

Reproduced the issue successfully

log.log

Vaibhav1579 avatar Jul 11 '25 10:07 Vaibhav1579

First time i patched the app and directly changed the main file also i had the apk already installed idk what caused it to fix. So i cleaned everything and uninstalled the app rebooted, reinstalled the app mounted then restarted the app didn't mount.

Vaibhav1579 avatar Jul 11 '25 11:07 Vaibhav1579

Yeah the Working was a fluke idk how it was persistent now i get the same error everytime. Tried to do what i did earlier didn't help.

Vaibhav1579 avatar Jul 11 '25 11:07 Vaibhav1579

mount: can't read '/etc/fstab': No such file or directory

This is the issue. Maybe the binary is not there when it runs the command. Sleep the script until the binary is found before mounting. Log the output again

oSumAtrIX avatar Jul 11 '25 11:07 oSumAtrIX

Used chatgpt to create the Script still gives the same error.

log.log

Vaibhav1579 avatar Jul 11 '25 11:07 Vaibhav1579

here's the script if that has some problem. had to change it to txt .sh file type is not allowed.

com.google.android.youtube.txt

Vaibhav1579 avatar Jul 11 '25 11:07 Vaibhav1579