Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile Android Application with system permissions

Tags:

I need to compile an application with system permissions in order to use target application com.android.settings. For now while I try to run my apk I get the error message

Test run failed: Permission Denial: starting instrumentation ComponentInfo{com.jayway.test/android.test.InstrumentationTestRunner} from pid=354, uid=354 not allowed because package com.jayway.test does not have a signature matching the target com.android.settings

How can I compile my application with system permissions?

like image 259
Michalis Avatar asked Aug 30 '10 07:08

Michalis


People also ask

How do I declare permissions in Android application?

To declare a permission only on devices that support runtime permissions—that is, devices that run Android 6.0 (API level 23) or higher—include the uses-permission-sdk-23 element instead of the uses-permission element. When using either of these elements, you can set the maxSdkVersion attribute.

How Android apps are compiled?

The compilers convert your source code into DEX (Dalvik Executable) files, which include the bytecode that runs on Android devices, and everything else into compiled resources. The packager combines the DEX files and compiled resources into an APK or AAB, depending on the chosen build target.


1 Answers

After having some search I found how to sign my application with system (platform) key. System signatures are located in directory <root-of-android-source-tree>/build/target/product/security. You can use them to sign your application with system privileges.

like image 129
Michalis Avatar answered Nov 02 '22 16:11

Michalis