如何获取LicenceChecker的static int标识符

How to get the identifier of static int of LicenceChecker

检查应用程序的许可和 public void applicationError(int errorCode) 方法 returns 一个整数,比方说
public static final int ERROR_INVALID_PACKAGE_NAME = 1;

我想显示一条显示 int 的 "ERROR_INVALID_PACKAGE_NAME" 部分的消息。 String error_Code = Integer.toString(errorCode); 只会显示“1”。

如何从 int 中获取字符串?

无法生成它,编译器不会跟踪变量的名称。而这忽略了像 proguard 这样有意破坏它们的东西。为此,您要么需要使用枚举而不是 int,要么需要编写一个函数 String convertErrorCodeToString(int errorCode) 来 returns 字符串