- 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

View File

@@ -11,7 +11,6 @@ import android.util.Log;
public class DeckImporter
{
public static String importDeck( File f, String mypath, String activePath )
{
String message = "";
@@ -52,8 +51,7 @@ public class DeckImporter
arranged = arranged.substring(5);
slines[1] = slines[1].replaceAll("\\[", "").replaceAll("\\]", "");
deck += arranged + " (" + renameSet(slines[1]) + ") * " + slines[0] + "\n";
}
else
} else
{
deck += arranged + "(*) * " + slines[0] + "\n";
}
@@ -84,7 +82,8 @@ public class DeckImporter
FileOutputStream fop = new FileOutputStream(toSave);
// if file doesn't exists, then create it
if (!toSave.exists()) {
if (!toSave.exists())
{
toSave.createNewFile();
}
// get the content in bytes
@@ -93,29 +92,24 @@ public class DeckImporter
fop.flush();
fop.close();
message = "Import Deck Success!\n" + cardcount + " total cards in this deck\n\n" + deck;
}
catch (IOException e)
} catch (IOException e)
{
message = e.getMessage();
}
}
else
} else
{
message = "Missing Folder!";
}
}
}
else
} else
{
message = "Invalid Profile!";
}
}
else
} else
{
message = "No errors, and file EMPTY";
}
}
catch(IOException e)
} catch (IOException e)
{
message = e.getMessage();
}
@@ -278,5 +272,4 @@ public class DeckImporter
else
return set;
}
}

View File

@@ -310,50 +310,59 @@ public class StorageOptions
*
* @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
String buildTags = android.os.Build.TAGS;
if (buildTags != null && buildTags.contains("test-keys")) {
if (buildTags != null && buildTags.contains("test-keys"))
{
return true;
}
// check if /system/app/Superuser.apk is present
try {
try
{
File file = new File("/system/app/Superuser.apk");
if (file.exists()) {
if (file.exists())
{
return true;
}
}
catch (Exception e1) {
} catch (Exception e1)
{
// ignore
}
try {
try
{
File file = new File("/system/app/Superuser/Superuser.apk");
if (file.exists()) {
if (file.exists())
{
return true;
}
}
catch (Exception e1) {
} catch (Exception e1)
{
// ignore
}
//SuperSU
try {
try
{
File file = new File("/system/app/SuperSU.apk");
if (file.exists()) {
if (file.exists())
{
return true;
}
}
catch (Exception e1) {
} catch (Exception e1)
{
// ignore
}
try {
try
{
File file = new File("/system/app/SuperSU/SuperSU.apk");
if (file.exists()) {
if (file.exists())
{
return true;
}
}
catch (Exception e1) {
} catch (Exception e1)
{
// ignore
}
// try executing commands
@@ -362,20 +371,23 @@ public class StorageOptions
}
// executes a command on the system
private static boolean canExecuteCommand(String command) {
private static boolean canExecuteCommand(String command)
{
boolean executedSuccesfully;
try {
try
{
Runtime.getRuntime().exec(command);
executedSuccesfully = true;
}
catch (Exception e) {
} catch (Exception e)
{
executedSuccesfully = false;
}
return executedSuccesfully;
}
private static boolean findForcemount(){
private static boolean findForcemount()
{
try
{
File file = new File(System.getenv("EXTERNAL_STORAGE") + "/forcemount");
@@ -383,8 +395,7 @@ public class StorageOptions
{
return true;
}
}
catch (Exception e1)
} catch (Exception e1)
{
return false;
}

View File

@@ -14,8 +14,6 @@ import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Scanner;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
@@ -1096,7 +1094,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
try
{
EGL10 egl = (EGL10) EGLContext.getEGL();
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();
if (mEGLSurface != null)
{
/*
* 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
public void flipEGL()
{
if (!mSurfaceValid)
{
createSurface(this.getHolder());
@@ -1223,7 +1218,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
Log.e("SDL", s.toString());
}
}
}
// 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)
return false;
if (event.getAction() == KeyEvent.ACTION_DOWN)
{
// Log.d("SDL", "key down: " + keyCode);
@@ -1252,7 +1247,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
// Touch events
public boolean onTouch(View v, MotionEvent event)
{
for (int index = 0; index < event.getPointerCount(); ++index)
{
int action = event.getActionMasked();