forked from phhusson/vendor_foss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
107 lines (88 loc) · 2.97 KB
/
update.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
set -e
repo="https://f-droid.org/repo/"
addCopy() {
addition=""
if [ "$2" == org.mozilla.fennec_fdroid ];then
unzip bin/$1 lib/*
addition="
LOCAL_PREBUILT_JNI_LIBS := \\
$(unzip -lv bin/$1 |grep -v Stored |sed -nE 's;.*(lib/arm64-v8a/.*);\t\1 \\;p')
"
fi
if [ "$2" == com.google.android.gms ] || [ "$2" == com.android.vending ] ;then
addition="LOCAL_PRIVILEGED_MODULE := true"
fi
cat >> Android.mk <<EOF
include \$(CLEAR_VARS)
LOCAL_MODULE := $2
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := bin/$1
LOCAL_MODULE_CLASS := APPS
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_OVERRIDES_PACKAGES := $3
$addition
$(aapt d badging "bin/$1" |sed -nE "s/uses-library-not-required:'(.*)'/LOCAL_OPTIONAL_USES_LIBRARIES += \1/p")
$(aapt d badging "bin/$1" |sed -nE "s/uses-library:'(.*)'/LOCAL_USES_LIBRARIES += \1/p")
include \$(BUILD_PREBUILT)
EOF
echo -e "\t$2 \\" >> apps.mk
}
rm -Rf apps.mk lib
cat > Android.mk <<EOF
LOCAL_PATH := \$(my-dir)
EOF
echo -e 'PRODUCT_PACKAGES += \\' > apps.mk
mkdir -p bin
#downloadFromFdroid packageName overrides
downloadFromFdroid() {
mkdir -p tmp
[ "$oldRepo" != "$repo" ] && rm -f tmp/index.xml
oldRepo="$repo"
if [ ! -f tmp/index.xml ];then
#TODO: Check security keys
wget --connect-timeout=10 $repo/index.jar -O tmp/index.jar
unzip -p tmp/index.jar index.xml > tmp/index.xml
fi
marketvercode="$(xmlstarlet sel -t -m '//application[id="'"$1"'"]' -v ./marketvercode tmp/index.xml || true)"
apk="$(xmlstarlet sel -t -m '//application[id="'"$1"'"]/package[versioncode="'"$marketvercode"'"]' -v ./apkname tmp/index.xml || xmlstarlet sel -t -m '//application[id="'"$1"'"]/package[1]' -v ./apkname tmp/index.xml)"
if [ ! -f bin/$apk ];then
while ! wget --connect-timeout=10 $repo/$apk -O bin/$apk;do sleep 1;done
fi
addCopy $apk $1 "$2"
}
#phh's Superuser
downloadFromFdroid me.phh.superuser
#Navigation
downloadFromFdroid net.osmand.plus
#Web browser
# downloadFromFdroid org.mozilla.fennec_fdroid "Browser2 QuickSearchBox"
#Calendar
downloadFromFdroid ws.xsoh.etar Calendar
#Pdf viewer
downloadFromFdroid com.artifex.mupdf.viewer.app
#Play Store download
downloadFromFdroid com.aurora.store
#Mail client
downloadFromFdroid com.fsck.k9 "Email"
#Ciphered Instant Messaging
#downloadFromFdroid im.vector.alpha
#Calendar/Contacts sync
downloadFromFdroid com.etesync.syncadapter
#Nextcloud client
downloadFromFdroid com.nextcloud.client
downloadFromFdroid com.simplemobiletools.gallery.pro "Photos Gallery Gallery2"
downloadFromFdroid com.aurora.adroid
downloadFromFdroid org.openbmap
repo=https://microg.org/fdroid/repo/
downloadFromFdroid com.google.android.gms
downloadFromFdroid com.google.android.gsf
downloadFromFdroid com.android.vending
repo=https://archive.newpipe.net/fdroid/repo/
#YouTube viewer
downloadFromFdroid org.schabi.newpipe
repo=https://fdroid.bromite.org/fdroid/repo/
downloadFromFdroid org.bromite.bromite "Browser2 QuickSearchBox"
downloadFromFdroid com.android.webview "WebView"
echo >> apps.mk
rm -Rf tmp