Skip to content

Commit 13cfe01

Browse files
committed
Merge pull request #9 from yugang/wd-stub-optimization-task
Update for cgi file not found
2 parents 5499c38 + ed01aa0 commit 13cfe01

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

android/assets/system/service.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ DOCPATH="${SYSPATH%/system}/docroot"
3131
chmod 0777 $LIBPATH/*
3232

3333
for x in `$LIBPATH/busybox find $DOCPATH -name '*.cgi'`
34-
do
34+
do
3535
{
36-
$LIBPATH/busybox sed -i 's/#!\/bin\/sh/#!\/system\/bin\/sh/g' $x
36+
$LIBPATH/busybox sed -ie 's/#!\/bin\/sh/#!\/system\/bin\/sh/g' $x
3737
chmod 0777 $x
3838
}
3939
done
4040

41-
for x in `$LIBPATH/busybox find $DOCPATH -name '*.cgi' | $LIBPATH/busybox grep '/cgi/'`;do echo `dirname $x`;done | $LIBPATH/busybox sort | $LIBPATH/busybox uniq > cgi
42-
for src in `cat cgi`;do dst=`echo $src|$LIBPATH/busybox sed -e "s/\/cgi//g"`;cp $src/*.cgi $dst;done
41+
#for x in `$LIBPATH/busybox find $DOCPATH -name '*.cgi' | $LIBPATH/busybox grep '/cgi/'`;do `$LIBPATH/busybox dirname $x`;done | $LIBPATH/busybox sort | $LIBPATH/busybox uniq > cgi
42+
#for src in `$LIBPATH/busybox cat cgi`;do dst=`$LIBPATH/busybox sed -e "s/\/cgi//g" $src`;cp $src/*.cgi $dst;done
4343

4444
echo "Launch tinyweb daemon..."
4545
PATH=$PATH:$LIBPATH $LIBPATH/tinyweb -ssl_certificate $SYSPATH/server.pem -document_root $DOCPATH -listening_ports 8080,8081,8082,8083,8443s -pidfile $SYSPATH/tinyweb.pid

android/native/jni/Application.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Build both ARMv5TE and ARMv7-A machine code.
2-
APP_ABI := armeabi armeabi-v7a x86 x86_64
2+
APP_ABI := all
33
APP_STL := gnustl_static

android/src/com/intel/tinywebtestservice/FullscreenActivity.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,25 @@ public void run() {
9393
p = Runtime.getRuntime().exec(
9494
target_path + "system/service.sh -p "
9595
+ Build.CPU_ABI, null, null);
96+
String line = "", res = "";
97+
98+
InputStream input = p.getInputStream();
99+
100+
BufferedReader osRes = new BufferedReader(new InputStreamReader(
101+
input, "utf-8"));
102+
while ((line = osRes.readLine()) != null)
103+
res += line + "\n";
104+
osRes.close();
105+
input.close();
106+
107+
input = p.getErrorStream();
108+
osRes = new BufferedReader(new InputStreamReader(input, "utf-8"));
109+
while ((line = osRes.readLine()) != null)
110+
res += line + "\n";
111+
112+
osRes.close();
113+
input.close();
114+
printLog(res);
96115
} catch (IOException e) {
97116
// TODO Auto-generated catch block
98117
e.printStackTrace();
@@ -101,7 +120,7 @@ public void run() {
101120
};
102121
t.start();
103122
t.wait(2000);
104-
String line = "", res = "";
123+
/* String line = "", res = "";
105124
106125
InputStream input = p.getInputStream();
107126
@@ -118,7 +137,7 @@ public void run() {
118137
res += line + "\n";
119138
osRes.close();
120139
input.close();
121-
printLog(res);
140+
printLog(res); */
122141

123142
} catch (Exception e) {
124143
// TODO Auto-generated catch block
@@ -350,6 +369,8 @@ private int chmode(String filename, int mode) throws Exception {
350369

351370
private void unzipDocroot() {
352371
try {
372+
// chmode(target_path + "system/libs/" + Build.CPU_ABI + "/unzip", 511);
373+
353374
String cmd = target_path
354375
+ "system/libs/" + Build.CPU_ABI + "/busybox unzip /sdcard/docroot.zip -o -d "
355376
+ target_path;

0 commit comments

Comments
 (0)