未找到超级用户活动

A. *_* K. 5 android root android-intent

超级用户应用程序已安装在我的手机上,但在尝试发出超级用户请求时,我的应用程序出现了以下错误:

18820-18820/com.anth.res E/AndroidRuntime: FATAL EXCEPTION: main
    android.content.ActivityNotFoundException: No Activity found to handle Intent { act=act=android.intent.action.superuser (has extras) }
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1512)
    ...
Run Code Online (Sandbox Code Playgroud)

这是我的活动的要求:

command = "su -c \""+command+"\"";
Intent intent = new Intent("android.intent.action.superuser"); // superuser request
intent.putExtra("name", getResources().getString(R.string.app_name)); // tell Superuser the name of the requesting app
intent.putExtra("packagename", "com.anth.res"); // tel Superuser the name of the requesting package
startActivityForResult(intent, SU_REQUEST); // make the request!
Run Code Online (Sandbox Code Playgroud)

Lam*_*ard 1

请检查您的清单文件。您是否正确声明了您的活动,如下所示:

<activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
Run Code Online (Sandbox Code Playgroud)