Heroes III HD v1.1.6版本的 MD5 值为:99ed52e2d6b85487933b8dc8c0440b36
以下内容为反编译后的 GameHelperUtils.java 源代码,内容仅作参考
package com.dotemu.homm3.social;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.content.res.Resources;
import android.util.Log;
import com.flurry.android.Constants;
import com.google.android.gms.games.GamesActivityResultCodes;
import com.ubisoft.mightandmagic.heroesiii.R;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import obfuse.NPStringFog;
class GameHelperUtils {
private static final String[] FALLBACK_STRINGS = {NPStringFog.decode("4425030A000E100B520B021F0E1C4F"), NPStringFog.decode("44360C08020403450601501E08090F470C1C40503D0D0B001400520D18080205411E0A071C5003041A160817194E13020F000404111B011E4D00000547110017500C060F08094B"), NPStringFog.decode("442405044E0017151E07130C15070E09451B1D50040F0D0E1517170D0401184E02080B14071718130B0549453106150E0A4E150F04064E0405044E110606190F17084100000A00520F1E09411D08000B1B00174D020B13130C1407130C150B410A04060D184D15060447061E071503154E282345111C150C150B05470C1C4E3408170B0D0815171C502E0E001208091740502C0D1D0E4B451B085019090B4106150202190E001A08080B5207034D0F0115471C171A501D140C0D0E161A0B1441410D090206194E0405001A41130D174E110E020114091152171F18410F130245061C09040F0941130A521D190A0F4E0809450507040541071247091B1D0408054E001445134E0408121A041545130D13021400154945210B154D0D010614451401024D0C011302451B001602130300130C1D005E"), NPStringFog.decode("443C04020B0F1400520D180802054101041B0215094F")};
private static final int[] RES_IDS = {R.string.gamehelper_unknown_error, R.string.gamehelper_sign_in_failed, R.string.gamehelper_app_misconfigured, R.string.gamehelper_license_failed};
public static final int R_APP_MISCONFIGURED = 2;
public static final int R_LICENSE_FAILED = 3;
public static final int R_SIGN_IN_FAILED = 1;
public static final int R_UNKNOWN_ERROR = 0;
GameHelperUtils() {
}
public static String activityResponseCodeToString(int respCode) {
switch (respCode) {
case -1:
return NPStringFog.decode("3C353E342235382A39");
case 0:
return NPStringFog.decode("3C353E3422353826332033282D2B25");
case GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED:
return NPStringFog.decode("3C353E3422353837372D3F232F2B22333A202B2138283C2423");
case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
return NPStringFog.decode("3D392A2F3128293A342F3921242A");
case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
return NPStringFog.decode("3C353E34223538293B2D3523322B3E21243B223529");
case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
return NPStringFog.decode("3C353E3422353824223E2F20283D22282B34273738332B25");
case GamesActivityResultCodes.RESULT_LEFT_ROOM:
return NPStringFog.decode("3C353E34223538293728243233212E2A");
default:
return String.valueOf(respCode);
}
}
public static String errorCodeToString(int errorCode) {
switch (errorCode) {
case 0:
return NPStringFog.decode("3D252E222B32344D") + errorCode + NPStringFog.decode("47");
case 1:
return NPStringFog.decode("3D353F372722223A3F27233E2820264F") + errorCode + NPStringFog.decode("47");
case 2:
return NPStringFog.decode("3D353F372722223A242B223E28212F3830222A31392431332234272722282546") + errorCode + NPStringFog.decode("47");
case 3:
return NPStringFog.decode("3D353F372722223A3627232C232224234D") + errorCode + NPStringFog.decode("47");
case 4:
return NPStringFog.decode("3D392A2F3128293A202B2138283C24234D") + errorCode + NPStringFog.decode("47");
case 5:
return NPStringFog.decode("273E3B202228233A332D33223420354F") + errorCode + NPStringFog.decode("47");
case 6:
return NPStringFog.decode("3C353E2E2234332C3D202F3F243F342E37372A58") + errorCode + NPStringFog.decode("47");
case 7:
return NPStringFog.decode("2035393621332C3A373C22223346") + errorCode + NPStringFog.decode("47");
case 8:
return NPStringFog.decode("273E39243C2F26292D2B223F2E3C49") + errorCode + NPStringFog.decode("47");
case 9:
return NPStringFog.decode("3D353F372722223A3B20262C2D27254F") + errorCode + NPStringFog.decode("47");
case 10:
return NPStringFog.decode("2A353B24222E37202031353F3321334F") + errorCode + NPStringFog.decode("47");
case 11:
return NPStringFog.decode("22392E242032223A3126352E2A3127262C3E2B3445") + errorCode + NPStringFog.decode("47");
default:
return NPStringFog.decode("3B1E060F01160945171C0202134E020801174E") + errorCode;
}
}
public static void printMisconfiguredDebugInfo(Context ctx) {
Log.w(NPStringFog.decode("2911000426040B15171C"), "****");
Log.w(NPStringFog.decode("2911000426040B15171C"), "****");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** This is usually caused by one of these reasons:");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** (1) Your package name and certificate fingerprint do not match");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** the client ID you registered in Developer Console.");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** (2) Your App ID was incorrectly entered.");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** (3) Your game settings have not been published and you are ");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** trying to log in with an account that is not listed as");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** a test account.");
Log.w(NPStringFog.decode("2911000426040B15171C"), "****");
if (ctx == null) {
Log.w(NPStringFog.decode("2911000426040B15171C"), "*** (no Context, so can't print more debug info)");
return;
}
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** To help you debug, here is the information about this app");
Log.w(NPStringFog.decode("2911000426040B15171C"), NPStringFog.decode("445A474B4E310606190F17084100000A00524E504D414E414745484E") + ctx.getPackageName());
Log.w(NPStringFog.decode("2911000426040B15171C"), NPStringFog.decode("445A474B4E220217064E2325205F41010C1C09151F111C080911484E") + getSHA1CertFingerprint(ctx));
Log.w(NPStringFog.decode("2911000426040B15171C"), NPStringFog.decode("445A474B4E2017155227344D071C0E0A45524E504D414E414745484E") + getAppIdFromResource(ctx));
Log.w(NPStringFog.decode("2911000426040B15171C"), "****");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** Check that the above information matches your setup in ");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** Developer Console. Also, check that you're logging in with the");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** right account (it should be listed in the Testers section if");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** your project is not yet published).");
Log.w(NPStringFog.decode("2911000426040B15171C"), "****");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** For more information, refer to the troubleshooting guide:");
Log.w(NPStringFog.decode("2911000426040B15171C"), "**** http://developers.google.com/games/services/android/troubleshooting");
}
static String getAppIdFromResource(Context ctx) {
try {
Resources res = ctx.getResources();
String pkgName = ctx.getPackageName();
int res_id = res.getIdentifier(NPStringFog.decode("0F001D3E0705"), "string", pkgName);
return res.getString(res_id);
} catch (Exception ex) {
ex.printStackTrace();
return NPStringFog.decode("514F52414607060C1E0B144D1501411500061C1908170B412635224E392948");
}
}
static String getSHA1CertFingerprint(Context ctx) {
try {
Signature[] sigs = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 64).signatures;
if (sigs.length == 0) {
return NPStringFog.decode("2B223F2E3C5B472B3D4E23242620203330202B5E");
}
if (sigs.length > 1) {
return NPStringFog.decode("2B223F2E3C5B47282722242431222447363B293E2C353B332236");
}
byte[] digest = MessageDigest.getInstance(NPStringFog.decode("3D382C50")).digest(sigs[0].toByteArray());
StringBuilder hexString = new StringBuilder();
for (int i = 0; i < digest.length; i++) {
if (i > 0) {
hexString.append(NPStringFog.decode("54"));
}
byteToString(hexString, digest[i]);
}
return hexString.toString();
} catch (PackageManager.NameNotFoundException ex) {
ex.printStackTrace();
return NPStringFog.decode("46353F3321335D45020F1306000904470B1D1A500B0E1B0F034C");
} catch (NoSuchAlgorithmException ex2) {
ex2.printStackTrace();
return NPStringFog.decode("46353F3321335D452126315C410F0D000A000704050C4E0F081152081F180F0A48");
}
}
static void byteToString(StringBuilder sb, byte b) {
int unsigned_byte = b < 0 ? b + Constants.FEMALE : b;
int hi = unsigned_byte / 16;
int lo = unsigned_byte % 16;
sb.append(NPStringFog.decode("5E415F525A5451524A57312F222A2421").substring(hi, hi + 1));
sb.append(NPStringFog.decode("5E415F525A5451524A57312F222A2421").substring(lo, lo + 1));
}
public static String getString(Context ctx, int whichString) {
whichString = (whichString < 0 || whichString >= RES_IDS.length) ? 0 : 0;
int resId = RES_IDS[whichString];
try {
return ctx.getString(resId);
} catch (Exception ex) {
ex.printStackTrace();
Log.w(NPStringFog.decode("2911000426040B15171C"), NPStringFog.decode("445A474129000A003A0B1C1D041C41040A0702144D0F011547031D1B1E09411C04140A071C13084107054746") + resId + NPStringFog.decode("4050") + NPStringFog.decode("3A1804124E11150A100F1201184E090615020B1E08054E030206131B030841170E12451B001301140A0403451B1A500C124E004716060F1E094C0F0D080B174E3A2C334041") + NPStringFog.decode("2C111E0429000A00271A1901124E120F0A0702144D030B41040A1F1E1901040A410616520F5021282C3326372B4E203F2E242424315E4E0302411A0906115207044D020F0F4704110D151E124E") + NPStringFog.decode("07041E411C04140A071C130812404132161B00174D004E0706091E0C110E0A4E1213171B001743"));
return FALLBACK_STRINGS[whichString];
}
}
}