| | |
| | | import android.widget.ProgressBar; |
| | | import android.widget.RadioButton; |
| | | import android.widget.RadioGroup; |
| | | import android.widget.RelativeLayout; |
| | | import android.widget.TextView; |
| | | |
| | | import com.bsk.zhangbo.demoforbsk.R; |
| | |
| | | private TextView fragment_surveillance_enter_timer; |
| | | @ViewInject(R.id.fragment_surveillance_exit_timer) |
| | | private TextView fragment_surveillance_exit_timer; |
| | | @ViewInject(R.id.fragment_supervisory_exit_camera_relative_layout) |
| | | private RelativeLayout fragment_supervisory_exit_camera_relative_layout; |
| | | @ViewInject(R.id.fragment_supervisory_enter_camera_relative_layout) |
| | | private RelativeLayout fragment_supervisory_enter_camera_relative_layout; |
| | | |
| | | static boolean useNative = false; |
| | | |
| | |
| | | } else { |
| | | useNative = true; |
| | | } |
| | | if (CommonVariables.FACE_SERVER) { |
| | | useNative = false; |
| | | } |
| | | //useNative = false; |
| | | if (useNative) { |
| | | System.loadLibrary("cvface_api"); |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } catch (SocketException ex) {} |
| | | |
| | | 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(); |
| | | /* |
| | | busybox ifconfig wlan0 hw ether AC:83:F3:42:19:CE |
| | | |
| | | |
| | | */ |
| | | }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); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | protected void initViews(View view, Bundle savedInstanceState) { |
| | | if (CommonVariables.FACE_SERVER) { |
| | | fragment_supervisory_enter_camera_relative_layout.addView(MainActivity.getInstance().mPreview); |
| | | fragment_supervisory_enter_camera_relative_layout.addView(MainActivity.getInstance().mDraw); |
| | | |
| | | } |
| | | fragment_supervisory_enter_camera.getHolder().addCallback(new SurfaceHolder.Callback() { |
| | | public void surfaceCreated(SurfaceHolder holder) { |
| | | if (useNative) { |