tiann / KernelSU

A Kernel based root solution for Android
https://kernelsu.org
GNU General Public License v3.0
10.48k stars 1.71k forks source link

Manager cannot work when installed in `/system/app` #559

Closed YT-Advanced closed 1 year ago

YT-Advanced commented 1 year ago

Describe the bug App cannot access su and cannot open SuperUser tab in WSA

To Reproduce Steps to reproduce the behavior:

  1. Create KernelSU folder in /system/app/ then copy the apk here
  2. Extract app library and copy to KernelSU folder too
  3. Grant access for all file and subdirectory
  4. Copy kernel image from Release
  5. Boot device, the app start normally but stuck at SuperUser tab.

Expected behavior KernelSU should work correctly

Screenshots image

Smartphone (please complete the following information):

Additional context

Log ### Logcat ``` 05-29 13:31:28.700 1634 1634 I KernelSU: ksud::cli: command: Debug { command: Su } 05-29 13:31:28.718 1634 1634 E KernelSU: ksud::cli: Error: grant root failed 05-29 13:31:28.730 1541 1541 E KsuCli : su failed: 05-29 13:31:28.730 1541 1541 E KsuCli : h4.a: Unable to create a shell! 05-29 13:31:28.730 1541 1541 E KsuCli : at d6.v.h(Unknown Source:44) 05-29 13:31:28.730 1541 1541 E KsuCli : at r5.d.(Unknown Source:27) 05-29 13:31:28.730 1541 1541 E KsuCli : at s5.j.d(Unknown Source:101) 05-29 13:31:28.730 1541 1541 E KsuCli : at n5.q0.h(Unknown Source:42) 05-29 13:31:28.730 1541 1541 E KsuCli : at q4.a.i(Unknown Source:8) 05-29 13:31:28.730 1541 1541 E KsuCli : at g5.d0.run(Unknown Source:104) 05-29 13:31:28.730 1541 1541 E KsuCli : at androidx.compose.ui.platform.u0.K(Unknown Source:22) 05-29 13:31:28.730 1541 1541 E KsuCli : at androidx.compose.ui.platform.t0.run(Unknown Source:2) 05-29 13:31:28.730 1541 1541 E KsuCli : at android.os.Handler.handleCallback(Handler.java:942) 05-29 13:31:28.730 1541 1541 E KsuCli : at android.os.Handler.dispatchMessage(Handler.java:99) 05-29 13:31:28.730 1541 1541 E KsuCli : at android.os.Looper.loopOnce(Looper.java:201) 05-29 13:31:28.730 1541 1541 E KsuCli : at android.os.Looper.loop(Looper.java:288) 05-29 13:31:28.730 1541 1541 E KsuCli : at android.app.ActivityThread.main(ActivityThread.java:7884) 05-29 13:31:28.730 1541 1541 E KsuCli : at java.lang.reflect.Method.invoke(Native Method) 05-29 13:31:28.730 1541 1541 E KsuCli : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 05-29 13:31:28.730 1541 1541 E KsuCli : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) 05-29 13:31:28.730 1541 1541 E KsuCli : Caused by: java.io.IOException: Created process is not a shell 05-29 13:31:28.730 1541 1541 E KsuCli : at i4.c0.call(Unknown Source:267) 05-29 13:31:28.730 1541 1541 E KsuCli : at java.util.concurrent.FutureTask.run(FutureTask.java:264) 05-29 13:31:28.730 1541 1541 E KsuCli : at i4.b0.call(Unknown Source:17) 05-29 13:31:28.730 1541 1541 E KsuCli : at java.util.concurrent.FutureTask.run(FutureTask.java:264) 05-29 13:31:28.730 1541 1541 E KsuCli : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 05-29 13:31:28.730 1541 1541 E KsuCli : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 05-29 13:31:28.730 1541 1541 E KsuCli : at java.lang.Thread.run(Thread.java:1012) ```
hmtheboy154 commented 1 year ago

You guys should just focusing on auto install it as user app

YT-Advanced commented 1 year ago

You guys should just focusing on auto install it as user app

Yes, but cannot do it :))) Do you have any idea ?

hmtheboy154 commented 1 year ago

on the last post I'm saying "What's wrong" but there's no answer maybe because of "pending" status of the reply

anyway, what's wrong ?

YT-Advanced commented 1 year ago

anyway, what's wrong ?

We have problem with init.rc file. It didn't start the task :(

hmtheboy154 commented 1 year ago

anyway, what's wrong ?

We have problem with init.rc file. It didn't start the task :(

check the log yet ?

hmtheboy154 commented 1 year ago

from what I see on you guys code, you put script to run just like what Android-x86 did, running it in logwrapper so there should be a log of it running, so you can see what's going on. Otherwise try to put it somewhere else other than /bin like /etc

YT-Advanced commented 1 year ago

@hmtheboy154 Sorry about my late reply. I have tested with logwrapper before but it didn't show any log

tiann commented 1 year ago

KernelSU does not support installing the manager in /system/app or /system/priv-app, as this is easily detected; if you want to embed an app, it is recommended to install it through the pm command after boot.