2015-04-30 33 views
0

我嘗試使應用程序與打開我的移動熱點共享我的文件,並且朋友可以連接它。 然後在url中打開瀏覽器密鑰進行下載。 我使用iptables從端口80重定向到我的web服務器端口8888,它的工作原理。 但是,當我改變/ etc/hosts文件/添加1'92.168.43.1 xx.com'用android熱點重定向所有客戶端http url

客戶端使用失敗。 我在我的熱點電話ping xx.com,它的工作原理。

我嘗試的Android 2.3.7安卓小蜜根環境 使用nandhttpserver庫 (我嘗試使用DNS服務器的應用程序,但沒有成功(我有重定向端口53 DNS服務器)) 任何一個能幫助我嗎?

我的主人腳本

private boolean chnagehost(String appendStr) { 
    boolean res; 
    String temp ="mount -o rw,remount -t rootfs /;mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system;" 
      +"cp -f /etc/hosts /etc/hosts.backup;" 
      +"echo "+ appendStr + " >> /etc/hosts;echo -e '\n\r' >> /etc/hosts"; 

    res = executeRootShellCommand(temp); 
    //res = executeShellCommand("cp -f /etc/hosts /etc/hosts.backup"); 

    //res= executeShellCommand("echo "+ appendStr + " >> /etc/hosts"); 
    return res; 
} 
+0

我只是一個初級開發者,在手機上開發^^ – alisa

+0

什麼?? .............. – alisa

回答

0

我找到它。 修改hosts文件後應該重啓熱點。 主人工作。 三星手機測試,android 4.3,4.1