Commit 624d5ca1 authored by Roumen Petrov's avatar Roumen Petrov

source system startup file only if exists

parent da9a1b1a
......@@ -16,13 +16,12 @@
package com.termoneplus;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
public class Installer {
public static boolean install_directory(File dir, boolean share) {
......@@ -48,12 +47,14 @@ public static boolean install_text_file(String[] script, File file) {
}
public static boolean installAppScriptFile() {
File file = Application.getScriptFile();
ArrayList<String> shell_script = new ArrayList<>();
String sysmkshrc = "/system/etc/mkshrc";
if (new File(sysmkshrc).exists())
shell_script.add(". " + sysmkshrc);
shell_script.add(". /proc/self/fd/0 <<< \"$(libexec-t1plus.so aliases)\"");
String[] shell_script = {
". /system/etc/mkshrc",
". /proc/self/fd/0 <<< \"$(libexec-t1plus.so aliases)\""
};
return install_text_file(shell_script, file);
return install_text_file(shell_script.toArray(new String[0]), Application.getScriptFile());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment