似乎如果Android手机未登录Google Play,则checkAccess-call将抛出NullPointerException并最终导致应用程序崩溃:
// user not logged in to Google Play
LicenseChecker licenseChecker = new LicenseChecker(...);
licenseChecker.checkAccess(...) // throws a nullpointer exception and crasches the app
Run Code Online (Sandbox Code Playgroud)
NullPointerException发生在Android框架内部的一个单独的线程中:
FATAL EXCEPTION: background thread
java.lang.NullPointerException
com.google.android.vending.licensing.LicenseValidator.verify()
Run Code Online (Sandbox Code Playgroud)
因此,应用程序似乎无法捕获它并避免崩溃.
任何想法如何避免这种崩溃?(t应该是不能登录Google Play的合法情况)
我能想到的唯一方法是在调用checkAccess之前检查Google Play登录状态.
Context.getApplicationContext()在 Android 应用程序中,在应用程序的整个生命周期中保留对返回的应用程序上下文的引用是否安全?
Context ac = context.getApplicationContext();
// keep the ac reference throughout the app lifetime
Run Code Online (Sandbox Code Playgroud) 在C#中考虑以下语句:
string operation = new StackTrace(false).GetFrame(0).GetMethod().Name;
Run Code Online (Sandbox Code Playgroud)
这是一个发布版本中的危险结构,其中框架可能被编译为本机代码?
是否可以通过编程方式验证系统生成的odex文件的完整性/校验和?
我不知道该如何检测,如果扎根的Android手机上的攻击者是否为应用程序安装了自己的odex文件版本。
有没有人知道解决以下问题的标准技术:
例如,在iOS上,sysctl() - 函数可用于检测附加的调试器,但攻击者只需反汇编二进制可执行文件,找到sysctl() - 调用,并用自己的版本替换它们.
我们作为开发人员如何处理这个问题?
我的平台是iOS(iPhone)和原生Android(Android NDK).