它是保证PackageManager.getInstallerPackageName()总是返回一个不`null`字符串?它是、字符串、getInstallerPackageName、PackageM

2023-09-07 04:06:13 作者:旧颜

能够保证所有的 PackageManager.getInstallerPackageName() 总是返回一个没有字符串?

Is it guaranteed that PackageManager.getInstallerPackageName() always returns a not null string?

PackageManager myapp= this.getPackageManager(); 
String installer = myapp.getInstallerPackageName("com.MyPackage");
if (installer == null) {
    // ...
}

我们正在考虑这个选项VS谷歌的许可。但是,应用程序应该在离线模式下运行没有网络接入。

We are considering this option vs Google licensing. But the application should operate in offline mode without network access.

推荐答案

据我读过,这可以很容易地被欺骗,或者使用ADB(的 这里 )或code( 这里 )。

as far as i've read, this can be easily be spoofed, either using ADB (here) or by code (here) .

我没有测试任何人,但似乎这种方法不具有良好的保护作用。

i didn't test any of them, but it seems this method doesn't have a good protection.

 
精彩推荐
图片推荐