I want to set password to my log file. I don't want to let a user to see this log. I only want to save to one file (for one day) logs from logcat and let a user to see only that the file is exist, but he can not open and read this file. The user can open the file when he write a correct password.
public class App extends Application {
public static String TOKEN = "1234";
public static boolean gpsOn = true;
public static double longtitude = 0.0, latitude = 0.0;
public static int SYNC = 60;
private String device_id;
@Override
public void onCreate() {
super.onCreate();
getUqid();
try {
SimpleDateFormat sdf = new SimpleDateFormat(
"yyyy-MM-dd", Locale.US);
String currentDateandTime = sdf.format(new Date());
final File path = new File(
Environment.getExternalStorageDirectory(), "***");
if (!path.exists()) {
path.mkdir();
}
Log.e("path " , path.getAbsolutePath());
Runtime.getRuntime().exec("logcat -f " + path + File.separator + "dbo_logcat_" + currentDateandTime + ".txt");
} catch (IOException e) {
e.printStackTrace();
}
}
private void getUqid() {
device_id = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
//Log.e("dev",""+device_id);
Util.UNIQ = device_id;
}
}