2024-02-02 12:39:14 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# This script will set extra permissions through adb for the apps I use so I don't have to look them up again.
|
|
|
|
|
|
|
|
# adb global options:
|
|
|
|
# -a listen on all network interfaces, not just localhost
|
|
|
|
# -d use USB device (error if multiple devices connected)
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# TODO: if adb is not installed or in $PATH, exit?
|
|
|
|
|
|
|
|
# Remember,
|
|
|
|
echo "In case of trouble check Android System Settings, Connected devices, USB mode. It should be data transfer for adb USB debugging to take effect."
|
|
|
|
|
|
|
|
# DetoxDroid, https://github.com/flxapps/DetoxDroid/wiki/Manual-Installation
|
2024-04-18 14:48:47 +02:00
|
|
|
adb "$@" shell pm grant com.flx_apps.digitaldetox android.permission.WRITE_SECURE_SETTINGS
|
|
|
|
adb "$@" shell dpm set-device-owner com.flx_apps.digitaldetox/.DetoxDroidDeviceAdminReceiver
|
2024-02-02 12:39:14 +01:00
|
|
|
|
2024-02-02 12:43:24 +01:00
|
|
|
# Logfox adb reader from F-Droid
|
|
|
|
adb "$@" shell pm grant com.f0x1d.logfox android.permission.READ_LOGS
|
|
|
|
|
2024-02-27 14:47:55 +01:00
|
|
|
# https://github.com/c-lis/morelocale
|
|
|
|
adb "$@" shell pm grant jp.co.c_lis.ccl.morelocale android.permission.CHANGE_CONFIGURATION
|
|
|
|
|
2024-07-04 05:49:43 +02:00
|
|
|
# https://github.com/karasevm/PrivateDNSAndroid
|
|
|
|
adb "$@" shell pm grant ru.karasevm.privatednstoggle android.permission.WRITE_SECURE_SETTINGS
|
|
|
|
|
2024-07-09 08:38:35 +02:00
|
|
|
# https://userbase.kde.org/KDEConnect#Log_Reading
|
|
|
|
adb "$@" shell pm grant org.kde.kdeconnect_tp android.permission.READ_LOGS
|
|
|
|
adb "$@" shell appops set org.kde.kdeconnect_tp SYSTEM_ALERT_WINDOW allow
|
|
|
|
|
2024-08-21 05:56:59 +02:00
|
|
|
# https://github.com/cvzi/darkmodewallpaper hopefully fixing Android 14 wallpapers
|
|
|
|
adb "$@" shell pm grant com.github.cvzi.darkmodewallpaper android.permission.MANAGE_EXTERNAL_STORAGE
|
|
|
|
adb "$@" shell pm grant com.github.cvzi.darkmodewallpaper android.permission.READ_MEDIA_IMAGES
|
|
|
|
|
2024-03-06 11:18:29 +01:00
|
|
|
# Shizuku
|
|
|
|
#(adb shell sh /sdcard/Android/data/moe.shizuku.privileged.api/start.sh &)
|
2024-04-14 08:25:55 +02:00
|
|
|
(adb "$@" shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh &)
|
|
|
|
|
2024-05-07 18:32:47 +02:00
|
|
|
# Should tell whether the DoH3 module exists
|
|
|
|
(adb "$@" shell pm list package | grep com.android.resolv &)
|
|
|
|
|
|
|
|
# If 1, DoH3 is supported. How about trying to make it 1?
|
2024-04-14 08:25:55 +02:00
|
|
|
(adb "$@" shell cmd device_config get netd_native doh &)
|
2024-05-07 18:32:47 +02:00
|
|
|
(adb "$@" shell cmd device_config put netd_native doh 1 &)
|
2024-03-06 11:18:29 +01:00
|
|
|
|
2024-02-02 12:39:14 +01:00
|
|
|
# Wait a bit and then reboot the device
|
|
|
|
sleep 5
|
2024-02-02 12:45:05 +01:00
|
|
|
#adb "$@" reboot
|
2024-02-02 12:39:14 +01:00
|
|
|
|
2024-07-07 05:47:23 +02:00
|
|
|
printf "Performance issues? adb shell top -b | head\n"
|
2024-02-02 12:39:14 +01:00
|
|
|
set +x
|