Skip to content

Commit 5a6cf47

Browse files
committed
🆕 Initial Release!
- Universal Magisk Module (WIP) - OhMyFont' Extension v2022.7.6 Signed-off-by: Τ Ι Λ ϟ Η <MrCarb0n@proton.me>
0 parents  commit 5a6cf47

File tree

11 files changed

+954
-0
lines changed

11 files changed

+954
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### v0.1
2+
- Initial preparation
3+
- Universal module
4+
- OhMyFont' extension

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/sbin/sh
2+
3+
#################
4+
# Initialization
5+
#################
6+
7+
umask 022
8+
9+
# echo before loading util_functions
10+
ui_print() { echo "$1"; }
11+
12+
require_new_magisk() {
13+
ui_print "*******************************"
14+
ui_print " Please install Magisk v20.4+! "
15+
ui_print "*******************************"
16+
exit 1
17+
}
18+
19+
#########################
20+
# Load util_functions.sh
21+
#########################
22+
23+
OUTFD=$2
24+
ZIPFILE=$3
25+
26+
mount /data 2>/dev/null
27+
28+
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
29+
. /data/adb/magisk/util_functions.sh
30+
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk
31+
32+
install_module
33+
exit 0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#MAGISK

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!---
2+
╭─────────────────────────────────────────╮
3+
│ Kill GMS Font Module. | @MrCarb0n │
4+
├─────────────────────────────────────────┤
5+
│ Give proper credit before doing any │
6+
│ distribution or modification. │
7+
│ All files licensed under │
8+
│ GNU General Public License v3.0 │
9+
├─────────────────────────────────────────┤
10+
│ https://github.com/MrCarb0n/killgmsfont │
11+
╰─────────────────────────────────────────╯
12+
-->
13+
14+
# Kill GMS Font :skull:
15+
16+
[Google Mobile Services][1] a.k.a GMS has internal [Font Api Service][2] which is provide
17+
fonts among [Google Apps][3] and others too. Here [KillGMSFont][4] do revoke GMS' font
18+
service while installation and boot time to ensure [Google Apps][3] to rely on system
19+
provided or custom installed font.
20+
21+
> Many app' user interface rely on in-built shipped custom font, they won't be effective
22+
> by KillGMSFont. Instead ask app developer to use [GMS' Font Provider][2] service or
23+
> system font.
24+
25+
---
26+
### Download
27+
28+
> [KillGMSFont][4] have came in two different variant, 1st one is universal magisk module,
29+
> fitted w/o any font mod/tweak and 2nd one is as [OMF][10]' extension. Download your
30+
> desired variant down below.
31+
32+
- [Magisk Module][5] (WIP)
33+
- [OMF Extension][6]
34+
> extract zip to `OhMyFont` folder before installing OMF.
35+
36+
---
37+
### Requirements
38+
- Magisk v20.4+
39+
40+
---
41+
### Credits to
42+
- [OMF Community][7] for inspiration
43+
- [Zackptg5][8] for [MMT-EXTENDED][9]
44+
45+
---
46+
### Partner projects
47+
- [Oh My Font!][10]
48+
- [Magisk Flashable Font Module][11]
49+
50+
---
51+
[1]: https://www.android.com/gms
52+
[2]: https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
53+
[3]: https://play.google.com/store/apps/dev?id=5700313618786177705
54+
[4]: https://github.com/MrCarb0n/killgmsfont
55+
[5]: https://github.com/MrCarb0n/killgmsfont/releases
56+
[6]: https://raw.githubusercontent.com/MrCarb0n/killgmsfont/master/killgmsfont.zip
57+
[7]: https://t.me/ohmyfont
58+
[8]: https://github.com/Zackptg5
59+
[9]: https://github.com/Zackptg5/MMT-Extended
60+
[10]: https://gitlab.com/nongthaihoang/oh_my_font
61+
[11]: https://t.me/MFFMMain

customize.sh

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# ╭─────────────────────────────────────────╮
2+
# │ Kill GMS Font Module. | @MrCarb0n │
3+
# ├─────────────────────────────────────────┤
4+
# │ Give proper credit before doing any │
5+
# │ distribution or modification. │
6+
# │ All files licensed under │
7+
# │ GNU General Public License v3.0 │
8+
# ├─────────────────────────────────────────┤
9+
# │ https://github.com/MrCarb0n/killgmsfont │
10+
# ╰─────────────────────────────────────────╯
11+
12+
# set -xv
13+
DEBUG=true
14+
15+
ui_print ' _____ _ _ _ _____ _____ _____ _____ _ '
16+
ui_print '| | |_| | | __| | __| __|___ ___| |_ '
17+
ui_print '| -| | | | | | | | |__ | __| . | | _|'
18+
ui_print '|__|__|_|_|_|_____|_|_|_|_____|__| |___|_|_|_| '
19+
ui_print ''
20+
21+
ui_print '- Installing'
22+
ui_print ''
23+
24+
# disable GMS' font service
25+
STATE_GMSF() {
26+
ui_print '- Disabling components'
27+
local PM="$(which pm)"
28+
local GMSF="com.google.android.gms/com.google.android.gms.fonts"
29+
30+
for u in $(ls /data/user); do
31+
$PM $@ --user $u "$GMSF.update.UpdateSchedulerService" |
32+
awk -F':' '{gsub(/ /,"");print $2}' |
33+
while IFS= read -r STATE; do
34+
ui_print " Service: $STATE"
35+
done
36+
37+
$PM $@ --user $u "$GMSF.provider.FontsProvider" |
38+
awk -F':' '{gsub(/ /,"");print $2}' |
39+
while IFS= read -r STATE; do
40+
ui_print " Provider: $STATE"
41+
done
42+
done
43+
ui_print ''
44+
}
45+
46+
# delete GMS' generated fonts
47+
DEL_GMSF() {
48+
ui_print '- Deleting GMS Font'
49+
local GMSFD=com.google.android.gms/files/fonts
50+
51+
for d in /data/data /data/user/*; do
52+
[ -d $d/$GMSFD ] &&
53+
ui_print " Found: $d/$GMSFD" &&
54+
rm -rf $d/$GMSFD
55+
done
56+
ui_print ' Done'
57+
ui_print ''
58+
}
59+
60+
# cleanup $MODPATH
61+
CLEANUP() {
62+
ui_print '- Cleaning up'
63+
find $MODPATH/* -maxdepth 0 \
64+
! -name module.prop \
65+
! -name service.sh \
66+
! -name uninstall.sh -delete
67+
ui_print ' Done'
68+
ui_print ''
69+
}
70+
71+
# settings permissions
72+
SET_PERM() {
73+
ui_print '- Setting permissions'
74+
set_perm_recursive $MODPATH 0 0 0755 0777 u:object_r:system_file:s0
75+
ui_print ' Done'
76+
ui_print ''
77+
}
78+
79+
# run functions
80+
STATE_GMSF disable && DEL_GMSF && CLEANUP && SET_PERM

killgmsfont.zip

1.11 KB
Binary file not shown.

module.prop

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
id=killgmsfont
2+
name=Kill GMS Font
3+
version=v0.1
4+
versionCode=1
5+
author=MrCarb0n
6+
description=Revoke GMS's pre-built fonts (such as Google Sans etc.) for Apps by Google' and others too.
7+
updateJson=https://raw.githubusercontent.com/MrCarb0n/killgmsfont/master/update.json

service.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/system/bin/sh
2+
3+
(
4+
# ╭─────────────────────────────────────────╮
5+
# │ Kill GMS Font Module. | @MrCarb0n │
6+
# ├─────────────────────────────────────────┤
7+
# │ Give proper credit before doing any │
8+
# │ distribution or modification. │
9+
# │ All files licensed under │
10+
# │ GNU General Public License v3.0 │
11+
# ├─────────────────────────────────────────┤
12+
# │ https://github.com/MrCarb0n/killgmsfont │
13+
# ╰─────────────────────────────────────────╯
14+
15+
# wait till proper boot up
16+
until [ "$(resetprop sys.boot_completed)" = "1" -a -d "/data" ]; do
17+
sleep 1
18+
done
19+
20+
# disable GMS' font service
21+
STATE_GMSF() {
22+
local $PM="$(which pm)"
23+
local GMSF="com.google.android.gms/com.google.android.gms.fonts"
24+
25+
for s in $(ls /data/user); do
26+
$PM $@ --user $s "$GMSF.update.UpdateSchedulerService"
27+
$PM $@ --user $s "$GMSF.provider.FontsProvider"
28+
done
29+
} &> /dev/null
30+
31+
# delete GMS' generated fonts
32+
DEL_GMSF() {
33+
local GMSFD=com.google.android.gms/files/fonts
34+
35+
for d in /data/data /data/user/*; do
36+
[ -d $D/$GMSFD ] && rm -rf $d/$GMSFD
37+
done
38+
}
39+
40+
# run primary tasks
41+
STATE_GMSF disable && DEL_GMSF
42+
)

uninstall.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ╭─────────────────────────────────────────╮
2+
# │ Kill GMS Font Module. | @MrCarb0n │
3+
# ├─────────────────────────────────────────┤
4+
# │ Give proper credit before doing any │
5+
# │ distribution or modification. │
6+
# │ All files licensed under │
7+
# │ GNU General Public License v3.0 │
8+
# ├─────────────────────────────────────────┤
9+
# │ https://github.com/MrCarb0n/killgmsfont │
10+
# ╰─────────────────────────────────────────╯
11+
12+
# wait till pm is executable
13+
until [ "$(resetprop sys.boot_completed)" = "1" ]; do
14+
sleep 1
15+
done
16+
17+
# enable GMS' font service
18+
STATE_GMSF() {
19+
local PM="$(which pm)"
20+
local GMSF="com.google.android.gms/com.google.android.gms.fonts"
21+
22+
for u in $(ls /data/user); do
23+
$PM $@ --user $u "$GMSF.update.UpdateSchedulerService"
24+
$PM $@ --user $u "$GMSF.provider.FontsProvider"
25+
done
26+
} &> /dev/null
27+
28+
STATE_GMSF enable
29+
30+
# Don't modify anything after this
31+
if [ -f $INFO ]; then
32+
while read LINE; do
33+
if [ "$(echo -n $LINE | tail -c 1)" == "~" ]; then
34+
continue
35+
elif [ -f "$LINE~" ]; then
36+
mv -f $LINE~ $LINE
37+
else
38+
rm -f $LINE
39+
while true; do
40+
LINE=$(dirname $LINE)
41+
[ "$(ls -A $LINE 2> /dev/null)" ] && break 1 || rm -rf $LINE
42+
done
43+
fi
44+
done < $INFO
45+
rm -f $INFO
46+
fi

0 commit comments

Comments
 (0)