Quantcast
Channel: xda-developers - Android Q&A, Help & Troubleshooting
Viewing all articles
Browse latest Browse all 18891

[Q] [Help] Adding Su to build

$
0
0
I'm in the process of learning to build android from source. I've got my AOKP rom booting and am working on adding superuser to it, and am running into troubles. After much googling here is what I've done

Cloned Superuser source code

Code:

git clone git://github.com/ChainsDD/Superuser.git packages/apps/Superuser
Copied the su binary from my current rom (/system/xbin/su) to my device tree

Edited device.mk

Code:

# Build superuser
PRODUCT_PACKAGES := \
        Superuser

# copy su binary
PRODUCT_COPY_FILES += \
      device/lge/E973/su:system/xbin/su

Everything built fine and Superuser is in my app drawer when rom boots. If i try to open Superuser it force closes. Root checker shows that i am rooted, and typing 'su' in terminal emulator gets root access. Neither will give me a dialog asking to deny or grant.

If i install SuperSuperuser from the market, it will present all the normal dialogs and everything seems as it should.

I'm wondering what it is I'm doing wrong, and how I can correct it.

Here is a logcat of the failed attempt to open superuser
Code:

D/dalvikvm( 2157): Late-enabling CheckJNI
I/ActivityManager(  530): Start proc com.noshufou.android.su for activity com.noshufou.android.su/.Su: pid=2157 uid=10040 gids={50040, 3003, 1015, 1028}
I/dalvikvm( 2157): Turning on JNI app bug workarounds for target SDK version 11...
D/overlay (  161): FROM_STATE = OV_BYPASS_3_LAYER TO_STATE = OV_CLOSED
I/ActivityThread( 2157): Pub com.noshufou.android.su.provider: com.noshufou.android.su.provider.PermissionsProvider
D/Su.HomeActivity( 2157): onCreate()
D/AndroidRuntime( 2157): Shutting down VM
W/dalvikvm( 2157): threadid=1: thread exiting with uncaught exception (group=0x40dd7930)
E/AndroidRuntime( 2157): FATAL EXCEPTION: main
E/AndroidRuntime( 2157): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.noshufou.android.su/com.noshufou.android.su.HomeActivity}: java.lang.RuntimeException: java.lang.NoSuchMethodException: <init> [class android.app.Activity, int]
E/AndroidRuntime( 2157):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2306)
E/AndroidRuntime( 2157):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2356)
E/AndroidRuntime( 2157):        at android.app.ActivityThread.access$600(ActivityThread.java:150)
E/AndroidRuntime( 2157):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)
E/AndroidRuntime( 2157):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2157):        at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 2157):        at android.app.ActivityThread.main(ActivityThread.java:5193)
E/AndroidRuntime( 2157):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2157):        at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 2157):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
E/AndroidRuntime( 2157):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
E/AndroidRuntime( 2157):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2157): Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: <init> [class android.app.Activity, int]
E/AndroidRuntime( 2157):        at com.actionbarsherlock.ActionBarSherlock.wrap(ActionBarSherlock.java:232)
E/AndroidRuntime( 2157):        at com.actionbarsherlock.app.SherlockFragmentActivity.getSherlock(SherlockFragmentActivity.java:32)
E/AndroidRuntime( 2157):        at com.actionbarsherlock.app.SherlockFragmentActivity.requestWindowFeature(SherlockFragmentActivity.java:265)
E/AndroidRuntime( 2157):        at com.noshufou.android.su.HomeActivity.onCreate(HomeActivity.java:59)
E/AndroidRuntime( 2157):        at android.app.Activity.performCreate(Activity.java:5104)
E/AndroidRuntime( 2157):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
E/AndroidRuntime( 2157):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2260)
E/AndroidRuntime( 2157):        ... 11 more
E/AndroidRuntime( 2157): Caused by: java.lang.NoSuchMethodException: <init> [class android.app.Activity, int]
E/AndroidRuntime( 2157):        at java.lang.Class.getConstructorOrMethod(Class.java:460)
E/AndroidRuntime( 2157):        at java.lang.Class.getConstructor(Class.java:431)
E/AndroidRuntime( 2157):        at com.actionbarsherlock.ActionBarSherlock.wrap(ActionBarSherlock.java:229)
E/AndroidRuntime( 2157):        ... 17 more
W/ActivityManager(  530):  Force finishing activity com.noshufou.android.su/.Su
D/dalvikvm( 2157): GC_CONCURRENT freed 219K, 15% free 2489K/2912K, paused 2ms+1ms, total 21ms
I/dalvikvm(  530): Jit: resizing JitTable from 8192 to 16384
W/ActivityManager(  530): Activity pause timeout for ActivityRecord{41681370 u0 com.noshufou.android.su/.Su}
I/Process ( 2157): Sending signal. PID: 2157 SIG: 9
I/ActivityManager(  530): Process com.noshufou.android.su (pid 2157) has died.
W/InputMethodManagerService(  530): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@413af670 attribute=null, token = android.os.BinderProxy@413e2630
D/dalvikvm(  530): GC_CONCURRENT freed 7964K, 44% free 13574K/23868K, paused 2ms+6ms, total 57ms
D/overlay (  161): FROM_STATE = OV_CLOSED TO_STATE = OV_BYPASS_3_LAYER


Viewing all articles
Browse latest Browse all 18891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>