mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-19 09:39:25 -04:00
Add print
This commit is contained in:
parent
ca75732aa5
commit
258bfae8ff
@ -110,6 +110,8 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
|
||||
private Button[] controlButtons;
|
||||
|
||||
private PrintStream logStream;
|
||||
|
||||
/*
|
||||
private LinearLayout contentCanvas;
|
||||
private AWTSurfaceView contentCanvasView;
|
||||
@ -122,7 +124,7 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
|
||||
private static final int LTYPE_INVOCATION = 0;
|
||||
private static final int LTYPE_PROCESS = 1;
|
||||
private final int LAUNCH_TYPE = LTYPE_INVOCATION;
|
||||
private final int LAUNCH_TYPE = LTYPE_PROCESS;
|
||||
|
||||
// private static Collection<? extends Provider.Service> rsaPkcs1List;
|
||||
|
||||
@ -137,6 +139,11 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
setContentView(R.layout.main);
|
||||
|
||||
try {
|
||||
File logFile = new File(Tools.MAIN_PATH, "latestlog.txt");
|
||||
logFile.delete();
|
||||
logFile.createNewFile();
|
||||
logStream = new PrintStream(logFile.getAbsolutePath());
|
||||
|
||||
final View decorView = getWindow().getDecorView();
|
||||
decorView.setOnSystemUiVisibilityChangeListener (new View.OnSystemUiVisibilityChangeListener() {
|
||||
@Override
|
||||
@ -156,6 +163,7 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
@Override
|
||||
public void onExitTrapped()
|
||||
{
|
||||
logStream.close();
|
||||
runOnUiThread(new Runnable(){
|
||||
|
||||
@Override
|
||||
@ -1031,6 +1039,7 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
setEnvironment("HOME", Tools.MAIN_PATH);
|
||||
setEnvironment("TMPDIR", getCacheDir().getAbsolutePath());
|
||||
setEnvironment("LIBGL_MIPMAP", "3");
|
||||
setEnvironment("MESA_GLSL_CACHE_DIR", getCacheDir().getAbsolutePath());
|
||||
setEnvironment("LD_LIBRARY_PATH", "$JAVA_HOME/lib:$JAVA_HOME/lib/jli:$JAVA_HOME/lib/server");
|
||||
|
||||
if (LAUNCH_TYPE == LTYPE_PROCESS) {
|
||||
@ -1136,6 +1145,7 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
|
||||
private void appendToLog(final String text, boolean checkAllow) {
|
||||
if (checkAllow && !isLogAllow) return;
|
||||
logStream.print(text);
|
||||
textLog.post(new Runnable(){
|
||||
@Override
|
||||
public void run() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user