Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Remove Magisk v20.2+ requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkaW committed Nov 26, 2020
1 parent 4a672df commit b432f96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@ Riru only does one thing, inject into zygote in order to allow modules run their
## Requirements

Android 6.0+ devices rooted with [Magisk](https://github.com/topjohnwu/Magisk) v20.2+

> Magisk v20.2 is the first version support pre-init sepolicy patch from modules, which is necessary for Riru.
Android 6.0+ devices rooted with [Magisk](https://github.com/topjohnwu/Magisk)

## Guide

### Install

**IMPORTANT: Before Magisk v21.1, you MUST manual restart twice for the first installation.**

* From Magisk Manager

1. Search "Riru" in Magisk Manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ ui_print() { echo "$1"; }

require_new_magisk() {
ui_print "*******************************"
ui_print " Riru requires features provided by Magisk v20.2+"
ui_print " Please install Magisk v20.2+! "
ui_print " Please install Magisk v19.0+! "
ui_print "*******************************"
exit 1
}
Expand All @@ -28,7 +27,7 @@ mount /data 2>/dev/null

[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
. /data/adb/magisk/util_functions.sh
[ $MAGISK_VER_CODE -lt 20200 ] && require_new_magisk
[ $MAGISK_VER_CODE -lt 19000 ] && require_new_magisk

if [ $MAGISK_VER_CODE -ge 20400 ]; then
# New Magisk have complete installation logic within util_functions.sh
Expand Down
16 changes: 1 addition & 15 deletions template/magisk_module/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ ui_print "- Installing Riru $RIRU_VERSION_NAME ($RIRU_VERSION_CODE, API v$RIRU_A

# check Magisk
ui_print "- Magisk version: $MAGISK_VER ($MAGISK_VER_CODE)"
if [ "$MAGISK_VER_CODE" -lt 20200 ]; then
ui_print "*******************************"
ui_print " Riru requires features provided by Magisk v20.2+"
ui_print " Please install Magisk v20.2+! "
ui_print "*******************************"
exit 1
fi

# check android
if [ "$API" -lt 23 ]; then
Expand Down Expand Up @@ -104,11 +97,4 @@ echo -n "$RIRU_API" > "$RIRU_PATH/api_version.new"
set_perm "$RIRU_PATH/api_version.new" 0 0 0600 $SECONTEXT

ui_print "- Setting permissions"
set_perm_recursive "$MODPATH" 0 0 0755 0644

# before Magisk 16e4c67, sepolicy.rule is copied on the second reboot
if [ "$MAGISK_VER_CODE" -lt 21006 ]; then
ui_print "*******************************"
ui_print "- Before Magisk v21.1, you will have to manually reboot twice for the first time installation."
ui_print "*******************************"
fi
set_perm_recursive "$MODPATH" 0 0 0755 0644

0 comments on commit b432f96

Please sign in to comment.