Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;

public class Main {

    public static String getISN() {
        return getSystemOutput("getprop ro.isn").replace("\n", "");
    }

    public static String getSystemOutput(String paramString) {
        String str1 = "";
        try {
            Process localProcess = Runtime.getRuntime().exec(paramString);
            InputStream localInputStream = localProcess.getInputStream();
            InputStreamReader localInputStreamReader = new InputStreamReader(localInputStream);
            BufferedReader localBufferedReader = new BufferedReader(localInputStreamReader);
            for (;;) {
                String str2 = localBufferedReader.readLine();
                if (str2 == null) {
                    break;
                }
                StringBuilder localStringBuilder1 = new StringBuilder();
                str1 = str1 + str2;
                StringBuilder localStringBuilder2 = new StringBuilder();
                str1 = str1 + "\n";
            }
            int i = localProcess.waitFor();
            PrintStream localPrintStream = System.out;
            StringBuilder localStringBuilder3 = new StringBuilder();
            localPrintStream.println("Process exitValue: " + i);
            return str1;
        } catch (Throwable localThrowable) {
            for (;;) {
                localThrowable.printStackTrace();
            }
        }
    }
}