chore (blend-settings): reduce number of times entering your password is required during Android init

This commit is contained in:
Rudra Saraswat 2023-06-21 10:18:33 +10:00
parent e1eda06edc
commit c7e6bff6a2

View file

@ -7,11 +7,9 @@ function init_waydroid() {
require('child_process').spawnSync('pkexec', ['systemctl', 'enable', '--now', 'waydroid-container']) require('child_process').spawnSync('pkexec', ['systemctl', 'enable', '--now', 'waydroid-container'])
require('child_process').spawn('sh', ['-c', 'waydroid session start & disown']) require('child_process').spawn('sh', ['-c', 'waydroid session start & disown'])
setTimeout(() => { setTimeout(() => {
require('child_process').spawnSync('sh', ['-c', 'pkexec waydroid shell wm set-fix-to-user-rotation enabled']) require('child_process').spawnSync('sh', ['-c', 'pkexec bash -c "waydroid shell wm set-fix-to-user-rotation enabled; echo persist.waydroid.multi_windows=true | tee -a /var/lib/waydroid/waydroid.cfg"'])
require('child_process').spawnSync('sh', ['-c', 'echo "persist.waydroid.multi_windows=true" | pkexec tee -a /var/lib/waydroid/waydroid.cfg'])
if (require('child_process').spawnSync('sh', ['-c', 'LC_ALL=C glxinfo | grep "^OpenGL renderer string: "']).stdout.includes('NVIDIA') || require('child_process').spawnSync('cat', ['/proc/cpuinfo']).stdout.includes('hypervisor')) { if (require('child_process').spawnSync('sh', ['-c', 'LC_ALL=C glxinfo | grep "^OpenGL renderer string: "']).stdout.includes('NVIDIA') || require('child_process').spawnSync('cat', ['/proc/cpuinfo']).stdout.includes('hypervisor')) {
require('child_process').spawnSync('sh', ['-c', 'echo "ro.hardware.gralloc=default" | pkexec tee -a /var/lib/waydroid/waydroid.cfg']) require('child_process').spawnSync('sh', ['-c', 'echo -e "ro.hardware.gralloc=default\\nro.hardware.egl=swiftshader" | pkexec tee -a /var/lib/waydroid/waydroid.cfg'])
require('child_process').spawnSync('sh', ['-c', 'echo "ro.hardware.egl=swiftshader" | pkexec tee -a /var/lib/waydroid/waydroid.cfg'])
} }
require('child_process').spawn('sh', ['-c', 'pkexec waydroid upgrade -o; waydroid session stop; waydroid session start']) require('child_process').spawn('sh', ['-c', 'pkexec waydroid upgrade -o; waydroid session stop; waydroid session start'])
setTimeout(() => { postMessage('success') }, 2000) setTimeout(() => { postMessage('success') }, 2000)