RikkaApps / Riru

Inject into zygote process
4.89k stars 566 forks source link

Can't install riru core #240

Closed nik2143 closed 3 years ago

nik2143 commented 3 years ago

Information:

Logs:

Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: module.prop
**********
 Riru 
 by Rikka 
**********
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: customize.sh
*******************
 Powered by Magisk 
*******************
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: verify.sh
- Installing from Magisk app
- Installing Riru v25.4.4.r426.05efc94 (Riru API 25)
- Magisk version: 23.0 (23000)
- Device sdk: 28
- Device platform: arm64
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
   creating: META-INF/com/google/android/
  inflating: META-INF/com/google/android/update-binary
  inflating: META-INF/com/google/android/updater-script
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: customize.sh
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: customize.sh.sha256sum
- Download from Magisk app
- Verified customize.sh
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: verify.sh
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: verify.sh.sha256sum
- Verified verify.sh
- Extracting Magisk files
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: module.prop
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: module.prop.sha256sum
- Verified module.prop
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: post-fs-data.sh
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: post-fs-data.sh.sha256sum
- Verified post-fs-data.sh
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: service.sh
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: service.sh.sha256sum
- Verified service.sh
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: system.prop
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: system.prop.sha256sum
- Verified system.prop
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: util_functions.sh
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: util_functions.sh.sha256sum
- Verified util_functions.sh
mkdir: can't create directory '/sbin/.magisk/modules/riru-core': File exists
- Extracting arm libraries
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: libriru.so
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: libriru.so.sha256sum
- Verified lib/armeabi-v7a/libriru.so
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: libriruhide.so
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: libriruhide.so.sha256sum
- Verified lib/armeabi-v7a/libriruhide.so
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: libriruloader.so
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: libriruloader.so.sha256sum
- Verified lib/armeabi-v7a/libriruloader.so
- Extracting arm64 libraries
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: libriru.so
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: libriru.so.sha256sum
- Verified lib/arm64-v8a/libriru.so
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: libriruhide.so
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: libriruhide.so.sha256sum
- Verified lib/arm64-v8a/libriruhide.so
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: libriruloader.so
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: libriruloader.so.sha256sum
- Verified lib/arm64-v8a/libriruloader.so
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: librirud.so
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: librirud.so.sha256sum
- Verified lib/arm64-v8a/librirud.so
- Setting permissions
- Moving rirud
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: classes.dex
Archive:  /storage/emulated/0/Download/Riru-v25.4.4.r426.05efc94(426).zip
  inflating: classes.dex.sha256sum
- Extracting rirud.dex
- Verified classes.dex
- Checking if your ROM has incorrect SELinux rules
! Your ROM has incorrect SELinux rules
! Open detailed explain page in 5s...
Starting: Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=https://github.com/... }

! Installation failed  

Describe the bug:

I get the error Your ROM has incorrect SELinux rules but the rule that tell the page isn't there

RikkaW commented 3 years ago

https://github.com/RikkaApps/Riru/wiki/Explanation-about-incorrect-SELinux-rules-from-third-party-ROMs-cause-Riru-not-working

nik2143 commented 3 years ago

https://github.com/RikkaApps/Riru/wiki/Explanation-about-incorrect-SELinux-rules-from-third-party-ROMs-cause-Riru-not-working

Talked with mantainer that confirmed that don't use this rule Is there a way to check if the rule is there?

RikkaW commented 3 years ago

https://github.com/RikkaApps/Riru/issues/203#issuecomment-806343701

Use magiskpolicy --save to save current policies to a file and use sesearch, sesearch --allow -s init -t system_file -p relabelfrom, to check if init has the permission.

nik2143 commented 3 years ago

#203 (comment)

Use magiskpolicy --save to save current policies to a file and use sesearch, sesearch --allow -s init -t system_file -p relabelfrom, to check if init has the permission.

I tried the commands and I got 0 search results This mens that the rule isn't there?

RikkaW commented 3 years ago

Can you upload your policy dump?

nik2143 commented 3 years ago

Can you upload your policy dump?

policy.zip

RikkaW commented 3 years ago

The policy you provide doesn't seem to have problems. I'm wondering if app_process cannot run on your device.

Try this build (https://github.com/RikkaApps/Riru/actions/runs/1043646760). You don't need to install the zip.

  1. Extract rirud.apk from the zip to "somewhere"
  2. Run this command in any terminal app or adb shell (replace the "somewhere" in the command)
su
/system/bin/app_process -Djava.class.path="somewhere/rirud.apk" /system/bin --nice-name=riru_installer riru.Installer --check-selinux
  1. Send the output here
nik2143 commented 3 years ago
greatlte:/ # su
greatlte:/ # /system/bin/app_process -Djava.class.path="/storage/emulated/0/rirud.apk" /system/bin --nice-name=riru_installer riru.Installer --check-selinux
- Start checks...
! Your ROM allows init to relabel Magisk module files
! Your ROM allows init to relabel Magisk module files 
RikkaW commented 3 years ago

This is so weird. That check uses android.os.SELinux#checkSELinuxAccess which will finally call selinux_check_access from libselinux. It should not report the different results from research. Can you check the file context with ls -laZ /data/adb/modules/riru-core?

Anyway, this check will not stop installation in the next version.

nik2143 commented 3 years ago

__

This is so weird. That check uses android.os.SELinux#checkSELinuxAccess which will finally call selinux_check_access from libselinux. It should not report the different results from research. Can you check the file context with ls -laZ /data/adb/modules/riru-core?

Anyway, this check will not stop installation in the next version.

greatlte:/ # ls -laZ /data/adb/modules/riru-core
total 32
drwxr-xr-x 3 root root u:object_r:system_file:s0 4096 2021-07-12 16:48 .
drwxr-xr-x 9 root root u:object_r:system_file:s0 4096 2021-04-29 20:35 ..
-rw-r--r-- 1 root root u:object_r:system_file:s0  180 2020-08-16 17:20 module.prop
-rw-r--r-- 1 root root u:object_r:system_file:s0 1002 2020-08-16 17:20 post-fs-data.sh
-rw-r--r-- 1 root root u:object_r:system_file:s0   71 2020-08-16 17:20 sepolicy.rule
drwxr-xr-x 4 root root u:object_r:system_file:s0 4096 2020-08-16 17:20 system
-rw-r--r-- 1 root root u:object_r:system_file:s0  133 2020-08-16 17:20 uninstall.sh
-rw-r--r-- 1 root root u:object_r:system_file:s0 1575 2021-07-12 16:48 util_functions.sh
nik2143 commented 3 years ago

Anyway I want to confirm that installing the 26.0.3 everything work right