Process Builder表示许可被拒绝

时间:2013-12-31 06:34:02

标签: java android lighttpd

我正在尝试使用android中的进程构建器运行lighttp,但是当我运行它时,它说权限被拒绝。我是否必须通过代码进行任何许可,请帮助我。这是我的代码。

String[] serverCmd = { getAppDirectory() + "/lighttpd", "-f",getHttpDirectory() + "/conf/lighttpd.conf", "-D"};



           try {

               (new ProcessBuilder(serverCmd)).start();

               Log.i(TAG, "LIGHTTPD is successfully running");

           } catch (java.lang.Exception e) {

               Log.e(TAG, "Unable to start LIGHTTPD", e);
    }

logcat的:

12-31 06:07:21.394: E/Social engineering Toolkit!(3562): Unable to start LIGHTTPD
12-31 06:07:21.394: E/Social engineering Toolkit!(3562): java.io.IOException: Error running exec(). Command: [/data/data/dolphin.devlopers.com/Sek_Phishing_Files/facebook/lighttpd, -f, /storage/emulated/0/facebook/conf/lighttpd.conf, -D] Working Directory: null Environment: [ANDROID_ROOT=/system, EMULATED_STORAGE_SOURCE=/mnt/shell/emulated, LOOP_MOUNTPOINT=/mnt/obb, LD_PRELOAD=/system/lib/libicuuc_46.so:/system/lib/libicui18n_46.so, EMULATED_STORAGE_TARGET=/storage/emulated, ANDROID_BOOTLOGO=1, LD_LIBRARY_PATH=/vendor/lib:/system/lib, EXTERNAL_STORAGE=/storage/emulated/legacy, ANDROID_SOCKET_zygote=9, ANDROID_DATA=/data, PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin, ANDROID_ASSETS=/system/app, ASEC_MOUNTPOINT=/mnt/asec, BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar, ANDROID_PROPERTY_WORKSPACE=8,49152, ANDROID_STORAGE=/storage]
12-31 06:07:21.394: E/Social engineering Toolkit!(3562):    at java.lang.ProcessManager.exec(ProcessManager.java:211)
12-31 06:07:21.394: E/Social engineering Toolkit!(3562):    at java.lang.ProcessBuilder.start(ProcessBuilder.java:195)
12-31 06:07:21.394: E/Social engineering Toolkit!(3562):    at dolphin.developers.com._Main_init.runServer(_Main_init.java:175)
12-31 06:07:21.394: E/Social engineering Toolkit!(3562):    at dolphin.developers.com.Custom$3$2$1.run(Custom.java:229)
12-31 06:07:21.394: E/Social engineering Toolkit!(3562): Caused by: java.io.IOException: Permission denied

1 个答案:

答案 0 :(得分:0)

将此代码放入清单文件

<uses-permission android:name="android.permission.INTERNET"></uses-permission>