android设备不支持相机和振动功能,删除相机camera API和振动vibrate API

时间:2024-07-13 15:14:54

办法:找到管理服务,直接拦截return掉

/frameworks/base/core/java/android/app/PackageManager.java  修改无效!

/frameworks/base/core/java/android/app/ApplicationPackageManager.java

    @Override
    public boolean hasSystemFeature(String name) {
           //*/20231102,rm FEATURE_CAMERA API
            if (name.equals(PackageManager.FEATURE_CAMERA)) {
                return false;
            }
            //*/
        return hasSystemFeature(name, 0);
    }


/frameworks/base/services/core/java/com/android/server/VibratorService.java

  @Override // Binder call
    public boolean hasVibrator() {
       //*/20231102,rm all vibrator API
        return false;
       /*/
        return doVibratorExists();
       //*/
    }