LSPosed / AndroidHiddenApiBypass

LSPass: Bypass restrictions on non-SDK interfaces
Apache License 2.0
1.65k stars 298 forks source link

部分类型API需要增强 #4

Closed hhhaiai closed 3 years ago

hhhaiai commented 3 years ago

系统api 约束分为:

  1. @hide
  2. @UnsupportedAppUsage
  3. @SystemApi
  4. @TestApi

如你示例中,使用ApplicationInfo 中代码进行测试,测试代码如下:

    /**
     * @hide
     */
    public @HiddenApiEnforcementPolicy int getHiddenApiEnforcementPolicy() {}

    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
    private boolean isPackageUnavailable(PackageManager pm) {}

   @SystemApi
    public boolean isEncryptionAware() {}
   /** @hide */
    @TestApi
    public boolean isSystemApp() {}

测试结果如下:

 java.lang.NoSuchMethodException: android.content.pm.ApplicationInfo.isPackageUnavailable [class android.content.pm.PackageManager]

结果: @UnsupportedAppUsage类型兼容需要增强

ghost commented 3 years ago

?

vvb2060 commented 3 years ago

对于这个问题,我认为你应该向 AOSP 反映,核心框架API Ldalvik/system/VMRuntime;->setHiddenApiExemptions([Ljava/lang/String;)V 的行为不符合文档