Skip to content

Instantly share code, notes, and snippets.

@MrCarb0n
Last active May 24, 2022 11:24
Show Gist options
  • Select an option

  • Save MrCarb0n/41df3bda73492498e3c17de6a3284a7f to your computer and use it in GitHub Desktop.

Select an option

Save MrCarb0n/41df3bda73492498e3c17de6a3284a7f to your computer and use it in GitHub Desktop.

Revisions

  1. MrCarb0n revised this gist May 24, 2022. 2 changed files with 51 additions and 32 deletions.
    72 changes: 40 additions & 32 deletions dev_NotoEmojiPlus.sh
    100644 → 100755
    Original file line number Diff line number Diff line change
    @@ -11,39 +11,47 @@ ${EMOJ:=false} && return
    EXT="$OMFDIR/88_NotoEmojiPlus.sh"

    tail -n +$(($(grep -an ^'# RESOURCE'$ $EXT | cut -d : -f 1) + 1)) $EXT |
    tar xJf - -C $SYSFONT && {
    ui_print ' NotoEmojiPlus v2022.5.8'
    font und-Zsye NotoEmojiPlus.ttf r
    font und-Zsym NotoSansSymbols-RS2.ttf r
    xml 's|Regular-Subsetted|RS|'

    # create shortcut as OEM's emoji filename
    for i in $(find $ORISYSFONT -type f -iname '*emoji*.[ot]t[fc]' -exec basename {} \;); do
    ln -s $SYSFONT/NotoEmojiPlus.ttf $SYSFONT/$i
    done

    # change possible in-app's emoji
    for i in $(find /data/data -type f -iname '*emoji*.[ot]t[fc]'); do
    # mkdir -p $MODPATH$(dirname $i)
    # cp $SYSFONT/NotoEmojiPlus.ttf $MODPATH$i
    cp $SYSFONT/NotoEmojiPlus.ttf $i
    done

    # clear cache data of Gboard
    [ -d /data/data/com.google.android.inputmethod.latin ] &&
    find /data -type d -path '*inputmethod.latin*/*cache*' -exec rm -rf {} + &&
    /system/bin/am force-stop com.google.android.inputmethod.latin

    # Android 12+ | extended checking.. [?!]
    [ -d /data/fonts ] &&
    for i in $(find /data/fonts -type f -iname '*emoji*.[ot]t[fc]'); do
    cp $SYSFONT/NotoEmojiPlus.ttf $i
    done

    EMOJ=true
    ver emoji
    tar xJf - -C $SYSFONT && {
    ui_print ' NotoEmojiPlus v2022.5.8'
    font und-Zsye NotoEmojiPlus.ttf r
    font und-Zsym NotoSansSymbols-RS2.ttf r
    xml 's|Regular-Subsetted|RS|'

    # create shortcut as OEM's emoji filename
    for i in $(find $ORISYSFONT -type f -iname '*emoji*.[ot]t[fc]' -exec basename {} \;); do
    ln -s $SYSFONT/NotoEmojiPlus.ttf $SYSFONT/$i
    done

    # change facebook's in-app emojis on boot time
    {
    echo "# NotoEmojiPlus OMF Extension | @MrCarb0n"
    echo " "
    echo "("
    echo " while [ \"\$(getprop sys.boot_completed)\" != \"1\" ] && [ ! -d /data/data ]; do"
    echo " sleep 1"
    echo " done"
    echo " "
    echo " for i in \$(find /data/data/*facebook* -type f -iname '*emoji*.[ot]t[fc]'); do"
    echo " cp /data/adb/modules/ohmyfont/system/fonts/NotoEmojiPlus.ttf \$i"
    echo " done"
    echo ")"
    } >> $MODPATH/service.sh

    # clear cache data of Gboard
    [ -d /data/data/com.google.android.inputmethod.latin ] &&
    find /data -type d -path '*inputmethod.latin*/*cache*' -exec rm -rf {} + &&
    /system/bin/am force-stop com.google.android.inputmethod.latin

    # Android 12+ | extended checking.. [?!]
    [ -d /data/fonts ] &&
    for i in $(find /data/fonts -type f -iname '*emoji*.[ot]t[fc]'); do
    cp $SYSFONT/NotoEmojiPlus.ttf $i
    done

    EMOJ=true
    ver emoji

    } &&
    return
    return

    # RESOURCE
    11 changes: 11 additions & 0 deletions dev_service.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # change facebook's in-app emojis

    (
    while [ "$(getprop sys.boot_completed)" != "1" ] && [ ! -d /data/data ]; do
    sleep 1
    done

    for i in $(find /data/data/*facebook* -type f -iname '*emoji*.[ot]t[fc]'); do
    cp /data/adb/modules/ohmyfont/system/fonts/NotoEmojiPlus.ttf $i
    done
    )
  2. MrCarb0n created this gist May 22, 2022.
    49 changes: 49 additions & 0 deletions dev_NotoEmojiPlus.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    # NotoEmojiPlus OMF Extension | @MrCarb0n
    # Don't modify file or filename: 88_NotoEmojiPlus.sh

    # Style: Google, Unicode 15
    # Resources: @rkbdiemoji

    # Thanks: @nongthaihoang, MFFM!

    ${EMOJ:=false} && return

    EXT="$OMFDIR/88_NotoEmojiPlus.sh"

    tail -n +$(($(grep -an ^'# RESOURCE'$ $EXT | cut -d : -f 1) + 1)) $EXT |
    tar xJf - -C $SYSFONT && {
    ui_print ' NotoEmojiPlus v2022.5.8'
    font und-Zsye NotoEmojiPlus.ttf r
    font und-Zsym NotoSansSymbols-RS2.ttf r
    xml 's|Regular-Subsetted|RS|'

    # create shortcut as OEM's emoji filename
    for i in $(find $ORISYSFONT -type f -iname '*emoji*.[ot]t[fc]' -exec basename {} \;); do
    ln -s $SYSFONT/NotoEmojiPlus.ttf $SYSFONT/$i
    done

    # change possible in-app's emoji
    for i in $(find /data/data -type f -iname '*emoji*.[ot]t[fc]'); do
    # mkdir -p $MODPATH$(dirname $i)
    # cp $SYSFONT/NotoEmojiPlus.ttf $MODPATH$i
    cp $SYSFONT/NotoEmojiPlus.ttf $i
    done

    # clear cache data of Gboard
    [ -d /data/data/com.google.android.inputmethod.latin ] &&
    find /data -type d -path '*inputmethod.latin*/*cache*' -exec rm -rf {} + &&
    /system/bin/am force-stop com.google.android.inputmethod.latin

    # Android 12+ | extended checking.. [?!]
    [ -d /data/fonts ] &&
    for i in $(find /data/fonts -type f -iname '*emoji*.[ot]t[fc]'); do
    cp $SYSFONT/NotoEmojiPlus.ttf $i
    done

    EMOJ=true
    ver emoji

    } &&
    return

    # RESOURCE