// Path: android/app/src/main/java/me/pjq/rpicar/utils/Log.java
// public class Log {
//     static String dateFormat = "yyyy-MM-dd hh:mm:ss";
//     static SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
//     static boolean showLog = true;
// 
//     public static void log(String tag, String msg) {
//         if (showLog) {
//             String source = null;
//             try {
//                 StackTraceElement st = Thread.currentThread().getStackTrace()[2];
//                 source = "[" + st.getFileName() + "] - " + st.getMethodName() + "("
//                         + st.getLineNumber() + ")";
//             } catch (Exception e) {
//             }
// 
//             System.out.println(fm.format(new Date()) + " - " + source + ":" + msg);
//         }
//     }
// }


import java.io.*;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Properties;
import me.pjq.rpicar.utils.Log;
        try {
            Log.log(TAG, "init: " + CONFIG_FILE);
            getAllProperties();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    //读取Properties的全部信息
    public static HashMap<String, String> getAllProperties(String filePath) throws IOException {
        Properties pps = new Properties();
        InputStream in = new BufferedInputStream(new FileInputStream(filePath));
        pps.load(in);
        Enumeration en = pps.propertyNames(); //得到配置文件的名字
        HashMap<String, String> map = new HashMap<>();

        while (en.hasMoreElements()) {
            String strKey = (String) en.nextElement();
            String strValue = pps.getProperty(strKey);
            strValue = new String(strValue.getBytes("ISO-8859-1"),"utf-8");
            System.out.println(strKey + "=" + strValue);
            map.put(strKey, strValue);
        }

        return map;
    }

    public static void getAllProperties() throws IOException {
        File file = new File(".");
// Path: android/app/src/main/java/me/pjq/rpicar/utils/Log.java
// public class Log {
//     static String dateFormat = "yyyy-MM-dd hh:mm:ss";
//     static SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
//     static boolean showLog = true;
// 
//     public static void log(String tag, String msg) {
//         if (showLog) {
//             String source = null;
//             try {
//                 StackTraceElement st = Thread.currentThread().getStackTrace()[2];
//                 source = "[" + st.getFileName() + "] - " + st.getMethodName() + "("
//                         + st.getLineNumber() + ")";
//             } catch (Exception e) {
//             }
// 
//             System.out.println(fm.format(new Date()) + " - " + source + ":" + msg);
//         }
//     }
// }


// Path: android/app/src/main/java/me/pjq/rpicar/Constants.java
import java.io.*;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Properties;
import me.pjq.rpicar.utils.Log;

        try {
            Log.log(TAG, "init: " + CONFIG_FILE);
            getAllProperties();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    //读取Properties的全部信息
    public static HashMap<String, String> getAllProperties(String filePath) throws IOException {
        Properties pps = new Properties();
        InputStream in = new BufferedInputStream(new FileInputStream(filePath));
        pps.load(in);
        Enumeration en = pps.propertyNames(); //得到配置文件的名字
        HashMap<String, String> map = new HashMap<>();

        while (en.hasMoreElements()) {
            String strKey = (String) en.nextElement();
            String strValue = pps.getProperty(strKey);
            strValue = new String(strValue.getBytes("ISO-8859-1"),"utf-8");
            System.out.println(strKey + "=" + strValue);
            map.put(strKey, strValue);
        }

        return map;
    }

    public static void getAllProperties() throws IOException {
        File file = new File(".");
        Log.log(TAG, file.getAbsolutePath());