Re: Security help

158 views
Skip to first unread message
Message has been deleted

Christopher Tate

unread,
Jul 17, 2009, 2:06:08 PM7/17/09
to android-...@googlegroups.com
The very first line of the error log that you pasted:

> E/ServiceManager( 533): add_service('simphonebook',0x2b) uid=10006 -
> PERMISSION DENIED

tells you that your application is not running as the system user,
which would be uid 1000. Only system apps are allowed to register
system services. To have your application run as the system user, its
manifest needs to declare android:sharedUserId="android.uid.system".

I also see that you have a class
com.android.smithmyers.mobilepowersurvey.MobilePowerSurvey -- you
really should not put non-Android classes into the com.android.*
package namespace. This should probably be com.smithmyers.* instead.

--
chris tate
Android framework engineer

On Fri, Jul 17, 2009 at 1:56 AM, Ne0<liamjam...@googlemail.com> wrote:
>
> Hi,
>
> I'm developing a system app to test a device that i am developing to
> run android, i want this app to do similar things to the htc field
> test app though i am running into a security problem.
>
> My app has a platform certificate and (just for my sanity) i added all
> the same permissions as the phone app.
>
> My frustration led me to dexdump the field test app which suggests
> that it only calls PhoneFactory.getDefaultPhone, when i do this i get
> the error of Phones Have Not been made yet. When i makeDefaultPhones i
> get a security exception (permission denied) when trying to add the
> simphonebook service.
>
> If anyone can point me in the right direction i would very much
> appreciate it, here is the logcat of the crash.
>
> E/ServiceManager(  533): add_service('simphonebook',0x2b) uid=10006 -
> PERMISSION DENIED
> D/AndroidRuntime(  610): Shutting down VM
> W/dalvikvm(  610): threadid=3: thread exiting with uncaught exception
> (group=0x4000fe70)
> E/AndroidRuntime(  610): Uncaught handler: thread main exiting due to
> uncaught exception
> E/AndroidRuntime(  610): java.lang.RuntimeException: Unable to start
> activity ComponentInfo{com.android.smithmyers.mobilepowersurvey/
> com.android.smithmyers.mobilepowersurvey.MobilePowerSurvey}:
> java.lang.SecurityException
> E/AndroidRuntime(  610):        at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2268)
> E/AndroidRuntime(  610):        at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2284)
> E/AndroidRuntime(  610):        at android.app.ActivityThread.access$1800
> (ActivityThread.java:112)
> E/AndroidRuntime(  610):        at android.app.ActivityThread$H.handleMessage
> (ActivityThread.java:1692)
> E/AndroidRuntime(  610):        at android.os.Handler.dispatchMessage
> (Handler.java:99)
> E/AndroidRuntime(  610):        at android.os.Looper.loop(Looper.java:123)
> E/AndroidRuntime(  610):        at android.app.ActivityThread.main
> (ActivityThread.java:3948)
> E/AndroidRuntime(  610):        at java.lang.reflect.Method.invokeNative
> (Native Method)
> E/AndroidRuntime(  610):        at java.lang.reflect.Method.invoke
> (Method.java:521)
> E/AndroidRuntime(  610):        at com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:782)
> E/AndroidRuntime(  610):        at com.android.internal.os.ZygoteInit.main
> (ZygoteInit.java:540)
> E/AndroidRuntime(  610):        at dalvik.system.NativeStart.main(Native
> Method)
> E/AndroidRuntime(  610): Caused by: java.lang.SecurityException
> E/AndroidRuntime(  610):        at android.os.BinderProxy.transact(Native
> Method)
> E/AndroidRuntime(  610):        at android.os.ServiceManagerProxy.addService
> (ServiceManagerNative.java:146)
> E/AndroidRuntime(  610):        at android.os.ServiceManager.addService
> (ServiceManager.java:72)
> E/AndroidRuntime(  610):        at
> com.android.internal.telephony.gsm.SimPhoneBookInterfaceManager.publish
> (SimPhoneBookInterfaceManager.java:106)
> E/AndroidRuntime(  610):        at
> com.android.internal.telephony.gsm.SimPhoneBookInterfaceManager.<init>
> (SimPhoneBookInterfaceManager.java:102)
> E/AndroidRuntime(  610):        at
> com.android.internal.telephony.gsm.GSMPhone.<init>(GSMPhone.java:185)
> E/AndroidRuntime(  610):        at
> com.android.internal.telephony.gsm.GSMPhone.<init>(GSMPhone.java:162)
> E/AndroidRuntime(  610):        at
> com.android.internal.telephony.PhoneFactory.useNewRIL
> (PhoneFactory.java:70)
> E/AndroidRuntime(  610):        at
> com.android.internal.telephony.PhoneFactory.makeDefaultPhones
> (PhoneFactory.java:123)
> E/AndroidRuntime(  610):        at
> com.android.smithmyers.mobilepowersurvey.MobilePowerSurvey.onCreate
> (MobilePowerSurvey.java:44)
> E/AndroidRuntime(  610):        at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> 1123)
> E/AndroidRuntime(  610):        at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2231)
> E/AndroidRuntime(  610):        ... 11 more
>
>
> Thanks, Liam
> >
>
Reply all
Reply to author
Forward
0 new messages