MCPcopy Create free account
hub / github.com/FongMi/TV / getIp

Method getIp

catvod/src/main/java/com/github/catvod/utils/Util.java:112–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110 }
111
112 public static String getIp() {
113 try {
114 String ip = getHostAddress("wlan");
115 if (!ip.isEmpty()) return ip;
116 ip = getHostAddress("eth");
117 if (!ip.isEmpty()) return ip;
118 ip = getWifiAddress();
119 if (!ip.isEmpty()) return ip;
120 return getHostAddress("");
121 } catch (Exception e) {
122 return "";
123 }
124 }
125
126 private static String getWifiAddress() {
127 WifiManager manager = (WifiManager) Init.context().getApplicationContext().getSystemService(Context.WIFI_SERVICE);

Callers 4

getAddressMethod · 0.95
CastVideoClass · 0.95
historyMethod · 0.95
getUrlMethod · 0.95

Calls 3

getHostAddressMethod · 0.95
getWifiAddressMethod · 0.95
isEmptyMethod · 0.45

Tested by

no test coverage detected