1. <i id='4XFCg'><tr id='4XFCg'><dt id='4XFCg'><q id='4XFCg'><span id='4XFCg'><b id='4XFCg'><form id='4XFCg'><ins id='4XFCg'></ins><ul id='4XFCg'></ul><sub id='4XFCg'></sub></form><legend id='4XFCg'></legend><bdo id='4XFCg'><pre id='4XFCg'><center id='4XFCg'></center></pre></bdo></b><th id='4XFCg'></th></span></q></dt></tr></i><div id='4XFCg'><tfoot id='4XFCg'></tfoot><dl id='4XFCg'><fieldset id='4XFCg'></fieldset></dl></div>
      <bdo id='4XFCg'></bdo><ul id='4XFCg'></ul>

    <small id='4XFCg'></small><noframes id='4XFCg'>

  2. <legend id='4XFCg'><style id='4XFCg'><dir id='4XFCg'><q id='4XFCg'></q></dir></style></legend>
    <tfoot id='4XFCg'></tfoot>

    1. 是否可以通过检查 getInstallerPackageName 来检查安装付费 Android 应用的合法性?

      Is it ok to check legality of installing paid android app by checking getInstallerPackageName?(是否可以通过检查 getInstallerPackageName 来检查安装付费 Android 应用的合法性?)
      <legend id='kvBr4'><style id='kvBr4'><dir id='kvBr4'><q id='kvBr4'></q></dir></style></legend><tfoot id='kvBr4'></tfoot>
        <tbody id='kvBr4'></tbody>
            <bdo id='kvBr4'></bdo><ul id='kvBr4'></ul>

            <small id='kvBr4'></small><noframes id='kvBr4'>

            • <i id='kvBr4'><tr id='kvBr4'><dt id='kvBr4'><q id='kvBr4'><span id='kvBr4'><b id='kvBr4'><form id='kvBr4'><ins id='kvBr4'></ins><ul id='kvBr4'></ul><sub id='kvBr4'></sub></form><legend id='kvBr4'></legend><bdo id='kvBr4'><pre id='kvBr4'><center id='kvBr4'></center></pre></bdo></b><th id='kvBr4'></th></span></q></dt></tr></i><div id='kvBr4'><tfoot id='kvBr4'></tfoot><dl id='kvBr4'><fieldset id='kvBr4'></fieldset></dl></div>

                本文介绍了是否可以通过检查 getInstallerPackageName 来检查安装付费 Android 应用的合法性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                为了确保我的付费 android 应用程序是从商店合法安装的,我这样写:

                To ensure that my paid android application was legally installed from store, I write this:

                String installer = getPackageManager().getInstallerPackageName(
                        "com.example.myapp");
                
                if (installer == null) {
                    // app was illegally downloaded from unknown source. 
                    // dear user, please re-install it from market
                } 
                else {
                    // app was probably installed legally
                    // (also it's good to check actual installer name)
                }
                

                没事吧?从市场合法购买和安装的应用程序是否有可能获得空的安装程序包名称并通过此测试?

                Is it ok? Is there a chance that application that is legally purchased and installed from market will get empty installer package name and fail this test?

                我了解用户可以运行 adb -i com.fake.installer myapp.apk 并通过此检查,但如果 合法 用户会遇到潜在问题更为重要或不.

                I understand that user can run adb -i com.fake.installer myapp.apk and pass this check, but it's more important if legal users will get potential problems or not.

                推荐答案

                你不应该使用 PackageManager#getInstallerPackageName 检查应用程序是从 Google Play 安装还是出于以下原因的许可目的:

                You should not use PackageManager#getInstallerPackageName to check if the app was installed from Google Play or for licensing purposes for the following reasons:

                1) 安装程序包名称将来可能会更改.例如,安装程序包名称使用 "com.google.android.feedback"(请参阅此处) 现在是 "com.android.vending".

                1) The installer packagename can change in the future. For example, the installer package name use to be "com.google.android.feedback" (see here) and now it is "com.android.vending".

                2) 出于盗版原因检查安装程序包名等同于使用 Base64 加密密码 - 这是一种不好的做法.

                2) Checking the installer packagename for piracy reasons is equivalent to using Base64 to encrypt passwords — it's simply bad practice.

                3) 合法购买该应用程序的用户可以旁加载 APK 或从另一个未设置正确安装程序包名称的备份应用程序中恢复它,并收到许可证检查错误.这很可能会导致差评.

                3) Users who legally purchased the app can side-load the APK or restore it from another backup application which doesn't set the correct installer packagename and get a license check error. This will most likely lead to bad reviews.

                4)就像你提到的,盗版者在安装APK时可以简单的设置安装包名.

                4) Like you mentioned, pirates can simply set the installer packagename when installing the APK.

                您应该使用 App Licensing 或切换到 应用内结算.

                You should use App Licensing or switch to In-app Billing.

                这篇关于是否可以通过检查 getInstallerPackageName 来检查安装付费 Android 应用的合法性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Android - Is it possible to get install referrer programmatically(Android - 是否有可能以编程方式安装引荐来源网址)
                How to sign an APK with more than one certificate?(如何使用多个证书签署 APK?)
                versionCode vs versionName in Android Manifest(Android Manifest 中的 versionCode 与 versionName)
                What does this Google Play APK publish error message mean?(这个 Google Play APK 发布错误消息是什么意思?)
                Lost my keystore for uploaded app on android market(丢失了我在 android 市场上上传的应用程序的密钥库)
                App on Google Play always shows quot;Updatequot; instead of open(Google Play 上的应用程序总是显示“更新;而不是打开)

                          <tbody id='Vzpmb'></tbody>
                        <tfoot id='Vzpmb'></tfoot>

                          <bdo id='Vzpmb'></bdo><ul id='Vzpmb'></ul>
                        • <small id='Vzpmb'></small><noframes id='Vzpmb'>

                          <legend id='Vzpmb'><style id='Vzpmb'><dir id='Vzpmb'><q id='Vzpmb'></q></dir></style></legend>
                        • <i id='Vzpmb'><tr id='Vzpmb'><dt id='Vzpmb'><q id='Vzpmb'><span id='Vzpmb'><b id='Vzpmb'><form id='Vzpmb'><ins id='Vzpmb'></ins><ul id='Vzpmb'></ul><sub id='Vzpmb'></sub></form><legend id='Vzpmb'></legend><bdo id='Vzpmb'><pre id='Vzpmb'><center id='Vzpmb'></center></pre></bdo></b><th id='Vzpmb'></th></span></q></dt></tr></i><div id='Vzpmb'><tfoot id='Vzpmb'></tfoot><dl id='Vzpmb'><fieldset id='Vzpmb'></fieldset></dl></div>