|
|
@ -1174,8 +1174,8 @@ public class MicroPhotoService extends Service {
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
if (getCustomAppId() == 2) {
|
|
|
|
if (getCustomAppId() == 2 || getCustomAppId() == 1) {
|
|
|
|
// setStaticNetwork(iface, "192.168.68.91", "192.168.68.91", "192.168.68.0", 24);
|
|
|
|
setStaticNetwork(iface, "192.168.68.91", "192.168.68.91", "192.168.68.0", 24);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
setEthernetRoute(iface, "192.168.68.0", 24);
|
|
|
|
setEthernetRoute(iface, "192.168.68.0", 24);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1798,7 +1798,7 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
|
|
|
|
|
|
|
public void setStaticNetwork(final String iface, final String ip, final String netmask, final String gateway)
|
|
|
|
public void setStaticNetwork(final String iface, final String ip, final String netmask, final String gateway)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (getCustomAppId() == 2) {
|
|
|
|
if (getCustomAppId() == 2 || getCustomAppId() == 1) {
|
|
|
|
// N938
|
|
|
|
// N938
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -1922,9 +1922,9 @@ public class MicroPhotoService extends Service {
|
|
|
|
Process process = Runtime.getRuntime().exec("/system/xbin/su root");
|
|
|
|
Process process = Runtime.getRuntime().exec("/system/xbin/su root");
|
|
|
|
DataOutputStream os = new DataOutputStream(process.getOutputStream());
|
|
|
|
DataOutputStream os = new DataOutputStream(process.getOutputStream());
|
|
|
|
|
|
|
|
|
|
|
|
// os.writeBytes("/system/bin/ip link set eth0 down\n");
|
|
|
|
// os.writeBytes("/system/bin/ip link set eth0 down\n");
|
|
|
|
os.writeBytes("/system/bin/ip addr add 192.168.68.91/24 broadcast 192.168.68.255 dev eth0\n");
|
|
|
|
os.writeBytes("/system/bin/ip addr add 192.168.68.91/24 broadcast 192.168.68.255 dev eth0\n");
|
|
|
|
// os.writeBytes("/system/bin/ip link set eth0 up\n");
|
|
|
|
// os.writeBytes("/system/bin/ip link set eth0 up\n");
|
|
|
|
// os.writeBytes("/system/bin/ip route delete 192.168.68.0/24 table 20 2>/dev/null || true\n");
|
|
|
|
// os.writeBytes("/system/bin/ip route delete 192.168.68.0/24 table 20 2>/dev/null || true\n");
|
|
|
|
os.writeBytes("/system/bin/ip route replace 192.168.68.0/24 dev eth0 proto static scope link table 20\n");
|
|
|
|
os.writeBytes("/system/bin/ip route replace 192.168.68.0/24 dev eth0 proto static scope link table 20\n");
|
|
|
|
os.writeBytes("/system/bin/ip route flush cache\n");
|
|
|
|
os.writeBytes("/system/bin/ip route flush cache\n");
|
|
|
|