I am building an Android app based on: https://code.google.com/p/ics-openvpn/ However, after signing and exporting, some of the original code is not working:
private void startOpenVPNThreadArgs(String[] argv, Map<String, String> env) {
LinkedList<String> argvlist = new LinkedList<String>();
Collections.addAll(argvlist, argv);
ProcessBuilder pb = new ProcessBuilder(argvlist);
// Hack O rama
String lbpath = genLibraryPath(argv, pb);
pb.environment().put("LD_LIBRARY_PATH", lbpath);
// Add extra variables
for(Entry<String,String> e:env.entrySet()){
pb.environment().put(e.getKey(), e.getValue());
}
pb.redirectErrorStream(true);
try {
mProcess = pb.start();
// Close the output, since we don't need it
mProcess.getOutputStream().close();
InputStream in = mProcess.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(in));
while(true) {
String logline = br.readLine();
if(logline==null) {
System.out.println("logline == null");
return;
}
etc.
I keep getting getting: logline == null
, and then the connection is broken. No exceptions The argument env is an Empty Map! This is all original code, and I really don't know where to look, since there is no comment or JavaDoc. Can anyone help me out with this? Thanks
当我意识到它试图写一些不存在的二进制文件时,发现了这里的问题:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.