代码之家  ›  专栏  ›  技术社区  ›  Elletlar FireTr3e

googleplay:lvl:license:验证错误或失败:licensecheckercallback:com.google.android.vending.licensing

  •  1
  • Elletlar FireTr3e  · 技术社区  · 6 年前

    今天早上,我的收件箱被一个付费应用程序的许可证验证错误淹没。在过去5年左右的时间里,这款应用的授权运行良好。

    不幸的是我没能再现这个问题…

    它使用来自google package=“com.google.android.vending.licensing”的旧lvl

    private class MyLicenseCheckerCallback implements LicenseCheckerCallback {
        // Means: GooglePlay believes this user is legitimate
        @Override
        public void allow(int x, int policyReason, String y) {
            if (isFinishing()) {
                // Don't update UI if Activity is finishing.
                return;
            }
    
            MainActivity.this.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    try { mProgressDialog.dismiss(); mProgressDialog = null; } catch (Exception e) {e.printStackTrace(); }
                }
            });
    
            // Update server
            Util.pingServer(getApplicationContext());
        }
    
        // Means: Google Play definitely thinks this version is a pirate version
        @SuppressWarnings("SpellCheckingInspection")
        public void dontAllow(int x, final int policyReason, String y) {
            EventLog.i(TAG, "don't Allow: " + policyReason);
            if (isFinishing()) {
                // Don't update UI if Activity is finishing.
                return;
            }
    
            MainActivity.this.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    try { mProgressDialog.dismiss(); mProgressDialog = null; } catch (Exception e) {e.printStackTrace(); }
                    showGoogleLicenseDialog(policyReason == Policy.RETRY ? 1 : 0);
                }
            });
        }
    
    
        // Means: Developer has not setup licensing properly
        // ERROR_NOT_MARKET_MANAGED: not managed by Android Market (now called Google Play)
        // More specifically, the version X of your application is not uploaded or published in Google Play
        public void applicationError(final int errorCode) {
            EventLog.e(TAG, "applicationError: " + errorCode);
    
            if (isFinishing()) {
                // Don't update UI if Activity is finishing.
                return;
            }
    
            MainActivity.this.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    try { mProgressDialog.dismiss(); mProgressDialog = null; } catch (Exception e) {e.printStackTrace(); }
    
                    // Developer mistake dialog
                    String result = String.format(getString(R.string.application_error), errorCode);
                    ActivityHelper.showToast(MainActivity.this, "License problem: App Error: " + result, Toast.LENGTH_LONG);
                }
            });
        }
    }
    private final MyLicenseCheckerCallback mMyLicenseCheckerCallback = new MyLicenseCheckerCallback();
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   Elletlar FireTr3e    6 年前

    谷歌似乎已经在生产中对此进行了改进。它可以通过更新到googleplay商店10.7.19来修复。

    Latest Google Play Store 10.7.19 fixes LVL check

    另一篇文章:

    Google Play Store app licensing bug is putting developers in a horrible spot

    用户的一些评论:
    “谢谢,我侧装了PlayStore更新,似乎已经修复了它。”
    “我们最终放弃了,工厂重新设置了电话。这似乎解决了这个问题……”

    目前的主要问题是,并非所有用户都可以访问10.7.19更新…

    更新:

    还收到了一些评论,如:
    “在“设置”选项卡上,我关闭/打开了通知访问。好像把它弄醒了。错误已停止。“