-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
46 lines (35 loc) · 1.51 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env sh
dnscrypt_version="2.1.5"
while ! adb root; do
echo "Waiting for adb root authorization..."
echo "This will only work if you have lineageos root debuggin enabled"
echo "You will also have to confirm the prompt on your phone"
sleep 5
done
adb remount /
# /system/etc/init/myboot.rc
adb push myboot.rc /system/etc/init/
# /system/etc/myboot.sh
adb push myboot.sh /system/etc/
adb shell chmod +x /system/etc/myboot.sh
# add dnscrypt-proxy files
# add sites you want to allow / whitelist
adb push dnscrypt-proxy.allowedlist.txt /system/etc/
# default is to block everything so that only what we allow works
adb push dnscrypt-proxy.blocklist.txt /system/etc/
# e.g. apply google safe search and safe search for other sites you allowed
adb push dnscrypt-proxy.cloaking-rules.txt /system/etc/
# main config file
adb push dnscrypt-proxy.toml /system/etc/
# fetch dnscrypt-proxy binary
curl -LO "https://github.com/DNSCrypt/dnscrypt-proxy/releases/download/${dnscrypt_version}/dnscrypt-proxy-android_arm64-${dnscrypt_version}.zip"
unzip -j "dnscrypt-proxy-android_arm64-${dnscrypt_version}.zip" '*/dnscrypt-proxy'
# add dnscrypt-binary and make it executable
adb push dnscrypt-proxy /system/bin/
adb shell chmod +x /system/bin/dnscrypt-proxy
# /system/addon.d/50-lineage.sh
# to backup and restore files on upgrade
adb push 50-lineage.sh /system/addon.d/
adb shell chmod +x /system/addon.d/50-lineage.sh
# add hosts file to block subdomain of domains whitelisted in dnscrypt-proxy
adb push hosts /system/etc/hosts