Skip to content

Commit bbd781a

Browse files
committed
app: Add support for printing out raw input & output
1 parent dce10a1 commit bbd781a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/src/main/java/xzr/hkf/MainActivity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import android.widget.Toast;
1313

1414
public class MainActivity extends Activity {
15+
static final boolean DEBUG = false;
16+
1517
TextView logView;
1618
ScrollView scrollView;
1719
enum status{
@@ -102,6 +104,10 @@ public static void _appendLog(String log, Activity activity){
102104
}
103105

104106
public static void appendLog(String log, Activity activity){
107+
if(DEBUG) {
108+
_appendLog(log,activity);
109+
return;
110+
}
105111
if(!log.startsWith("ui_print"))
106112
return;
107113
log=log.replace("ui_print","");

app/src/main/java/xzr/hkf/Worker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void flash(Activity activity) throws IOException {
127127
OutputStreamWriter outputStreamWriter=new OutputStreamWriter(process.getOutputStream());
128128
BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(process.getInputStream()));
129129
outputStreamWriter.write("export POSTINSTALL="+activity.getFilesDir()+"\n");
130-
outputStreamWriter.write("sh "+binary_path+" 3 1 "+file_path+"&& touch "+activity.getFilesDir()+"/done\nexit\n");
130+
outputStreamWriter.write("sh "+(MainActivity.DEBUG?"-x ":"")+binary_path+" 3 1 "+file_path+"&& touch "+activity.getFilesDir()+"/done\nexit\n");
131131
outputStreamWriter.flush();
132132
String line;
133133
while((line=bufferedReader.readLine())!=null)

0 commit comments

Comments
 (0)