-
-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Device: OnePlus 8 Pro
OS: OxygenOS 13.1
Root: APatch
Lawnchair 14 Dev (1318)
The problem: I flash quickswitch using APatch. After this reboot. After reboot I open the Quickswitch app, which of course doesn't work as I don't use Magisk.
(offtopic: it relies in get_modpath.sh inside the apk, and that only looks for Magisk, maybe someone could update the apk to work with APatch and KSU? I have not found any source of it as paphonb removed his github)
So the only way is to set the APKPATH variable and run the quickswitch script directly. Said and done and rebooted again.
However, Oneplus launcher is still set as Recents provider.
So I start looking at the APatch log:
mount overlayfs on "/system", lowerdir=/data/adb/modules/quickswitch/system:/system, upperdir=None, workdir=None
fsopen mount failed: Function not implemented (os error 38), fallback to mount
mount system failed: mount overlayfs for root failed: Operation not permitted (os error 1)
It seem to try to use fsopen to mount it first, but it has upperdir and workdir set to None, this will make the command fail (I guess? You can't mount it as overlay without workdir anyway).
It should fall back to using just mount after this, but it doesn't?
It doesn't show any error in the log in APatch either or in quickswitches log.
So to resolve this I had to mount the overlay myself. Lots of trial and error as I'm not used to overlay, but I suppose it's similar to bind.
After getting both directories in /system/ as overlay the second problem came up. The script sets up /vendor/overlay/ as the directory to use. This, in my case, is wrong. It's actually using /product/overlay. This took some time to figure out too.
I don't know where it checks whether to use /vendor or /product.
But after adding mounts in the service.sh script of Quickswitch it is finally working.
Rundown as to what I did:
Open a terminal
pm path app.lawnchair.debug
export APKPATH='/(path from pm path here)'
/data/adb/modules/quickswitch/quickswitch --ch=app.lawnchair.debug
Let it finish and reboot after.
Now you open Root Explorer or a terminal w/ nano.
Go to /data/adb/modules/quickswitch.
Rename the /vendor/ directory to product.
(also check permissions of all files and owner:group. Some of mine were set to shell).
Open up service.sh and add these lines right under the first line.
mount -o remount,rw /system
mount -o remount,rw /product
mount -t overlay -o lowerdir=/product/overlay,upperdir=$MODDIR/product/overlay,workdir=$MODDIR/worker3 overlay /product/overlay
mount -t overlay -o lowerdir=/system/etc,upperdir=$MODDIR/system/etc,workdir=$MODDIR/worker2 overlay /system/etc
mount -t overlay -o lowerdir=/system/priv-app,upperdir=$MODDIR/system/priv-app,workdir=$MODDIR/worker overlay /system/priv-app
mount -o remount,ro /system
mount -o remount,ro /product
(Please tell me if you need a separate workdir for all or if you can use just one?)
Create the worker directories in the quickswitch folder.
After this reboot again. Quickswitch should now work hopefully.
Maybe someone could look into why it can't mount /system to begin with, and why it selects /vendor rather than /product. Both my /vendor and /product has a overlay directory, but the one in /vendor only has 2 APKs in it.
I also noticed that after using the quickswitch script it leaves /system and /vendor as RW (until you reboot) rather than remounting them to RO again.