0

我正在尝试在 google play 中上传 android 应用程序 (.apk),是否需要在付费应用程序中拥有 (.apk) 的许可证密钥。如果是,为什么需要它?

MyLicenseCheckerCallback 抛出它应该实现然后超类型方法的错误。它说允许()必须传递一个整数参数,其中的参数应该传递你能建议我帮忙吗?

private class MyLicenseCheckerCallback implements LicenseCheckerCallback {
@Override
public void allow() {
        if (isFinishing()) {
                        // Don't update UI if Activity is finishing.
                        return;
}
// Should allow user access.
startMainActivity();

            }

@Override
public void applicationError(ApplicationErrorCode errorCode) {
    if (isFinishing()) {
        // Don't update UI if Activity is finishing.
        return;
    }
    // This is a polite way of saying the developer made a mistake
    // while setting up or calling the license checker library.
    // Please examine the error code and fix the error.
    toast("Error: " + errorCode.name());
    startMainActivity();

}

@Override
public void dontAllow() {
    if (isFinishing()) {
        // Don't update UI if Activity is finishing.
        return;
    }

    // Should not allow access. In most cases, the app should assume
    // the user has access unless it encounters this. If it does,
    // the app should inform the user of their unlicensed ways
    // and then either shut down the app or limit the user to a
    // restricted set of features.
    // In this example, we show a dialogue that takes the user to Market.
    showDialog(0);
}
}
4

1 回答 1

1

请阅读这篇文章你知道为什么需要许可证密钥

https://support.google.com/googleplay/android-developer/answer/186113?hl=ta

请按照以下步骤创建发布私有签名密钥:

选择文件 -> 导出

  1. 在弹出窗口中,展开 Android 并选择 Export Android Application
  2. 在下一个弹出窗口中,选择 Browse 按钮​​并选择您需要发布 APK 的 Project。
  3. 单击下一步按钮。下一组选项用于选择现有密钥库或创建新密钥库。选择创建新密钥库,设置要保存密钥库文件的位置,选择您自己的密码并确认。
  4. 下一页是密钥创建选项集。在此,为密钥库创建一个别名。再次选择密码并确认。为您的密钥库设置有效年数。它必须至少为 25 年。在此页面上输入其余详细信息。
  5. 在此向导的最后一页上,选择您希望将 APK 保存在计算机上的位置。

这里的所有都是它的。

注意:发布签名密钥由开发人员创建,而不是由 Google 为开发人员创建。它是一个自签名证书。确保此密钥安全可靠,并可能保存在多个位置。如果您要放弃对上述第 4 步中创建的签名密钥文件的访问权限,您将无法将更新发布到您的应用程序。没有已知的方法可以恢复丢失的密钥。这同样适用于您在上述过程中选择的密码。不要丢失密钥文件或其密码。

于 2013-07-05T05:43:57.530 回答