这是因为修改framework, 定义了新的 公有变量、常量、方法名称要提交 frameworks/base/api/ current.txt 这个文件。
这是因为修改framework, 定义了新的 公有变量、常量、方法名称要提交 frameworks/base/api/ current.txt 这个文件。
java -jar ./out/host/linux-x86/framework/signapk.jar ./build/target/product/security/platform.x509.pem ./build/target/product/security/platform.pk8 /tmp/Lesson37_HelloSensor_sensor.apk /tmp/Lesson37_HelloSensor_sensor_signed.apk
aapt dump permissions /tmp/Lesson37_HelloSensor_sensor_signed.apk
添加新的sensor 权限:
frameworks/base/core/java/android/app/ContextImpl.java
390 return new SensorManager(ctx,ctx.mMainThread.getHandler().getLooper());//xiayu fix
frameworks/base/core/java/android/hardware/SensorManager.java
添加public SensorManager(Context context,Looper mainLooper)函数。大部分是复制public SensorManager(Looper mainLooper)
if ( (context.checkCallingOrSelfPermission("android.permission.XIAYU")==PackageManager.PERMISSION_GRANTED) &&
(context.checkCallingOrSelfPermission("android.permission.SENSOR")
!= PackageManager.PERMISSION_GRANTED)) {
Log.e(TAG,"xiayu no android.permission.SENSOR");
throw new SecurityException(" requires SENSOR permission");
}