├── META-INF └── com │ └── google │ └── android │ ├── update-binary │ └── updater-script ├── README.md ├── changelog.txt ├── common ├── post-fs-data.sh ├── service.sh └── system.prop ├── config.sh ├── module.prop └── system └── app └── YouTube ├── YouTube.apk └── lib └── Architecture └── lib.so /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | ########################################################################################## 3 | # 4 | # Magisk Module Template Install Script 5 | # by topjohnwu 6 | # 7 | ########################################################################################## 8 | 9 | # Detect whether in boot mode 10 | ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false 11 | $BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true 12 | 13 | # This path should work in any cases 14 | TMPDIR=/dev/tmp 15 | MOUNTPATH=/magisk 16 | IMG=/data/magisk.img 17 | if $BOOTMODE; then 18 | MOUNTPATH=/dev/magisk_merge 19 | IMG=/data/magisk_merge.img 20 | fi 21 | INSTALLER=$TMPDIR/install 22 | MAGISKBIN=/data/magisk 23 | 24 | # Default permissions 25 | umask 022 26 | 27 | # Initial cleanup 28 | rm -rf $TMPDIR 2>/dev/null 29 | mkdir -p $INSTALLER 30 | 31 | ########################################################################################## 32 | # Environment 33 | ########################################################################################## 34 | 35 | OUTFD=$2 36 | ZIP=$3 37 | 38 | ui_print() { 39 | if $BOOTMODE; then 40 | echo "$1" 41 | else 42 | echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD 43 | echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD 44 | fi 45 | } 46 | 47 | require_new_magisk() { 48 | ui_print "***********************************" 49 | ui_print "! $MAGISKBIN isn't setup properly!" 50 | ui_print "! Please install Magisk v14.0+!" 51 | ui_print "***********************************" 52 | exit 1 53 | } 54 | 55 | ui_print "- Mounting /system, /vendor, /data, /cache" 56 | mount -o ro /system 2>/dev/null 57 | mount -o ro /vendor 2>/dev/null 58 | mount /data 2>/dev/null 59 | mount /cache 2>/dev/null 60 | 61 | # Utility functions must exist 62 | [ -f $MAGISKBIN/util_functions.sh ] || require_new_magisk 63 | # Load utility fuctions 64 | . $MAGISKBIN/util_functions.sh 65 | get_outfd 66 | 67 | $BOOTMODE && ! is_mounted /magisk && abort "! Magisk is not activated!" 68 | [ ! -f /system/build.prop ] && abort "! /system could not be mounted!" 69 | 70 | # Detect version and architecture 71 | api_level_arch_detect 72 | 73 | # You can get the Android API version from $API, the CPU architecture from $ARCH 74 | # Useful if you are creating Android version / platform dependent mods 75 | 76 | # We need busybox/binaries to be setup 77 | $BOOTMODE && boot_actions || recovery_actions 78 | 79 | ########################################################################################## 80 | # Preparation 81 | ########################################################################################## 82 | 83 | # Extract common files 84 | unzip -o "$ZIP" module.prop config.sh 'common/*' -d $INSTALLER 2>/dev/null 85 | 86 | [ ! -f $INSTALLER/config.sh ] && abort "! Unable to extract zip file!" 87 | # Load configurations 88 | . $INSTALLER/config.sh 89 | 90 | # Check the min magisk version 91 | MIN_VER=`grep_prop template $INSTALLER/module.prop` 92 | [ ! -z $MAGISK_VER_CODE -a $MAGISK_VER_CODE -ge $MIN_VER ] || require_new_magisk 93 | MODID=`grep_prop id $INSTALLER/module.prop` 94 | MODPATH=$MOUNTPATH/$MODID 95 | 96 | # Print mod name 97 | print_modname 98 | 99 | # Please leave this message in your flashable zip for credits :) 100 | ui_print "******************************" 101 | ui_print "Powered by Magisk (@topjohnwu)" 102 | ui_print "******************************" 103 | 104 | ########################################################################################## 105 | # Install 106 | ########################################################################################## 107 | 108 | request_zip_size_check "$ZIP" 109 | 110 | if [ -f "$IMG" ]; then 111 | ui_print "- Found $IMG" 112 | image_size_check $IMG 113 | if [ "$reqSizeM" -gt "$curFreeM" ]; then 114 | newSizeM=$(((reqSizeM + curUsedM) / 32 * 32 + 64)) 115 | ui_print "- Resizing $IMG to ${newSizeM}M" 116 | $MAGISKBIN/magisk --resizeimg $IMG $newSizeM 117 | fi 118 | else 119 | newSizeM=$((reqSizeM / 32 * 32 + 64)); 120 | ui_print "- Creating $IMG with size ${newSizeM}M" 121 | $MAGISKBIN/magisk --createimg $IMG $newSizeM 122 | fi 123 | 124 | ui_print "- Mounting $IMG to $MOUNTPATH" 125 | MAGISKLOOP=`$MAGISKBIN/magisk --mountimg $IMG $MOUNTPATH` 126 | is_mounted $MOUNTPATH || abort "! $IMG mount failed..." 127 | 128 | # Create mod paths 129 | rm -rf $MODPATH 2>/dev/null 130 | mkdir -p $MODPATH 131 | 132 | ui_print "- Extracting module files" 133 | unzip -o "$ZIP" 'system/*' -d $MODPATH 2>/dev/null 134 | 135 | # Handle replace folders 136 | for TARGET in $REPLACE; do 137 | mktouch $MODPATH$TARGET/.replace 138 | done 139 | 140 | # Auto Mount 141 | $AUTOMOUNT && touch $MODPATH/auto_mount 142 | 143 | # prop files 144 | $PROPFILE && cp -af $INSTALLER/common/system.prop $MODPATH/system.prop 145 | 146 | # Module info 147 | cp -af $INSTALLER/module.prop $MODPATH/module.prop 148 | if $BOOTMODE; then 149 | # Update info for Magisk Manager 150 | mktouch /magisk/$MODID/update 151 | cp -af $INSTALLER/module.prop /magisk/$MODID/module.prop 152 | fi 153 | 154 | # post-fs-data mode scripts 155 | $POSTFSDATA && cp -af $INSTALLER/common/post-fs-data.sh $MODPATH/post-fs-data.sh 156 | 157 | # service mode scripts 158 | $LATESTARTSERVICE && cp -af $INSTALLER/common/service.sh $MODPATH/service.sh 159 | 160 | ui_print "- Setting permissions" 161 | set_permissions 162 | 163 | ########################################################################################## 164 | # Finalizing 165 | ########################################################################################## 166 | 167 | $MAGISKBIN/magisk --umountimg $MOUNTPATH $MAGISKLOOP 168 | rmdir $MOUNTPATH 169 | 170 | # Shrink the image if possible 171 | image_size_check $IMG 172 | newSizeM=$((curUsedM / 32 * 32 + 64)) 173 | if [ $curSizeM -gt $newSizeM ]; then 174 | ui_print "- Shrinking $IMG to ${newSizeM}M" 175 | $MAGISKBIN/magisk --resizeimg $IMG $newSizeM 176 | fi 177 | 178 | $BOOTMODE || recovery_cleanup 179 | rm -rf $TMPDIR 180 | 181 | ui_print "- Done" 182 | exit 0 183 | -------------------------------------------------------------------------------- /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iYTBP for Magisk v3.0 (Discontinued) 2 | 3 | # 11-28-2017 - This module has been discontinued so no more updates will be posted anywhere. Users are encouraged to get the "official" stuff. Using this template will give you an error when building. Smart move, but rather selfish IMO. 4 | 5 | This module works only in Magisk 13.3 and 14.0. Template has been rewritten so there's no backwards compatibility. 6 | 7 | Previous version was based on vemacs' [Adfree YouTube Template](https://forum.xda-developers.com/apps/magisk/module-adfree-youtube-template-t3532753) and Master_T's [iYTBP](https://forum.xda-developers.com/android/apps-games/app-iytbp-injected-youtube-background-t3560900). 8 | 9 | Props go out for ZaneZam, Razerman and laura almeida from XDA for their new [Vanced](https://forum.xda-developers.com/android/apps-games/app-iytbp-injected-youtube-background-t3560900) version which is the new YouTube mod this module is based on. 10 | 11 | Its main purpose is to have an ad-free and background playback, as we had with the the Xposed's module [YouTube Background Play](http://repo.xposed.info/module/com.pyler.youtubebackgroundplayback). 12 | 13 | Inside system/app/YouTube there's a "lib" folder with another named "Architecture" inside. This is, as name suggests, the library folder that contains extra features for YT, i.e. support for 360º videos. To use it properly, you need to rename the folder to "arm", "arm64", "x86" or "x86_64" and place inside the contents of the "lib" folder for the original YT apk. 14 | 15 | It has been tested in AOSP/Lineage based ROMs, Motorola and Samsung's stock ROMs. Just flash it within Magisk Manager or TWRP. 16 | 17 | For downloads please visit the [XDA thread](https://forum.xda-developers.com/apps/magisk/module-iytbp-magisk-t3619705) 18 | 19 | All credit goes to the original developers, I just put stuff together. 20 | -------------------------------------------------------------------------------- /changelog.txt: -------------------------------------------------------------------------------- 1 | v1 2 | 06/10/17 - Initial release. 3 | 4 | v2 5 | 07/23/17 - Rewritten module based on new Magisk Template to work with v13+ 6 | 7 | v2.5 8 | 08/24/17 - Added "Replace" flag in config.sh 9 | 10 | v3.0 11 | 09/06/17 - Updated template to v1400 12 | -------------------------------------------------------------------------------- /common/post-fs-data.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Please don't hardcode /magisk/modname/... ; instead, please use $MODDIR/... 3 | # This will make your scripts compatible even if Magisk change its mount point in the future 4 | MODDIR=${0%/*} 5 | 6 | # This script will be executed in post-fs-data mode 7 | # More info in the main Magisk thread 8 | -------------------------------------------------------------------------------- /common/service.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Please don't hardcode /magisk/modname/... ; instead, please use $MODDIR/... 3 | # This will make your scripts compatible even if Magisk change its mount point in the future 4 | MODDIR=${0%/*} 5 | 6 | # This script will be executed in late_start service mode 7 | # More info in the main Magisk thread 8 | -------------------------------------------------------------------------------- /common/system.prop: -------------------------------------------------------------------------------- 1 | # This file will be read by resetprop 2 | # Example: Change dpi 3 | # ro.sf.lcd_density=320 4 | -------------------------------------------------------------------------------- /config.sh: -------------------------------------------------------------------------------- 1 | ########################################################################################## 2 | # 3 | # Magisk Module Template Config Script 4 | # by topjohnwu 5 | # 6 | ########################################################################################## 7 | ########################################################################################## 8 | # 9 | # Instructions: 10 | # 11 | # 1. Place your files into system folder (delete the placeholder file) 12 | # 2. Fill in your module's info into module.prop 13 | # 3. Configure the settings in this file (common/config.sh) 14 | # 4. For advanced features, add shell commands into the script files under common: 15 | # post-fs-data.sh, service.sh 16 | # 5. For changing props, add your additional/modified props into common/system.prop 17 | # 18 | ########################################################################################## 19 | 20 | ########################################################################################## 21 | # Configs 22 | ########################################################################################## 23 | 24 | # Set to true if you need to enable Magic Mount 25 | # Most mods would like it to be enabled 26 | AUTOMOUNT=true 27 | 28 | # Set to true if you need to load system.prop 29 | PROPFILE=false 30 | 31 | # Set to true if you need post-fs-data script 32 | POSTFSDATA=false 33 | 34 | # Set to true if you need late_start service script 35 | LATESTARTSERVICE=false 36 | 37 | ########################################################################################## 38 | # Installation Message 39 | ########################################################################################## 40 | 41 | # Set what you want to show when installing your mod 42 | 43 | print_modname() { 44 | ui_print "******************************" 45 | ui_print " iYTBP for Magisk " 46 | ui_print " by m0yP " 47 | ui_print "******************************" 48 | } 49 | 50 | ########################################################################################## 51 | # Replace list 52 | ########################################################################################## 53 | 54 | # List all directories you want to directly replace in the system 55 | # By default Magisk will merge your files with the original system 56 | # Directories listed here however, will be directly mounted to the correspond directory in the system 57 | 58 | # You don't need to remove the example below, these values will be overwritten by your own list 59 | # This is an example 60 | REPLACE=" 61 | /system/app/Youtube 62 | /system/priv-app/SystemUI 63 | /system/priv-app/Settings 64 | /system/framework 65 | " 66 | 67 | # Construct your own list here, it will overwrite the example 68 | # !DO NOT! remove this if you don't need to replace anything, leave it empty as it is now 69 | REPLACE=" 70 | /system/app/YouTube 71 | " 72 | 73 | ########################################################################################## 74 | # Permissions 75 | ########################################################################################## 76 | 77 | set_permissions() { 78 | # Only some special files require specific permissions 79 | # The default permissions should be good enough for most cases 80 | 81 | # Here are some examples for the set_perm functions: 82 | 83 | # set_perm_recursive (default: u:object_r:system_file:s0) 84 | # set_perm_recursive $MODPATH/system/lib 0 0 0755 0644 85 | 86 | # set_perm (default: u:object_r:system_file:s0) 87 | # set_perm $MODPATH/system/bin/app_process32 0 2000 0755 u:object_r:zygote_exec:s0 88 | # set_perm $MODPATH/system/bin/dex2oat 0 2000 0755 u:object_r:dex2oat_exec:s0 89 | # set_perm $MODPATH/system/lib/libart.so 0 0 0644 90 | 91 | # The following is default permissions, DO NOT remove 92 | set_perm_recursive $MODPATH 0 0 0755 0644 93 | set_perm $MODPATH/system/app/YouTube/YouTube.apk 0 0 0644 94 | } 95 | -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=iYTBPforMagisk 2 | name=iYTBP for Magisk 3 | version=v3.0 4 | versionCode=3.0 5 | author=m0yP 6 | description=Ad-free YouTube with background play 7 | template=1400 8 | -------------------------------------------------------------------------------- /system/app/YouTube/YouTube.apk: -------------------------------------------------------------------------------- 1 | Dummy file. 2 | -------------------------------------------------------------------------------- /system/app/YouTube/lib/Architecture/lib.so: -------------------------------------------------------------------------------- 1 | Dummy file. 2 | --------------------------------------------------------------------------------