bug: Mounting doesn't apply the patch
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.
Check, if the mount script works or errors at some line by manually running it
Are the scripts meant to be used with overlayfs ?? Maybe be the script doesn't support magic mount.
If a fix is considered please add support for Apatch too it's really annoying to keep building and flashing revanced modules 😢 .
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"
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.
Run the mount script manually and check for errors likewise
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.
Then check the logs on boot
Then check the logs on boot
Where do i get them from though ??
rename the script, add a new one in its place and pipe the output to a file with "./origscript.sh > log.txt"
Let me repatch the app and do a mount install will provide you the logs by tomorrow.
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
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.
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 🥲.
And yea the log was still empty which suggests it just doesnt work during boot ??
No, an error needs to occur
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.
echo every variable to log.txr
echo every variable to log.txr
Umm how ? what should i add in the .sh file
Please use chatgpt for such questions
Wait it mounted it this time howw, ofcourse when i want to debug it, it doesn't reproduce the issue now. ðŸ˜
@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.
@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 ?
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.
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.
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
here's the script if that has some problem. had to change it to txt .sh file type is not allowed.