| | |
| | | for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) { |
| | | InetAddress inetAddress = enumIpAddr.nextElement(); |
| | | if (!inetAddress.isLoopbackAddress()) { |
| | | ipAddress = inetAddress.getHostAddress().toString(); |
| | | String ip1 = inetAddress.getHostAddress().toString(); |
| | | if (ip1.contains("192.")) { |
| | | ipAddress = ip1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | try{ |
| | | |
| | | Process su = Runtime.getRuntime().exec("su"); |
| | | DataOutputStream outputStream = new DataOutputStream(su.getOutputStream()); |
| | | //Process su = Runtime.getRuntime().exec("su"); |
| | | //DataOutputStream outputStream = new DataOutputStream(su.getOutputStream()); |
| | | |
| | | //outputStream.writeBytes("busybox ifconfig wlan0 down\n"); |
| | | //outputStream.flush(); |
| | | //Thread.sleep(5000); |
| | | outputStream.writeBytes("busybox ifconfig wlan0 hw ether f4:8b:32:62:4f:89\n"); |
| | | outputStream.flush(); |
| | | // outputStream.writeBytes("busybox ifconfig wlan0 hw ether f4:8b:32:62:4f:89\n"); |
| | | // outputStream.flush(); |
| | | |
| | | outputStream.writeBytes("exit\n"); |
| | | outputStream.flush(); |
| | | su.waitFor(); |
| | | //outputStream.writeBytes("exit\n"); |
| | | //outputStream.flush(); |
| | | //su.waitFor(); |
| | | }catch(Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | // outputStream.writeBytes("busybox ifconfig wlan0 hw ether 00:e0:2c:31:1a:ba\n"); |
| | | RtspFaceNative.setLocalIP("192.168.1.53"); |
| | | RtspFaceNative.setLocalIP(ipAddress); |
| | | } |
| | | } |
| | | |