SHARE
TWEET

Untitled

a guest Apr 18th, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //taken from nostalgia android emulator launcher
  2.  
  3.     public Intent getEmulatorIntent(String fileName, String ime, Context context) {
  4.         Intent intent = new Intent();
  5.         if ("gbcoid".equals(this.selectedEmulator)) {
  6.             intent.setComponent(new ComponentName("com.androidemu.gbc", "com.androidemu.gbc.EmulatorActivity"));
  7.             intent.setAction("android.intent.action.VIEW");
  8.             intent.setData(Uri.fromFile(new File(fileName)));
  9.         } else if ("gameboid".equals(this.selectedEmulator)) {
  10.             intent.setComponent(new ComponentName("com.androidemu.gba", "com.androidemu.gba.EmulatorActivity"));
  11.             intent.setAction("android.intent.action.VIEW");
  12.             intent.setData(Uri.fromFile(new File(fileName)));
  13.         } else if ("n64oid".equals(this.selectedEmulator)) {
  14.             intent.setComponent(new ComponentName("com.androidemu.n64", "com.androidemu.n64.EmulatorActivity"));
  15.             intent.setAction("android.intent.action.VIEW");
  16.             intent.setData(Uri.fromFile(new File(fileName)));
  17.         } else if ("mupen64 plus ae".equals(this.selectedEmulator)) {
  18.             intent.setComponent(new ComponentName("paulscode.android.mupen64plusae", "paulscode.android.mupen64plusae.MainActivity"));
  19.             intent.setAction("android.intent.action.VIEW");
  20.             intent.setData(Uri.fromFile(new File(fileName)));
  21.         } else if ("snesoid".equals(this.selectedEmulator)) {
  22.             intent.setComponent(new ComponentName("com.androidemu.snes", "com.androidemu.snes.EmulatorActivity"));
  23.             intent.setAction("android.intent.action.VIEW");
  24.             intent.setData(Uri.fromFile(new File(fileName)));
  25.         } else if ("nesoid".equals(this.selectedEmulator)) {
  26.             intent.setComponent(new ComponentName("com.androidemu.nes", "com.androidemu.nes.EmulatorActivity"));
  27.             intent.setAction("android.intent.action.VIEW");
  28.             intent.setData(Uri.fromFile(new File(fileName)));
  29.         } else if ("gensoid".equals(this.selectedEmulator)) {
  30.             intent.setComponent(new ComponentName("com.androidemu.gens", "com.androidemu.gens.EmulatorActivity"));
  31.             intent.setAction("android.intent.action.VIEW");
  32.             intent.setData(Uri.fromFile(new File(fileName)));
  33.         } else if ("gearoid".equals(this.selectedEmulator)) {
  34.             intent.setComponent(new ComponentName("com.androidemu.gg", "com.androidemu.gg.EmulatorActivity"));
  35.             intent.setAction("android.intent.action.VIEW");
  36.             intent.setData(Uri.fromFile(new File(fileName)));
  37.         } else if ("epsxe".equals(this.selectedEmulator)) {
  38.             intent.setComponent(new ComponentName("com.epsxe.ePSXe", "com.epsxe.ePSXe.ePSXe"));
  39.             intent.setAction("android.intent.action.MAIN");
  40.             intent.putExtra("com.epsxe.ePSXe.isoName", fileName);
  41.             intent.putExtra("com.epsxe.ePSXe.isoSlot", "0");
  42.             intent.putExtra("com.epsxe.ePSXe.gui", "0");
  43.         } else if ("fpse".equals(this.selectedEmulator)) {
  44.             intent.setComponent(new ComponentName("com.emulator.fpse", "com.emulator.fpse.Main"));
  45.             intent.setAction("android.intent.action.MAIN");
  46.             intent.putExtra(ClientCookie.PATH_ATTR, fileName);
  47.             intent.putExtra("glblit", false);
  48.             intent.putExtra("aspect", 1);
  49.             intent.putExtra("video", 2);
  50.             intent.putExtra("bios", 1);
  51.         } else if ("nes.emu".equals(this.selectedEmulator)) {
  52.             intent.setComponent(new ComponentName("com.explusalpha.NesEmu", "com.imagine.BaseActivity"));
  53.             intent.setAction("android.intent.action.VIEW");
  54.             intent.setData(Uri.fromFile(new File(fileName)));
  55.         } else if ("msx.emu".equals(this.selectedEmulator)) {
  56.             intent.setComponent(new ComponentName("com.explusalpha.MsxEmu", "com.imagine.BaseActivity"));
  57.             intent.setAction("android.intent.action.VIEW");
  58.             intent.setData(Uri.fromFile(new File(fileName)));
  59.         } else if ("gbc.emu".equals(this.selectedEmulator)) {
  60.             intent.setComponent(new ComponentName("com.explusalpha.GbcEmu", "com.imagine.BaseActivity"));
  61.             intent.setAction("android.intent.action.VIEW");
  62.             intent.setData(Uri.fromFile(new File(fileName)));
  63.         } else if ("ngp.emu".equals(this.selectedEmulator)) {
  64.             intent.setComponent(new ComponentName("com.explusalpha.NgpEmu", "com.imagine.BaseActivity"));
  65.             intent.setAction("android.intent.action.VIEW");
  66.             intent.setData(Uri.fromFile(new File(fileName)));
  67.         } else if ("c64.emu".equals(this.selectedEmulator)) {
  68.             intent.setComponent(new ComponentName("com.explusalpha.C64Emu", "com.imagine.BaseActivity"));
  69.             intent.setAction("android.intent.action.VIEW");
  70.             intent.setData(Uri.fromFile(new File(fileName)));
  71.         } else if ("2600.emu".equals(this.selectedEmulator)) {
  72.             intent.setComponent(new ComponentName("com.explusalpha.A2600Emu", "com.imagine.BaseActivity"));
  73.             intent.setAction("android.intent.action.VIEW");
  74.             intent.setData(Uri.fromFile(new File(fileName)));
  75.         } else if ("pce.emu".equals(this.selectedEmulator)) {
  76.             intent.setComponent(new ComponentName("com.PceEmu", "com.imagine.BaseActivity"));
  77.             intent.setAction("android.intent.action.VIEW");
  78.             intent.setData(Uri.fromFile(new File(fileName)));
  79.         } else if ("neo.emu".equals(this.selectedEmulator)) {
  80.             intent.setComponent(new ComponentName("com.explusalpha.NeoEmu", "com.imagine.BaseActivity"));
  81.             intent.setAction("android.intent.action.VIEW");
  82.             intent.setData(Uri.fromFile(new File(fileName)));
  83.         } else if ("gba.emu".equals(this.selectedEmulator)) {
  84.             intent.setComponent(new ComponentName("com.explusalpha.GbaEmu", "com.imagine.BaseActivity"));
  85.             intent.setAction("android.intent.action.VIEW");
  86.             intent.setData(Uri.fromFile(new File(fileName)));
  87.         } else if ("md.emu".equals(this.selectedEmulator)) {
  88.             intent.setComponent(new ComponentName("com.explusalpha.MdEmu", "com.imagine.BaseActivity"));
  89.             intent.setAction("android.intent.action.VIEW");
  90.             intent.setData(Uri.fromFile(new File(fileName)));
  91.         } else if ("msx.emu".equals(this.selectedEmulator)) {
  92.             intent.setComponent(new ComponentName("com.explusalpha.MsxEmu", "com.imagine.BaseActivity"));
  93.             intent.setAction("android.intent.action.VIEW");
  94.             intent.setData(Uri.fromFile(new File(fileName)));
  95.         } else if ("snes9x ex+".equals(this.selectedEmulator)) {
  96.             intent.setComponent(new ComponentName("com.explusalpha.Snes9xPlus", "com.imagine.BaseActivity"));
  97.             intent.setAction("android.intent.action.VIEW");
  98.             intent.setData(Uri.fromFile(new File(fileName)));
  99.         } else if ("drastic".equals(this.selectedEmulator)) {
  100.             intent.setComponent(new ComponentName("com.dsemu.drastic", "com.dsemu.drastic.DraSticActivity"));
  101.             intent.setAction("android.intent.action.VIEW");
  102.             intent.putExtra("GAMEPATH", new File(fileName).getPath());
  103.         } else if ("reicast".equals(this.selectedEmulator)) {
  104.             intent.setComponent(new ComponentName("com.reicast.emulator", "com.reicast.emulator.MainActivity"));
  105.             intent.setAction("android.intent.action.VIEW");
  106.             intent.setData(Uri.fromFile(new File(fileName)));
  107.         } else if ("ppsspp".equals(this.selectedEmulator)) {
  108.             intent.setComponent(new ComponentName("org.ppsspp.ppsspp", "org.ppsspp.ppsspp.PpssppActivity"));
  109.             intent.setAction("android.intent.action.MAIN");
  110.             intent.putExtra("org.ppsspp.ppsspp.Shortcuts", fileName);
  111.         } else if ("ppsspp gold".equals(this.selectedEmulator)) {
  112.             intent.setComponent(new ComponentName("org.ppsspp.ppssppgold", "org.ppsspp.ppssppgold.PpssppActivity"));
  113.             intent.setAction("android.intent.action.MAIN");
  114.             intent.putExtra("org.ppsspp.ppssppgold.Shortcuts", fileName);
  115.         } else if ("supergnes lite".equals(this.selectedEmulator)) {
  116.             intent.setComponent(new ComponentName("com.bubblezapgames.supergnes_lite", "com.bubblezapgames.supergnes_lite.SuperGNES"));
  117.             intent.setAction("android.intent.action.VIEW");
  118.             intent.setData(Uri.fromFile(new File(fileName)));
  119.         } else if ("supergnes".equals(this.selectedEmulator)) {
  120.             intent.setComponent(new ComponentName("com.bubblezapgames.supergnes", "com.bubblezapgames.supergnes.Splash"));
  121.             intent.setAction("android.intent.action.VIEW");
  122.             intent.setData(Uri.fromFile(new File(fileName)));
  123.         } else if (this.selectedEmulator.contains("retroarch")) {
  124.             intent.setComponent(new ComponentName("com.retroarch", "com.retroarch.browser.retroactivity.RetroActivityFuture"));
  125.             intent.putExtra("ROM", fileName);
  126.             intent.putExtra("CONFIGFILE", getRetroarchProperties(context));
  127.             intent.putExtra("IME", ime);
  128.             System.out.println(this.systemName);
  129.             System.out.println(this.selectedEmulator);
  130.             System.out.println(fileName);
  131.             if ("PLAYSTATION".equals(this.systemName) && "retroarch - pcsx rearmed".equals(this.selectedEmulator)) {
  132.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/pcsx_rearmed_libretro_neon_android.so");
  133.             } else if ("PLAYSTATION".equals(this.systemName) && "retroarch - mednafen: psx".equals(this.selectedEmulator)) {
  134.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/mednafen_psx_libretro_android.so");
  135.             } else if (("GBA".equals(this.systemName) || "GBC".equals(this.systemName) || "GAMEBOY".equals(this.systemName)) && "retroarch - vba next".equals(this.selectedEmulator)) {
  136.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/vba_next_libretro_android.so");
  137.             } else if (("GBA".equals(this.systemName) || "GBC".equals(this.systemName) || "GAMEBOY".equals(this.systemName)) && "retroarch - vba-m".equals(this.selectedEmulator)) {
  138.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/vbam_libretro_android.so");
  139.             } else if (("NGPC".equals(this.systemName) || "NGP".equals(this.systemName)) && "retroarch - mednafen: neopop".equals(this.selectedEmulator)) {
  140.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/mednafen_ngp_libretro_android.so");
  141.             } else if (("GBC".equals(this.systemName) || "GAMEBOY".equals(this.systemName)) && "retroarch - gambatte".equals(this.selectedEmulator)) {
  142.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/gambatte_libretro_android.so");
  143.             } else if ("VB".equals(this.systemName) && "retroarch - mednafen: vb".equals(this.selectedEmulator)) {
  144.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/mednafen_vb_libretro_android.so");
  145.             } else if ("SNES".equals(this.systemName) && "retroarch - bsnes".equals(this.selectedEmulator)) {
  146.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/bsnes_performance_libretro_android.so");
  147.             } else if ("NES".equals(this.systemName) && "retroarch - fceumm".equals(this.selectedEmulator)) {
  148.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/fceumm_libretro_android.so");
  149.             } else if ("NES".equals(this.systemName) && "retroarch - quicknes".equals(this.selectedEmulator)) {
  150.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/quicknes_libretro_android.so");
  151.             } else if ("MASTERSYSTEM".equals(this.systemName) || (("GG".equals(this.systemName) || "GENESIS".equals(this.systemName) || "SEGACD".equals(this.systemName)) && "retroarch - genesis plus gx".equals(this.selectedEmulator))) {
  152.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/genesis_plus_gx_libretro_android.so");
  153.             } else if (("MASTERSYSTEM".equals(this.systemName) || "32X".equals(this.systemName) || "GENESIS".equals(this.systemName) || "SEGACD".equals(this.systemName)) && "retroarch - picodrive".equals(this.selectedEmulator)) {
  154.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/picodrive_libretro_android.so");
  155.             } else if ("NES".equals(this.systemName) && "retroarch - nestopia".equals(this.selectedEmulator)) {
  156.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/nestopia_libretro_android.so");
  157.             } else if ("SNES".equals(this.systemName) && "retroarch - snesx9x".equals(this.selectedEmulator)) {
  158.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/snes9x_libretro_android.so");
  159.             } else if ("SNES".equals(this.systemName) && "retroarch - snesx9x next".equals(this.selectedEmulator)) {
  160.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/snes9x_next_libretro_android.so");
  161.             } else if ("TG16".equals(this.systemName) && "retroarch - mednafen: pce".equals(this.selectedEmulator)) {
  162.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/mednafen_pce_fast_libretro_android.so");
  163.             } else if ("2600".equals(this.systemName) && "retroarch - stella".equals(this.selectedEmulator)) {
  164.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/stella_libretro_android.so");
  165.             } else if ("NDS".equals(this.systemName) && "retroarch - desmume".equals(this.selectedEmulator)) {
  166.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/desmume_libretro_android.so");
  167.             } else if ("N64".equals(this.systemName) && "retroarch - mupen64plus".equals(this.selectedEmulator)) {
  168.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/mupen64plus_libretro_android.so");
  169.             } else if ("MAME".equals(this.systemName) && "retroarch - finalburn alpha".equals(this.selectedEmulator)) {
  170.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/fb_alpha_libretro_android.so");
  171.             } else if ("MAME".equals(this.systemName) && "retroarch - mame 0.78".equals(this.selectedEmulator)) {
  172.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/mame078_libretro_android.so");
  173.             } else if ("MAME".equals(this.systemName) && "retroarch - mame 0.139".equals(this.selectedEmulator)) {
  174.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/mame2010_libretro_android.so");
  175.             } else if ("LYNX".equals(this.systemName) && "retroarch - handy".equals(this.selectedEmulator)) {
  176.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/handy_libretro_android.so");
  177.             } else if ("WONDERSWAN".equals(this.systemName) && "retroarch - mednafen: wonderswan".equals(this.selectedEmulator)) {
  178.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/mednafen_wswan_libretro_android.so");
  179.             } else if ("WONDERSWAN_COLOR".equals(this.systemName) && "retroarch - mednafen: wonderswan".equals(this.selectedEmulator)) {
  180.                 intent.putExtra("LIBRETRO", "/data/data/com.retroarch/cores/mednafen_wswan_libretro_android.so");
  181.             }
  182.         }
  183.         return intent;
  184.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top