Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
- // Jad home page: http://www.geocities.com/kpdus/jad.html
- // Decompiler options: braces fieldsfirst space lnc
- package com.shieldcade.hyperspin;
- import android.app.AlertDialog;
- import android.app.NativeActivity;
- import android.content.ComponentName;
- import android.content.Context;
- import android.content.DialogInterface;
- import android.content.Intent;
- import android.content.SharedPreferences;
- import android.content.pm.ApplicationInfo;
- import android.content.pm.PackageManager;
- import android.net.Uri;
- import android.os.Bundle;
- import android.text.Html;
- import android.util.Log;
- import android.view.View;
- import android.view.Window;
- import android.widget.Toast;
- import java.io.File;
- import java.text.DateFormat;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.zip.ZipEntry;
- import java.util.zip.ZipFile;
- public class HSFENativeActivity extends NativeActivity
- {
- private class ToastError
- implements Runnable
- {
- String text;
- final HSFENativeActivity this$0;
- public void run()
- {
- Toast.makeText(HSFENativeActivity.this, text, 0).show();
- }
- public ToastError(String s)
- {
- this$0 = HSFENativeActivity.this;
- super();
- text = s;
- }
- }
- public static final String TAG = "HSFENativeActivity";
- public HSFENativeActivity()
- {
- }
- private void setUiVisibility(View view, int i)
- {
- if ((i & 4) == 0)
- {
- view.setSystemUiVisibility(5638);
- }
- }
- private void setupExtrasIntent(Intent intent, String s, String s1, String s2, String s3)
- {
- intent.putExtra(s, (new StringBuilder(String.valueOf(s2))).append("/").append(s1).append(".").append(s3).toString());
- Log.d("HSFENativeActivity", (new StringBuilder("Extras Intent: ")).append(intent.getComponent().getPackageName()).append("/").append(intent.getComponent().getClassName()).append(" Action: ").append(intent.getAction()).append(" Extra: ").append(s).append(" ").append(intent.getStringExtra(s)).toString());
- }
- private void setupLibretroIntent(Intent intent, String s, String s1, String s2, String s3, String s4)
- {
- Context context = getApplicationContext();
- intent.putExtra("ROM", (new StringBuilder(String.valueOf(s2))).append("/").append(s1).append(".").append(s3).toString());
- intent.putExtra("LIBRETRO", (new StringBuilder("/data/data/")).append(s).append("/").append(s4).toString());
- intent.putExtra("CONFIGFILE", (new StringBuilder("/data/data/")).append(s).append("/retroarch.cfg").toString());
- intent.putExtra("IME", android.provider.Settings.Secure.getString(context.getContentResolver(), "default_input_method"));
- intent.putExtra("DATADIR", (new StringBuilder("/data/data/")).append(s).toString());
- Log.d("HSFENativeActivity", (new StringBuilder("Retroarch Intent: ")).append(intent.getComponent().getPackageName()).append(" ROM: ").append(intent.getStringExtra("ROM")).append(" LIBRETRO: ").append(intent.getStringExtra("LIBRETRO")).append(" CONFIGFILE: ").append(intent.getStringExtra("CONFIGFILE")).append(" IME: ").append(intent.getStringExtra("IME")).append(" DATADIR: ").append(intent.getStringExtra("DATADIR")).toString());
- }
- private void setupUriIntent(Intent intent, String s, String s1, String s2)
- {
- intent.setData(Uri.parse((new StringBuilder("file://")).append(s1).append("/").append(s).append(".").append(s2).toString()));
- Log.d("HSFENativeActivity", (new StringBuilder("Uri Intent: ")).append(intent.getComponent().getPackageName()).append("/").append(intent.getComponent().getClassName()).append(" Action: ").append(intent.getAction()).append(" Rom: ").append(intent.getDataString()).toString());
- }
- private void showAboutDialog()
- {
- String s;
- Object obj;
- obj = "Build Date: ";
- s = ((String) (obj));
- ZipFile zipfile = new ZipFile(getPackageManager().getApplicationInfo(getPackageName(), 0).sourceDir);
- s = ((String) (obj));
- long l = zipfile.getEntry("classes.dex").getTime();
- s = ((String) (obj));
- obj = (new StringBuilder(String.valueOf("Build Date: "))).append(SimpleDateFormat.getDateInstance().format(new Date(l))).toString();
- s = ((String) (obj));
- try
- {
- zipfile.close();
- }
- catch (Exception exception)
- {
- exception = (new StringBuilder(String.valueOf(s))).append("Unknown").toString();
- }
- s = (new StringBuilder(String.valueOf(obj))).append("<br/><br/>").toString();
- obj = new android.app.AlertDialog.Builder(this);
- ((android.app.AlertDialog.Builder) (obj)).setTitle("About");
- ((android.app.AlertDialog.Builder) (obj)).setMessage(Html.fromHtml((new StringBuilder(String.valueOf(s))).append(getString(0x7f030001)).toString()));
- ((android.app.AlertDialog.Builder) (obj)).create().show();
- return;
- }
- public boolean launchApp(String s)
- {
- Intent intent = getPackageManager().getLaunchIntentForPackage(s);
- try
- {
- startActivity(intent);
- }
- catch (Exception exception)
- {
- s = (new StringBuilder("Warning - Attempting to launch an invalid app: ")).append(s).toString();
- Log.w("HSFENativeActivity", s);
- runOnUiThread(new ToastError(s));
- return false;
- }
- return true;
- }
- public boolean launchEmulator(String s, String s1, String s2, String s3, String s4, String s5)
- {
- String as[];
- int i;
- as = s4.split(",");
- i = 0;
- break MISSING_BLOCK_LABEL_13;
- while (i < as.length && !(new File((new StringBuilder(String.valueOf(s3))).append("/").append(s2).append(".").append(as[i]).toString())).exists())
- {
- i++;
- }
- if (i >= as.length)
- {
- Log.w("HSFENativeActivity", "Warning - Attempting to launch missing rom");
- runOnUiThread(new ToastError("Warning - Attempting to launch missing rom"));
- return false;
- }
- break MISSING_BLOCK_LABEL_114;
- String as1[] = s1.split("\\|");
- s4 = s5.split("\\|");
- s = s4;
- if (s4.length < as1.length)
- {
- s = new String[as1.length];
- System.arraycopy(s4, 0, s, 0, s4.length);
- }
- int j = 0;
- do
- {
- if (j >= as1.length)
- {
- s = (new StringBuilder("Warning - Attempting to launch invalid emulator(s): ")).append(s1).toString();
- Log.w("HSFENativeActivity", s);
- runOnUiThread(new ToastError(s));
- return false;
- }
- boolean flag = true;
- Log.w("HSFENativeActivity", (new StringBuilder("Attempting ")).append(j).append(": ").append(as1[j]).append(" args: ").append(s[j]).toString());
- s5 = new Intent();
- s4 = as1[j].split("/");
- s5.setComponent(new ComponentName(s4[0], s4[1]));
- if (s4[0].equals("com.retroarch"))
- {
- setupLibretroIntent(s5, s4[0], s2, s3, as[i], s[j]);
- } else
- if (s[j] != null && !s[j].isEmpty())
- {
- setupExtrasIntent(s5, s[j], s2, s3, as[i]);
- } else
- {
- s5.setAction("android.intent.action.VIEW");
- setupUriIntent(s5, s2, s3, as[i]);
- }
- try
- {
- startActivity(s5);
- }
- // Misplaced declaration of an exception variable
- catch (String s5)
- {
- Log.w("HSFENativeActivity", (new StringBuilder("Warning - Launching ")).append(s4[0]).append(" failed").toString());
- flag = false;
- }
- if (flag)
- {
- return true;
- }
- j++;
- } while (true);
- }
- protected void onCreate(Bundle bundle)
- {
- final View decorView = getWindow().getDecorView();
- decorView.setOnSystemUiVisibilityChangeListener(new android.view.View.OnSystemUiVisibilityChangeListener() {
- final HSFENativeActivity this$0;
- private final View val$decorView;
- public void onSystemUiVisibilityChange(int i)
- {
- setUiVisibility(decorView, i);
- }
- {
- this$0 = HSFENativeActivity.this;
- decorView = view;
- super();
- }
- });
- super.onCreate(bundle);
- }
- public void onWindowFocusChanged(boolean flag)
- {
- super.onWindowFocusChanged(flag);
- if (flag)
- {
- setUiVisibility(getWindow().getDecorView(), 0);
- }
- }
- public int putgetSharedPrefsFromIni(String s, int i)
- {
- Object obj = getPreferences(0);
- if (i >= 0)
- {
- obj = ((SharedPreferences) (obj)).edit();
- ((android.content.SharedPreferences.Editor) (obj)).putInt(s, i);
- ((android.content.SharedPreferences.Editor) (obj)).commit();
- return -1;
- } else
- {
- return ((SharedPreferences) (obj)).getInt(s, -1);
- }
- }
- public void showExitDialog()
- {
- runOnUiThread(new Runnable() {
- final HSFENativeActivity this$0;
- public void run()
- {
- android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(HSFENativeActivity.this);
- builder.setTitle("No Hyperspin Data Folder Found!");
- builder.setMessage("Valid locations are \"/storage/usbdrive/Hyperspin\", \"/storage/sdcard1/Hyperspin\", or \"/storage/sdcard0/Hyperspin\". Please visit Hyperspin-fe.com for more info.");
- builder.setPositiveButton("OK", null);
- builder.setOnDismissListener(new android.content.DialogInterface.OnDismissListener() {
- final _cls2 this$1;
- public void onDismiss(DialogInterface dialoginterface)
- {
- finish();
- }
- {
- this$1 = _cls2.this;
- super();
- }
- });
- builder.create().show();
- }
- {
- this$0 = HSFENativeActivity.this;
- super();
- }
- });
- }
- public void showMenu()
- {
- runOnUiThread(new Runnable() {
- final HSFENativeActivity this$0;
- public void run()
- {
- android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(HSFENativeActivity.this);
- builder.setItems(0x7f040000, new android.content.DialogInterface.OnClickListener() {
- final _cls1 this$1;
- public void onClick(DialogInterface dialoginterface, int i)
- {
- switch (i)
- {
- default:
- return;
- case 0: // '\0'
- showAboutDialog();
- break;
- }
- }
- {
- this$1 = _cls1.this;
- super();
- }
- });
- builder.create().show();
- }
- {
- this$0 = HSFENativeActivity.this;
- super();
- }
- });
- }
- static
- {
- System.loadLibrary("avformat");
- System.loadLibrary("avcodec");
- System.loadLibrary("swscale");
- System.loadLibrary("avutil");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement