Skip to content

Instantly share code, notes, and snippets.

@zpp0196
zpp0196 / miui_adb_install.sh
Last active March 14, 2024 09:27
MIUI 「USB安装」免登录账号
#!/bin/sh
set -e
provider_prefs_xml=/data/data/com.miui.securitycenter/shared_prefs/remote_provider_preferences.xml
provider_prefs_tmp_xml=/data/local/tmp/remote_provider_preferences.xml
sed -e "/security_adb_install_enable/d" $provider_prefs_xml > $provider_prefs_tmp_xml
sed -i "/<\/map>/i\ \ \ \ <boolean name=\"security_adb_install_enable\" value=\"$1\" />" $provider_prefs_tmp_xml
sed -i "/<\/map>/i\ \ \ \ <boolean name=\"permcenter_install_intercept_enabled\" value=\"$2\" />" $provider_prefs_tmp_xml
@zpp0196
zpp0196 / wsl-ssh-env.sh
Created April 15, 2021 04:14
ssh 连接 WSL 后添加 Windows 环境变量
function _add_win_paths() {
local _win_paths=(
/mnt/c/Windows/
/mnt/c/Windows/system32/
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/
/mnt/d/Program\ Files/Microsoft\ VS\ Code/bin/
/mnt/d/Users/$USER/AppData/Android/Sdk/platform-tools/
)
for p in $_win_paths; do
export PATH=$PATH:$p