能够保证所有的 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.