System signature APK, allowing the application to obtain system-level permissions, and then force the GPS to be turned on and off

Permissions are not directly added to AndroidManifest.xml, but also require the application to have system permissions.

Such as switching GPS (Settings.Secure.setLocationProviderEnabled(getContentResolver(),LocationManager.GPS_PROVIDER,true);) required
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" /> permission and so
on.

Method 1.
After rooting the phone, adb remount, adb push XXX.apk /system/app/, and push the APK file in the bin directory of the eclipse project to the phone /system/app/.

Method 2.
Friends of mobile phone manufacturers can use the platform platform of the mobile phone to sign, and then they can get the system to persuade them to surrender.

1. Set android:sharedUserId="android.uid.system" in AndroidManifest.xml .

2. After the compilation is passed, export the unsigned SetGPS.apk from eclipse .

3、使用\out\host\linux-x86\framework\signapk.jar +\build\target\product\security\platform.pk8 +platform.x509.pem

4. Execute " java -jar signapk.jar platform.x509.pem platform.pk8 SetGPS.apk SetGPSSigned.apk " to do platform signature to get SetGPSSigned.apk.

In this way, without root push to system/app/ , it can be used directly after installation.

 

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324188401&siteId=291194637