├── .gitattributes
├── .gitignore
├── META-INF
└── com
│ └── google
│ └── android
│ ├── update-binary
│ └── updater-script
├── README.md
├── customize.sh
├── iyt.json
├── iytb.json
├── iytd.json
├── mk_module.sh
├── post-fs-data.sh
├── service.sh
└── uninstall.sh
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.apk filter=lfs diff=lfs merge=lfs -text
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore
2 |
3 | # macOS finder 'DS_Store'
4 | .DS_Store*
5 |
6 | # The staging and out directory
7 | staging/*
8 | out/*
9 |
10 | # backup and zip files
11 | *.backup
12 | *.zip
13 |
14 | # Due to LFS limitations
15 | *.apk
16 |
17 | # xfiles
18 | xfiles/*
19 | x_*
20 |
21 | # modified apk directory(s)
22 | extended/*
23 | revanced/*
24 | vanced/*
25 |
--------------------------------------------------------------------------------
/META-INF/com/google/android/update-binary:
--------------------------------------------------------------------------------
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
34 |
--------------------------------------------------------------------------------
/META-INF/com/google/android/updater-script:
--------------------------------------------------------------------------------
1 | #MAGISK
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Inject YouTube
2 |
3 | ### Description
4 | Magisk module that overlays a modified (patched) version over the regular version.
5 | _This is done by using the `mount` command to mount (overlay) one file/directory over the other_.
6 |
7 | ### Requirement(s)
8 | Google _YouTube_ to be installed as a _user_ app.
9 | Must be the same build as the patched version.
10 | - Note: This has to be a full apk install. Not a split-apk install.
11 |
12 | ### Download
13 | Available in the releases tab. [Link](https://github.com/mModule/iYT/releases)
14 |
15 | ### How to install.
16 | - Install regular (stock) YouTube.
17 | - Copy the module zip file to the device.
18 | - Open Magisk Manager, select Modules and then Install from storage.
19 | - Select the zip file and install.
20 | - Reboot device.
21 |
22 | ### Recent changes
23 | - Update to YouTube v18.32.39
24 |
25 | ### How to
26 | _Still need to create the wiki pages :roll_eyes:_
27 | - [Make the Module](https://github.com/mModule/iYT/wiki/MakeModule)
28 | - [Install YouTube](https://github.com/mModule/iYT/wiki/YouTube)
29 |
30 | Module support:
31 | - xdaDevelopers [Inject YouTube](https://forum.xda-developers.com/t/module-inject-youtube.4512121)
32 |
33 | ### About
34 | This module includes a modified YouTube app.
35 | The modified version is created by patching the stock version using ReVanced.
36 | For more information on ReVanced.
37 | - See the [ReVanced](https://github.com/revanced) project.
38 | - Currently using [inotia00's](https://github.com/inotia00/revanced-patches) patches.
39 |
40 | Patches included in this Module
41 |
42 |
43 | | Patch | Description |
44 | |:--------:|:--------------:|
45 | | `default-video-quality` | Adds ability to set default video quality settings. |
46 | | `disable-shorts-on-startup` | Disables playing YouTube Shorts when launching YouTube. |
47 | | `disable-auto-captions` | Disables forced auto captions. |
48 | | `enable-minimized-playback` | Enables minimized and background playback. |
49 | | `hide-auto-player-popup-panels` | Hide automatic popup panels (playlist or live chat) on video player. |
50 | | `hide-channel-watermark` | Hides creator's watermarks on videos. |
51 | | `hide-end-screen-cards` | Hides the suggested video cards at the end of a video in fullscreen. |
52 | | `hide-fullscreen-panels` | Hides video description and comments panel in fullscreen view. |
53 | | `hide-general-ads` | Hides general ads. |
54 | | `hide-info-cards` | Hides info-cards in videos. |
55 | | `hide-layout-components` | Hides general layout components. |
56 | | `hide-video-ads` | Hides ads in the video player. |
57 | | `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. |
58 | | `settings` | Applies mandatory patches to implement ReVanced settings into the application. |
59 | | `sponsorblock` | Integrates SponsorBlock which allows skipping video segments such as sponsored content. |
60 | | `spoof-player-parameters` | Spoofs player parameters to prevent playback issues. |
61 |
62 |
63 | ---
64 |
65 | #### Notes
66 | - Feel free to use, change, improve, adapt.
67 | - Remember to share.
68 |
69 | ### Credits
70 | - The Android Community and everyone who has helped me learn through the years.
71 | - John Wu and team for all things [Magisk](https://github.com/topjohnwu/Magisk).
72 | - Vanced.
73 | - ReVanced.
74 |
75 | - Everyone that has contributed to YouTube modifications.
76 |
--------------------------------------------------------------------------------
/customize.sh:
--------------------------------------------------------------------------------
1 | #!/system/bin/sh
2 |
3 | ## This script is part of the iYT module project.
4 | ## ipdev @ xda-developers
5 |
6 | # __ Define variables. __
7 |
8 | ### Magisk variables
9 | ## MODPATH (path): the path where your module files should be installed.
10 |
11 | # Mount Directory
12 | MNTDIR=/data/adb/iyt
13 |
14 | # __ Define functions. __
15 |
16 | ### Magisk functions
17 | ## set_perm [context]
18 |
19 | # __ Here we go. __
20 |
21 | # Check and remove the previous version.
22 | if [ -d "$MNTDIR" ]; then
23 | rm -rf "$MNTDIR"
24 | fi
25 |
26 | # Move the modified apk file out of the module folder.
27 | mkdir "$MNTDIR"
28 | mv "$MODPATH"/base.apk "$MNTDIR"
29 |
30 | # __ Finish and Cleanup. __
31 |
32 | # Set owner, group, permission and security.
33 | set_perm "$MNTDIR"/base.apk 1000 1000 0644 u:object_r:system_file:s0
34 | # Correct permissions of the script file(s).
35 | for i in "$MODPATH"/*.sh; do
36 | chmod 0755 $i
37 | done
38 |
--------------------------------------------------------------------------------
/iyt.json:
--------------------------------------------------------------------------------
1 | {
2 | "versionCode": "1539440064",
3 | "version": "Module",
4 | "zipUrl": "https://github.com/mModule/iYT/releases/download/v18.32.39/iYT-v183239.zip",
5 | "changelog": "https://github.com/mModule/iYT/releases/download/v18.32.39/update.md"
6 | }
7 |
--------------------------------------------------------------------------------
/iytb.json:
--------------------------------------------------------------------------------
1 | {
2 | "versionCode": "1533275584",
3 | "version": "Module",
4 | "zipUrl": "https://github.com/mModule/iYT/releases/download/v17.49.37/iYT-v174937.zip",
5 | "changelog": "https://github.com/mModule/iYT/releases/download/v17.49.37/update.md"
6 | }
7 |
--------------------------------------------------------------------------------
/iytd.json:
--------------------------------------------------------------------------------
1 | {
2 | "versionCode": "1533275584",
3 | "version": "Module",
4 | "zipUrl": "https://github.com/mModule/iYT/releases/download/v17.49.37/iYT-v174937.zip",
5 | "changelog": "https://github.com/mModule/iYT/releases/download/v17.49.37/update.md"
6 | }
7 |
--------------------------------------------------------------------------------
/mk_module.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ## Inject YouTube
4 | ## ipdev @ xda-developers
5 |
6 | # Set main variables
7 | DATE=$(date '+%Y%m%d')
8 | TDIR=$(pwd)
9 | SDIR="$TDIR"/staging
10 | OUT="$TDIR"/out/"$DATE"
11 |
12 | # Set additional variables
13 | ## None
14 |
15 | # Set main functions
16 |
17 | check_dir() {
18 | [[ ! -d $OUT ]] && mkdir -p $OUT;
19 | [[ ! -d $SDIR ]] && mkdir -p $SDIR;
20 | }
21 |
22 | # Set additional functions
23 |
24 | backup() {
25 | if [ -f "$OUT"/"$ZIPNAME" ]; then
26 | FLTM=$(date -r "$OUT"/"$ZIPNAME" '+%H%M');
27 | BACKUPFILE=$(printf "$ZIPNAME" | sed 's/.zip/-'"$FLTM".zip'/g');
28 | mv "$OUT"/"$ZIPNAME" "$OUT"/"$BACKUPFILE";
29 | if [ $MODID = yt ]; then
30 | BUZYT=""$OUT"/"$BACKUPFILE"";
31 | # elif [ $MODID = d ]; then
32 | # BUZD=""$OUT"/"$BACKUPFILE"";
33 | fi;
34 | fi;
35 | }
36 |
37 | change_log() {
38 | echo "## YouTube v"$VNAME"" >update.md;
39 | echo "" >>update.md;
40 | echo "- Module updated to YouTube v"$VNAME"" >>update.md;
41 | echo "- Requires YouTube to be updated to v"$VNAME" also." >>update.md;
42 | }
43 |
44 | create_json() {
45 | JSON="$TDIR"/iyt.json
46 |
47 | echo "{" >"$JSON";
48 | echo " \"versionCode\": \""$VCODE"\"," >>"$JSON";
49 | echo " \"version\": \"Module\"," >>"$JSON";
50 | echo " \"zipUrl\": \"https://github.com/mModule/iYT/releases/download/v"$VNAME"/"$ZIPNAME"\"," >>"$JSON";
51 | echo " \"changelog\": \"https://github.com/mModule/iYT/releases/download/v"$VNAME"/update.md\"" >>"$JSON";
52 | echo "}" >>"$JSON";
53 | }
54 |
55 | edit_service_script() {
56 | if [ "$(uname -s)" = Darwin ]; then
57 | RNAME=$(grep "Required YouTube" service.sh | cut -f6 -d' ');
58 | sed -i "" s/$RNAME/$VNAME/ service.sh;
59 | RCODE=$(grep "RYTVC=" service.sh);
60 | sed -i "" s/$RCODE/RYTVC=$VCODE/ service.sh;
61 | else
62 | RNAME=$(grep "Required YouTube" service.sh | cut -f6 -d' ');
63 | sed -i s/$RNAME/$VNAME/ service.sh;
64 | RCODE=$(grep "RYTVC=" service.sh);
65 | sed -i s/$RCODE/RYTVC=$VCODE/ service.sh;
66 | fi;
67 | }
68 |
69 | # get_app_abi() {
70 | # ABI=$(aapt dump badging "$i" | grep native-code | cut -f2 -d "'" | cut -f2 -d "-");
71 | # if [ "$ABI" = "v7a" ]; then
72 | # ARCH=arm
73 | # elif [ "$ABI" = "v8a" ]; then
74 | # ARCH=arm64
75 | # fi
76 | # }
77 |
78 | get_app_version() {
79 | VCODE=$(aapt dump badging base.apk| grep version | cut -f4 -d"'");
80 | VNAME=$(aapt dump badging base.apk| grep version | cut -f6 -d"'");
81 | VER=$(aapt dump badging base.apk| grep version | cut -f6 -d"'" | sed 's/\.//g');
82 | }
83 |
84 | module_prop() {
85 | echo "id=iyt" >module.prop
86 | echo "name=Inject YouTube" >>module.prop
87 | echo "version=Module" >>module.prop
88 | echo "versionCode="$VCODE"" >>module.prop
89 | echo "author=ip" >>module.prop
90 | echo "description=YouTube v"$VNAME >>module.prop
91 | echo "updateJson=https://raw.githubusercontent.com/mModule/iYT/master/iyt.json" >>module.prop
92 | }
93 |
94 | # set_mod_id() {
95 | # if [ $NAME = iYT ]; then
96 | # if [ $i = black.apk ]; then
97 | # MODID=b
98 | # THEME="Black"
99 | # elif [ $i = dark.apk ]; then
100 | # MODID=d
101 | # THEME="Dark"
102 | # fi
103 | # fi;
104 | # }
105 |
106 | zip_yt(){
107 | echo ""
108 | echo "iYT ("$ARCH")."
109 | cp -rf META-INF "$SDIR"
110 | cp customize.sh "$SDIR"
111 | cp post-fs-data.sh "$SDIR"
112 | cp service.sh "$SDIR"
113 | cp uninstall.sh "$SDIR"
114 | cp "$i" "$SDIR"/base.apk
115 | cd "$SDIR"
116 | get_app_version
117 | module_prop
118 | edit_service_script
119 | ZIPNAME="$NAME"-v"$VER".zip
120 | IYT=""$OUT"/"$ZIPNAME""
121 | zip -r "$ZIPNAME" META-INF/* base.apk customize.sh module.prop post-fs-data.sh service.sh uninstall.sh # > /dev/null 2>&1
122 | backup
123 | create_json
124 | change_log
125 | mv "$ZIPNAME" "$OUT"
126 | mv update.md "$OUT"
127 | rm -rf *
128 | cd "$TDIR"
129 | }
130 |
131 | # Check and create directory(s) if needed.
132 | check_dir
133 |
134 | # __ Make zip file(s). __
135 | ### Modified APK file names..
136 | ### YouTube (currently full apk only)
137 | ## YouTube 'yt.apk'
138 |
139 | for i in *.apk; do
140 | if [ -f "$i" ]; then
141 | if [ "$(aapt dump badging "$i" | grep version | cut -f2 -d"'")" = "com.google.android.youtube" ]; then
142 | NAME=iYT
143 | # get_app_abi
144 | ARCH=all
145 | # set_mod_id
146 | MODID=yt
147 | zip_yt
148 | fi
149 | fi
150 | done
151 |
152 | if [ -z $NAME ]; then
153 | echo ""; echo "Nothing to do.";
154 | fi;
155 |
156 | # Note backup file(s).
157 | if [ -n "$BUZYT" ]; then
158 | echo ""; echo "Your previous zip file(s) renamed.";
159 | if [ -n "$BUZYT" ]; then
160 | echo " iYT backup as "$BUZYT"";
161 | fi;
162 | fi;
163 |
164 | # Note new file(s).
165 | if [ -n "$IYT" ]; then
166 | echo ""; echo "New zip file(s).";
167 | if [ -n "$IYT" ]; then
168 | echo " iYT saved as "$IYT"";
169 | fi;
170 | fi;
171 |
172 | # Finish script.
173 | echo ""; echo "Done."; echo "";
174 | exit 0;
175 |
--------------------------------------------------------------------------------
/post-fs-data.sh:
--------------------------------------------------------------------------------
1 | #!/system/bin/sh
2 |
3 | ## For compatibility reasons, competing script(s) and file(s) are removed.
4 | ## ipdev @ xda-developers
5 |
6 | # Module Directory
7 | MDIR=${0%/*}
8 | # Magisk Modules Directory
9 | MMDIR=${MDIR%/*}
10 | # ADB Directory
11 | ADB=${MMDIR%/*}
12 |
13 | # Check and remove Vanced YouTube scripts and files.
14 | [[ -f $ADB/post-fs-data.d/vanced.sh ]] && rm $ADB/post-fs-data.d/vanced.sh;
15 | [[ -f $ADB/service.d/vanced.sh ]] && rm $ADB/service.d/vanced.sh;
16 | [[ -d $ADB/Vanced ]] && rm -rf $ADB/Vanced;
17 |
18 | # Check and remove ReVanced YouTube scripts and files.
19 | [[ -f $ADB/post-fs-data.d/com.google.android.youtube.sh ]] && rm $ADB/post-fs-data.d/com.google.android.youtube.sh;
20 | [[ -f $ADB/service.d/com.google.android.youtube.sh ]] && rm $ADB/service.d/com.google.android.youtube.sh;
21 | [[ -d /data/local/tmp/revanced-manager/com.google.android.youtube ]] && rm -rf /data/local/tmp/revanced-manager/com.google.android.youtube;
22 |
23 | # Check and remove ReVanced YouTube module.
24 | [[ -f $ADB/com.google.android.youtube_rv.apk ]] && rm $ADB/com.google.android.youtube_rv.apk;
25 | [[ -d $MMDIR/ytrv-magisk ]] && rm -rf $MMDIR/ytrv-magisk;
26 |
27 | # Check and remove old iYT modules.
28 | [[ -d $MMDIR/iytb ]] && rm -rf $MMDIR/iytb;
29 | [[ -d $MMDIR/iytd ]] && rm -rf $MMDIR/iytd;
30 |
--------------------------------------------------------------------------------
/service.sh:
--------------------------------------------------------------------------------
1 | #!/system/bin/sh
2 |
3 | ## This script is part of the iYT module project.
4 | ## ipdev @ xda-developers
5 |
6 | ## Requires YouTube to be installed as a user app.
7 | ## Required YouTube version is 17.49.37
8 |
9 | ## Module directory(s) set by Magisk.
10 | MODDIR=${0%/*}
11 |
12 | # Module Directory
13 | MDIR=${0%/*}
14 | # Magisk Modules Directory
15 | MMDIR=${MDIR%/*}
16 | # ADB Directory
17 | ADB=${MMDIR%/*}
18 |
19 | # Required YT versionCode.
20 | RYTVC=1533275584
21 |
22 | # Get SDK level and architecture.
23 | SDK=$(getprop ro.build.version.sdk);
24 | # ARCH=$(getprop ro.product.cpu.abi);
25 |
26 | # Find and set YouTube path.
27 | if [ $SDK -ge 30 ]; then
28 | YTPATH=$(readlink -f /data/app/*/com.google.android.youtube*/lib | sed 's/\/lib//g');
29 | else
30 | YTPATH=$(readlink -f /data/app/com.google.android.youtube*/lib | sed 's/\/lib//g');
31 | fi;
32 |
33 | # Check YouTube path.
34 | if [ ! -f $YTPATH/base.apk ]; then
35 | echo "$(date '+%Y%m%d_%H%M')" "No user installed YouTube path found." >>$MODDIR/error.log;
36 | YTMOD=ABORT;
37 | fi;
38 |
39 | # Find installed (active) YouTube versionCode.
40 | if [ -z $YTMOD ]; then
41 | while [ -z $YTVCODE ]; do
42 | YTVCODE=$(dumpsys package com.google.android.youtube | grep versionCode | cut -f2 -d'=' | tr -d '\n' | cut -f1 -d' ');
43 | date +%N > /dev/null;
44 | done;
45 | fi;
46 |
47 | # Check YouTube versionCode.
48 | if [ ! $YTVCODE = $RYTVC ]; then
49 | echo "$(date '+%Y%m%d_%H%M')" "Wrong version of YouTube found." >>$MODDIR/error.log;
50 | YTMOD=ABORT;
51 | elif [ -z $YTVCODE ]; then
52 | echo "$(date '+%Y%m%d_%H%M')" "No user installed version of YouTube found." >>$MODDIR/error.log;
53 | YTMOD=ABORT;
54 | fi;
55 |
56 | # Mount if failsafe(s) pass.
57 | if [ -z $YTMOD ]; then
58 | su -c mount $ADB/iyt/base.apk $YTPATH/base.apk;
59 | fi;
60 |
--------------------------------------------------------------------------------
/uninstall.sh:
--------------------------------------------------------------------------------
1 | #!/system/bin/sh
2 |
3 | ## This script is part of the iYT module project.
4 | ## ipdev @ xda-developers
5 |
6 | ## Module directory(s) set by Magisk.
7 | MODDIR=${0%/*}
8 |
9 | # Module Directory
10 | MDIR=${0%/*}
11 | # Magisk Modules Directory
12 | MMDIR=${MDIR%/*}
13 | # ADB Directory
14 | ADB=${MMDIR%/*}
15 |
16 | # Remove the additional iYT mount directory.
17 | rm -rf "$ADB"/iyt
18 |
--------------------------------------------------------------------------------