我正在构建一个基于:https://code.google.com/p/ics-openvpn/的安卓应用程序,但是,在签名和导出之后,一些原始代码不起作用:
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;
}等。
我一直得到:logline == null,然后连接断了。没有例外,参数env是一个空的Map!这都是原始代码,我真的不知道该在哪里查找,因为没有注释或JavaDoc。有人能帮我解决这个问题吗?谢谢
发布于 2014-01-18 09:38:56
当我意识到它试图编写一些不存在的二进制文件时,发现了这里的问题:
https://stackoverflow.com/questions/21157331
复制相似问题