Heroes III HD v1.1.6版本的 MD5 值为:99ed52e2d6b85487933b8dc8c0440b36
以下内容为反编译后的 MainActivity.java 源代码,内容仅作参考
package com.ubisoft.mightandmagic.heroesiii;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Point;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.Display;
import android.view.WindowManager;
import com.dotemu.homm3.flurry.FlurryManager;
import com.dotemu.homm3.social.SocialInterface;
import com.dotemu.homm3.social.SocialManager;
import java.util.List;
import java.util.Locale;
import obfuse.NPStringFog;
import org.libsdl.app.SDLActivity;
public class MainActivity extends SDLActivity implements SocialInterface {
private static final String PREF_NAME = "PREF_GPGS_SIGNED_OUT";
private FlurryManager flurryManager;
private SocialManager socialManager;
public static native void nativeKeyboardHidden();
public native void nativeCreate(Activity activity);
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WindowManager.LayoutParams layoutParams = super.getWindow().getAttributes();
layoutParams.flags |= 2097280;
getWindow().setAttributes(layoutParams);
nativeCreate(this);
this.socialManager = SocialManager.getInstance(this);
this.flurryManager = FlurryManager.getInstance(this);
hideSystemUI();
}
public void hideSystemUI() {
}
public void showSystemUI() {
}
@Override
public void connect() {
this.socialManager.connect();
}
@Override
public void disconnect() {
this.socialManager.disconnect();
}
@Override
protected void onStart() {
super.onStart();
this.socialManager.onStart();
this.flurryManager.onStart();
}
@Override
protected void onStop() {
this.flurryManager.onStop();
super.onStop();
}
@Override
public void onResume() {
super.onResume();
this.socialManager.onResume();
}
@Override
public void onPause() {
this.socialManager.onPause();
super.onPause();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
this.socialManager.onActivityResult(requestCode, resultCode, data);
}
@Override
public void postAchievement(String achievementId, boolean increment) {
this.socialManager.postAchievement(achievementId, increment);
}
@Override
public boolean postScore(String leaderboardId, int score) {
return this.socialManager.postScore(leaderboardId, score);
}
@Override
public void showAchievements() {
this.socialManager.showAchievements();
}
@Override
public void showLeaderboards() {
this.socialManager.showLeaderboards();
}
@Override
public void showDashboard() {
this.socialManager.showDashboard();
}
@Override
public boolean isConnected() {
return this.socialManager.isConnected();
}
@Override
public boolean isSignedOut() {
return this.socialManager.isSignedOut();
}
public void openURL(String url) {
ComponentName firstComponentName;
Intent exampleIntent = new Intent(NPStringFog.decode("0F1E09130108034B1B0004080F1A4F060606071F034F38282232"), Uri.parse("http://www.ubi.com"));
PackageManager packageManager = getPackageManager();
List<ResolveInfo> activities = packageManager.queryIntentActivities(exampleIntent, 0);
if (activities.size() > 0) {
ResolveInfo browser = activities.get(0);
firstComponentName = new ComponentName(browser.activityInfo.packageName, browser.activityInfo.name);
} else {
firstComponentName = null;
}
Intent intent = new Intent();
intent.setAction(NPStringFog.decode("0F1E09130108034B1B0004080F1A4F060606071F034F38282232"));
intent.setData(Uri.parse(url));
if (firstComponentName != null) {
intent.setComponent(firstComponentName);
}
try {
startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
}
public int getLanguage() {
String language = Locale.getDefault().getLanguage();
if (NPStringFog.decode("0A15").equalsIgnoreCase(language)) {
return 3;
}
if (NPStringFog.decode("0B03").equalsIgnoreCase(language)) {
return 4;
}
if (NPStringFog.decode("0802").equalsIgnoreCase(language)) {
return 1;
}
if (NPStringFog.decode("0704").equalsIgnoreCase(language)) {
return 2;
}
if (NPStringFog.decode("1E1C").equalsIgnoreCase(language)) {
return 5;
}
if (NPStringFog.decode("1C05").equalsIgnoreCase(language)) {
return 6;
}
return 0;
}
public boolean isCrappyDevice() {
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
Log.d(NPStringFog.decode("263F202C5D"), String.format("MODEL=%s, MANUFACTURER=%s, WIDTH=%d, HEIGHT=%d", Build.MODEL, Build.MANUFACTURER, Integer.valueOf(size.x), Integer.valueOf(size.y)));
return size.y <= 600 || NPStringFog.decode("292440315B505755").equals(Build.MODEL) || NPStringFog.decode("292440315B505655").equals(Build.MODEL) || NPStringFog.decode("2924403159545755").equals(Build.MODEL) || NPStringFog.decode("2924403159545655").equals(Build.MODEL);
}
public boolean isNexus9() {
return NPStringFog.decode("201515141D415E").equals(Build.MODEL);
}
public void logFlurryEvent(String name, String[] keys, String[] values, boolean timed) {
this.flurryManager.logEvent(name, keys, values, timed);
}
}