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

Commit

Permalink
Just One Last Dance
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Feb 2, 2022
1 parent b5636a7 commit 125daf3
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 16 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Deprecated

All Riru users and Riru modules should migrate to Zygisk.

# Riru

Riru only does one thing, inject into zygote in order to allow modules to run their codes in apps or the system server.
Expand Down
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStorePath=wrapper/dists
4 changes: 3 additions & 1 deletion riru/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ android {
path "src/main/cpp/CMakeLists.txt"
}
}
lintOptions.checkReleaseBuilds false
dependenciesInfo.includeInApk false
lint {
checkReleaseBuilds false
}
}

dependencies {
Expand Down
4 changes: 3 additions & 1 deletion rirud/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ android {
proguardFiles 'proguard-rules.pro'
}
}
lintOptions.checkReleaseBuilds false
dependenciesInfo.includeInApk false
lint {
checkReleaseBuilds false
}
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ pluginManagement {
mavenCentral()
}
plugins {
id 'com.android.application' version '7.0.3'
id 'com.android.library' version '7.0.3'
id 'com.android.application' version '7.1.0'
id 'com.android.library' version '7.1.0'
}
}

Expand Down
8 changes: 8 additions & 0 deletions template/magisk_module/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Deprecated

All Riru users and Riru modules should migrate to Zygisk.

# Riru

Riru only does one thing, inject into zygote in order to allow modules run their codes in apps or the system server.
Expand Down Expand Up @@ -32,6 +36,10 @@ Many TWRP has broken implementations, which will finally cause Riru and Riru mod

## Changelog

### v26.1.5 (2022-2-2)
- THIS IS THE LAST RELEASE. MODULES AND USERS SHOULD MIGRATE TO ZYGISK.
- Fix description hint

### v26.1.4 (2021-12-15)
- Skip launching Rirud when Zygisk is enabled
- Fix `sonext` update during hiding
Expand Down
18 changes: 11 additions & 7 deletions template/magisk_module/post-fs-data.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
#!/system/bin/sh
MODDIR=${0%/*}
if [ -z "$SHELL" ]; then
export SHELL=sh
TMPPROP="$(magisk --path)/riru.prop"
MIRRORPROP="$(magisk --path)/.magisk/modules/riru-core/module.prop"
sh -Cc "cat '$MODDIR/module.prop' > '$TMPPROP'"
if [ $? -ne 0 ]; then
exit
fi
cp -f "$MODDIR/module.prop.bk" "$MODDIR/module.prop"
mount --bind "$TMPPROP" "$MIRRORPROP"
if [ "$ZYGISK_ENABLE" = "1" ]; then
sed -Ei 's/^description=(\[.*][[:space:]]*)?/description=[ Riru is not loaded because of Zygisk. ] /g' "$MODDIR/module.prop"
sed -Ei 's/^description=(\[.*][[:space:]]*)?/description=[ Riru is not loaded because of Zygisk. ] /g' "$MIRRORPROP"
exit
fi
sed -Ei 's/^description=(\[.*][[:space:]]*)?/description=[ app_process fails to run. ] /g' "$MODDIR/module.prop"
export CLASSPATH=$MODDIR/rirud.apk
cd $MODDIR
sed -Ei 's/^description=(\[.*][[:space:]]*)?/description=[ ⛔ app_process fails to run. ] /g' "$MIRRORPROP"
cd "$MODDIR" || exit
flock "module.prop"
mount --bind "$TMPPROP" "$MODDIR/module.prop"
unshare -m sh -c "/system/bin/app_process -Djava.class.path=rirud.apk /system/bin --nice-name=rirud riru.Daemon $(magisk -V) $(magisk --path) $(getprop ro.dalvik.vm.native.bridge)&"
umount "$MODDIR/module.prop"
11 changes: 8 additions & 3 deletions template/magisk_module/service.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/system/bin/sh
MODDIR=${0%/*}
if [ -z "$SHELL" ]; then
export SHELL=sh
TMPPROP="$(magisk --path)/riru.prop"
MIRRORPROP="$(magisk --path)/.magisk/modules/riru-core/module.prop"
sh -Cc "cat '$MODDIR/module.prop' > '$TMPPROP'"
if [ $? -eq 0 ]; then
mount --bind "$TMPPROP" "$MIRRORPROP"
sed -Ei 's/^description=(\[.*][[:space:]]*)?/description=[ ⛔ post-fs-data.sh fails to run. Magisk is broken on this device. ] /g' "$MODDIR/module.prop"
exit
fi
flock -n "$MODDIR/module.prop" -c "sed -Ei 's/^description=(\[.*][[:space:]]*)?/description=[ post-fs-data.sh fails to run. Magisk is broken on this device. ] /g' \"$MODDIR/module.prop\""

0 comments on commit 125daf3

Please sign in to comment.