package org.las2mile.scrcpy.wrappers; import android.os.IInterface; import android.view.InputEvent; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import android.util.Log; import android.content.pm.PackageInfo; import android.net.wifi.WifiInfo; public final class WifiManager { private final IInterface manager; public WifiManager(IInterface manager) { this.manager = manager; } public boolean hasKNKJapp() { try { Method getConnectionInfo = manager.getClass().getMethod("getConnectionInfo"); Log.e("OKIOscr","getConnectionInfo==="+getConnectionInfo); WifiInfo wifiInfo = (WifiInfo) getConnectionInfo.invoke(manager); Log.e("OKIOscr","wifiInfo==="+wifiInfo); int ipInt = wifiInfo.getIpAddress(); int p1 = (ipInt & 0xff000000)>>(3*8); int p2 = (ipInt & 0x00ff0000)>>(2*8); int p3 = (ipInt & 0x0000ff00)>>(8); int p4 = (ipInt & 0x000000ff); Log.e("OKIOscr",p1+"."+p2+"."+p3+"."+p4); } catch (Exception e) { throw new AssertionError(e); } return false; } }