- only minor whitespace formatting Android

This commit is contained in:
Rolzad73
2016-08-04 08:32:17 -04:00
parent 62a6ddf3ca
commit dd5635d9cd
3 changed files with 169 additions and 171 deletions
@@ -11,7 +11,6 @@ import android.util.Log;
public class DeckImporter public class DeckImporter
{ {
public static String importDeck( File f, String mypath, String activePath ) public static String importDeck( File f, String mypath, String activePath )
{ {
String message = ""; String message = "";
@@ -52,8 +51,7 @@ public class DeckImporter
arranged = arranged.substring(5); arranged = arranged.substring(5);
slines[1] = slines[1].replaceAll("\\[", "").replaceAll("\\]", ""); slines[1] = slines[1].replaceAll("\\[", "").replaceAll("\\]", "");
deck += arranged + " (" + renameSet(slines[1]) + ") * " + slines[0] + "\n"; deck += arranged + " (" + renameSet(slines[1]) + ") * " + slines[0] + "\n";
} } else
else
{ {
deck += arranged + "(*) * " + slines[0] + "\n"; deck += arranged + "(*) * " + slines[0] + "\n";
} }
@@ -84,7 +82,8 @@ public class DeckImporter
FileOutputStream fop = new FileOutputStream(toSave); FileOutputStream fop = new FileOutputStream(toSave);
// if file doesn't exists, then create it // if file doesn't exists, then create it
if (!toSave.exists()) { if (!toSave.exists())
{
toSave.createNewFile(); toSave.createNewFile();
} }
// get the content in bytes // get the content in bytes
@@ -93,29 +92,24 @@ public class DeckImporter
fop.flush(); fop.flush();
fop.close(); fop.close();
message = "Import Deck Success!\n" + cardcount + " total cards in this deck\n\n" + deck; message = "Import Deck Success!\n" + cardcount + " total cards in this deck\n\n" + deck;
} } catch (IOException e)
catch (IOException e)
{ {
message = e.getMessage(); message = e.getMessage();
} }
} } else
else
{ {
message = "Missing Folder!"; message = "Missing Folder!";
} }
} }
} } else
else
{ {
message = "Invalid Profile!"; message = "Invalid Profile!";
} }
} } else
else
{ {
message = "No errors, and file EMPTY"; message = "No errors, and file EMPTY";
} }
} } catch (IOException e)
catch(IOException e)
{ {
message = e.getMessage(); message = e.getMessage();
} }
@@ -278,5 +272,4 @@ public class DeckImporter
else else
return set; return set;
} }
} }
@@ -310,50 +310,59 @@ public class StorageOptions
* *
* @return <code>true</code> if the device is rooted, <code>false</code> otherwise. * @return <code>true</code> if the device is rooted, <code>false</code> otherwise.
*/ */
public static boolean isRooted() { public static boolean isRooted()
{
// get from build info // get from build info
String buildTags = android.os.Build.TAGS; String buildTags = android.os.Build.TAGS;
if (buildTags != null && buildTags.contains("test-keys")) { if (buildTags != null && buildTags.contains("test-keys"))
{
return true; return true;
} }
// check if /system/app/Superuser.apk is present // check if /system/app/Superuser.apk is present
try { try
{
File file = new File("/system/app/Superuser.apk"); File file = new File("/system/app/Superuser.apk");
if (file.exists()) { if (file.exists())
{
return true; return true;
} }
} } catch (Exception e1)
catch (Exception e1) { {
// ignore // ignore
} }
try { try
{
File file = new File("/system/app/Superuser/Superuser.apk"); File file = new File("/system/app/Superuser/Superuser.apk");
if (file.exists()) { if (file.exists())
{
return true; return true;
} }
} } catch (Exception e1)
catch (Exception e1) { {
// ignore // ignore
} }
//SuperSU //SuperSU
try { try
{
File file = new File("/system/app/SuperSU.apk"); File file = new File("/system/app/SuperSU.apk");
if (file.exists()) { if (file.exists())
{
return true; return true;
} }
} } catch (Exception e1)
catch (Exception e1) { {
// ignore // ignore
} }
try { try
{
File file = new File("/system/app/SuperSU/SuperSU.apk"); File file = new File("/system/app/SuperSU/SuperSU.apk");
if (file.exists()) { if (file.exists())
{
return true; return true;
} }
} } catch (Exception e1)
catch (Exception e1) { {
// ignore // ignore
} }
// try executing commands // try executing commands
@@ -362,20 +371,23 @@ public class StorageOptions
} }
// executes a command on the system // executes a command on the system
private static boolean canExecuteCommand(String command) { private static boolean canExecuteCommand(String command)
{
boolean executedSuccesfully; boolean executedSuccesfully;
try { try
{
Runtime.getRuntime().exec(command); Runtime.getRuntime().exec(command);
executedSuccesfully = true; executedSuccesfully = true;
} } catch (Exception e)
catch (Exception e) { {
executedSuccesfully = false; executedSuccesfully = false;
} }
return executedSuccesfully; return executedSuccesfully;
} }
private static boolean findForcemount(){ private static boolean findForcemount()
{
try try
{ {
File file = new File(System.getenv("EXTERNAL_STORAGE") + "/forcemount"); File file = new File(System.getenv("EXTERNAL_STORAGE") + "/forcemount");
@@ -383,8 +395,7 @@ public class StorageOptions
{ {
return true; return true;
} }
} } catch (Exception e1)
catch (Exception e1)
{ {
return false; return false;
} }
@@ -14,8 +14,6 @@ import java.net.URLConnection;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Scanner; import java.util.Scanner;
import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.egl.EGLContext;
@@ -1096,7 +1094,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
try try
{ {
EGL10 egl = (EGL10) EGLContext.getEGL(); EGL10 egl = (EGL10) EGLContext.getEGL();
EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
@@ -1162,7 +1159,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
EGL10 egl = (EGL10) EGLContext.getEGL(); EGL10 egl = (EGL10) EGLContext.getEGL();
if (mEGLSurface != null) if (mEGLSurface != null)
{ {
/* /*
* Unbind and destroy the old EGL surface, if there is one. * Unbind and destroy the old EGL surface, if there is one.
*/ */
@@ -1197,7 +1193,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
// EGL buffer flip // EGL buffer flip
public void flipEGL() public void flipEGL()
{ {
if (!mSurfaceValid) if (!mSurfaceValid)
{ {
createSurface(this.getHolder()); createSurface(this.getHolder());
@@ -1223,7 +1218,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
Log.e("SDL", s.toString()); Log.e("SDL", s.toString());
} }
} }
} }
// Key events // Key events
@@ -1234,6 +1228,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)
return false; return false;
if (event.getAction() == KeyEvent.ACTION_DOWN) if (event.getAction() == KeyEvent.ACTION_DOWN)
{ {
// Log.d("SDL", "key down: " + keyCode); // Log.d("SDL", "key down: " + keyCode);
@@ -1252,7 +1247,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
// Touch events // Touch events
public boolean onTouch(View v, MotionEvent event) public boolean onTouch(View v, MotionEvent event)
{ {
for (int index = 0; index < event.getPointerCount(); ++index) for (int index = 0; index < event.getPointerCount(); ++index)
{ {
int action = event.getActionMasked(); int action = event.getActionMasked();