RikkaApps / Sui

Modern super user interface implementation on Android.
GNU General Public License v3.0
2.39k stars 129 forks source link

Does not copy rish automatically #72

Closed ghost closed 6 months ago

ghost commented 7 months ago

I have this Shizuku app before for my SDMaid SE but inside Shizuku there's a dialogue if I'm using Magisk use sui instead so I install Sui and follow the instruction to rename the post-install.example.sh to post-install.sh and a Sui shortcut appear on my home screen but there's no rish on my data/local/tmp the only left there are the data of my uninstalled Shizuku app name shizuku json and shizuku_starter, do I need to delete those? I also look on teemux folder but there are no rish. I think my sui is not working just a shorcut on my home screen that don't do anything yet.

0xSoul24 commented 7 months ago

if you read the README then you should know that u must modify the post-install.sh to make it work, i done that myself, extract the zip, copy the post-install.example.sh and its sha256 and rename them without .example, make sure that in your customize.sh u have these 2 lines: extract "$ZIPFILE" 'post-install.sh' "$ROOT_PATH" set_perm "$ROOT_PATH/post-install.sh" 0 0 0600

in post-install.sh uncomment the adb lines you must have something like this: mkdir -p /data/adb/modules_update/zygisk-sui/system/bin/ ui_print "- Copy rish to /data/local/tmp (for adb)" copy_rish com.android.shell 2000 /data/local/tmp (random_name)

Add Rish to PATH

ln -s /data/local/tmp/(random_name) /data/adb/modules_update/zygisk-sui/system/bin/rish ln -s /data/local/tmp/(random_name).dex /data/adb/modules_update/zygisk-sui/system/bin/rish.dex ln -s /data/local/tmp/librish.so /data/adb/modules_update/zygisk-sui/system/bin/

if you want to copy it to Termux you can use these lines copy_rish com.termux $APP_UID /data/user/0/com.termux/files/usr/bin rish

after that save the file and in a terminal do sha256sum post-install.sh this will give you the sum, open the post-install.sh.sha256sum and replace the old content with the new one repack the zip, transfer to tour device and flash

BTW SDMaid SE System Cleaner will list the rish files for delete so better add an exclusion rule for them

ghost commented 7 months ago

@0xSoul24 man I can't understand this line sorry I'm a noob can you explain it in an easy way.

in post-install.sh uncomment the adb lines you must have something like this: mkdir -p /data/adb/modules_update/zygisk-sui/system/bin/ ui_print "- Copy rish to /data/local/tmp (for adb)" copy_rish com.android.shell 2000 /data/local/tmp (random_name)

Add Rish to PATH

ln -s /data/local/tmp/(random_name) /data/adb/modules_update/zygisk-sui/system/bin/rish ln -s /data/local/tmp/(random_name).dex /data/adb/modules_update/zygisk-sui/system/bin/rish.dex ln -s /data/local/tmp/librish.so /data/adb/modules_update/zygisk-sui/system/bin/

And this...

after that save the file and in a terminal do sha256sum post-install.sh this will give you the sum, open the post-install.sh.sha256sum and replace the old content with the new one repack the zip, transfer to tour device and flash

Do I need to delete these lines?

This script will be loaded during the installation process of Sui.

#

It's designed to automatically copy rish.

rish is an Android program for interacting with a shell that runs on a high-privileged daemon process (Sui server).

#

Rename this file to /data/adb/sui/post-install.sh to allow this script to be loaded.

This line is required. And those who have the "Example:" lines

0xSoul24 commented 7 months ago

imagen imagen

Any line that is commented can be safely ignored because the only reason they are there is to give people guidance on how to do things

when modifying the zip contents you must take the new sh256 of the respective files you modified, in this case i modified customize.sh and post-install.sh, that means that in a terminal i must do "sha256sum customize.sh", grab the output, open the customize.sh.sha256sum and replace the old sum with the new one, repeat for post-install.sh

imagen imagen

After saving the files proceed to zip all and have the modified module ready to install imagen

ghost commented 7 months ago

@0xSoul24 I will now just follow the screen shot you just presented to me to become easy for me. The one will bother me now is the "terminal do" thing. What do you mean do I need a terminal emulator? What terminal? Or I will do is open the customized.sh.sha256sum and get the code inside and paste/replace the code inside the post-install.sh.sha256sum?

0xSoul24 commented 7 months ago

I did all these steps in my laptop, i use terminal bc im using linux but if u have windows you can install hashtab and see the sums in file properties

ghost commented 7 months ago

@0xSoul24 I already got the checksum of those 2 using an android application name Hash Checker because when I use Termux it say No such file or directory. Last question, if I want to copy rish on adb, do I also need to edit the Copy to Termux line just how you teach earlier or just leave or delete it?

0xSoul24 commented 7 months ago

the termux line is already designed to be directly copied into Temux's local bin so after flashing and rebooting u just can do "rish" so no modification is needed there

ghost commented 7 months ago

@0xSoul24 thank you for the help sir. Your work give me idea of what to do I just made a little adjustment on your code I replace your modules_update to module only cause there's no modules_update on my data/adb it's module only. I don't know why @RikkaW didn't complete the code inside post-install.sh like you do to make it easy to use if you don't have knowledge on linux like me you can't install his work correctly. I will install it now and make a follow up afterwards.

0xSoul24 commented 7 months ago

if you are using magisk, dont! because modules_update is a folder magisk creates with newly flashed modules before rebooting, that means that when you reboot, the sui folder inside modules_update moves to modules. i tried the same u did at first but didnt add the rish to path because sui folder in modules didnt exist yet 1st time i flashed and the linked bins would never exist in /system/bin

ghost commented 7 months ago

@0xSoul24 yeah you're right. I repeat and done, rish and other files are now link on my system/bin. Now the question is how do I know if sui is working? I don't see any difference on with and without rish. Is sui a superuser? Because I try to revoke the superuser rights of my app on my magisk and open the app again but the grants return on magisk not on sui. Am I correct on understanding sui or I'm wrong.

0xSoul24 commented 7 months ago

start by reconfiguring the SDMaid SE's shizuku config, or you can try typing rish in Termux, in both cases a permission dialog should show up

ghost commented 7 months ago

@0xSoul24 Is sui a superuser? Because I try to revoke the superuser rights of my app on my magisk and open the app again but the grants return on magisk not on sui. Am I correct on understanding sui or I'm wrong.

0xSoul24 commented 7 months ago

it is because its name stands for "Super User Interface" and when i do a whoami after executing rish in termux it returns "root"

0xSoul24 commented 7 months ago

Screenshot_20231112-021826 Screenshot_20231112-023212 Captura desde 2023-11-12 02-32-41

ghost commented 7 months ago

@0xSoul24 I try what you said and Termux and SD Maid SE grant a superuser rights on them but on other hand other app are still in Magisk supersu grant. Do I need to disable superuser Access of my Magisk to be able to use sui supersu grants?

0xSoul24 commented 7 months ago

not really, both can be enabled safely, when u grant acces via SUI you must control it with the applet, open your app menu and long press the settings app, a SUI shortcut for homescreen should show up SUI permissions will work only with Shizuku compatible apps, so u can try giving magisk permission for conventional root apps and SUI permission for shizuku enabled apps

ghost commented 7 months ago

@0xSoul24 I try your method and @RikkaW method and they're working exactly just the same but I prefer the Rikka method, it's so simple and easy to edit I just remove the hash sign of some line and edit the rish name and I'm ready to go. I got that idea because of you I got a little knowledge because of your work even though I don't use your method I thank you for teaching me.