From 634bffccce3e9c8a306837b5ebe60d741562675e Mon Sep 17 00:00:00 2001 From: huangjian Date: Thu, 17 Dec 2020 18:53:44 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E5=A2=9E=E5=8A=A0=E6=9C=80=E5=8F=B3?= =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e6854121 --- .../erban/application/XChatApplication.java | 2 - .../channel_page/model/ChannelPageModel.java | 34 ------------- .../channel_page/model/IChannelPageModel.java | 2 - gradle.properties | 4 +- .../utils/NetworkUtils.java | 48 +++++-------------- 5 files changed, 15 insertions(+), 75 deletions(-) diff --git a/app/src/main/java/com/yizhuan/erban/application/XChatApplication.java b/app/src/main/java/com/yizhuan/erban/application/XChatApplication.java index d00820f3e..9910feebd 100644 --- a/app/src/main/java/com/yizhuan/erban/application/XChatApplication.java +++ b/app/src/main/java/com/yizhuan/erban/application/XChatApplication.java @@ -67,7 +67,6 @@ import com.yizhuan.xchat_android_core.Env; import com.yizhuan.xchat_android_core.UriProvider; import com.yizhuan.xchat_android_core.auth.AuthModel; import com.yizhuan.xchat_android_core.channel.ChannelModel; -import com.yizhuan.xchat_android_core.channel_page.model.ChannelPageModel; import com.yizhuan.xchat_android_core.customer_server.CustomerServerModel; import com.yizhuan.xchat_android_core.family.model.FamilyModel; import com.yizhuan.xchat_android_core.gift.GiftModel; @@ -742,7 +741,6 @@ public class XChatApplication extends Application { GlobalHandleManager.get().init(); InitialModel.get().init(true).subscribe(); - ChannelPageModel.get().checkZuiyouAd(oaid); } diff --git a/core/src/model_channel_page/java/com/yizhuan/xchat_android_core/channel_page/model/ChannelPageModel.java b/core/src/model_channel_page/java/com/yizhuan/xchat_android_core/channel_page/model/ChannelPageModel.java index 16238d6d5..126641504 100644 --- a/core/src/model_channel_page/java/com/yizhuan/xchat_android_core/channel_page/model/ChannelPageModel.java +++ b/core/src/model_channel_page/java/com/yizhuan/xchat_android_core/channel_page/model/ChannelPageModel.java @@ -6,16 +6,9 @@ import com.yizhuan.xchat_android_core.channel_page.bean.ChannelPageInfo; import com.yizhuan.xchat_android_core.user.bean.InviteUserInfo; import com.yizhuan.xchat_android_core.utils.net.RxHelper; import com.yizhuan.xchat_android_library.net.rxnet.RxNet; -import com.yizhuan.xchat_android_library.utils.DeviceUuidFactory; -import com.yizhuan.xchat_android_library.utils.NetworkUtils; -import com.yizhuan.xchat_android_library.utils.codec.MD5Utils; -import com.yizhuan.xchat_android_library.utils.config.BasicConfig; import io.reactivex.Single; -import retrofit2.http.Field; -import retrofit2.http.FormUrlEncoded; import retrofit2.http.GET; -import retrofit2.http.POST; import retrofit2.http.Query; /** @@ -68,21 +61,6 @@ public class ChannelPageModel extends BaseModel implements IChannelPageModel { .compose(RxHelper.handleSchAndExce()); } - @Override - public void checkZuiyouAd(String oaid) { - try { - api.checkZuiyouAd(DeviceUuidFactory.getDeviceId(BasicConfig.INSTANCE.getAppContext()), - NetworkUtils.getIPAddress(BasicConfig.INSTANCE.getAppContext()), - "0", - System.getProperty("http.agent")) - .compose(RxHelper.handleSchedulers()) - .subscribe(); - } catch (Exception e) { - e.printStackTrace(); - } - - } - private interface Api { /** @@ -96,18 +74,6 @@ public class ChannelPageModel extends BaseModel implements IChannelPageModel { */ @GET("/user/v2/checkInviteUserInRoom") Single> checkInviteUserInRoom(@Query("inviteCode") String inviteCode); - - /** - * 最右推广接口 - */ - @FormUrlEncoded - @POST("/zuiyouAd/activeTrack") - Single> checkZuiyouAd(@Field("adroidId") String adroidId, - @Field("ip") String ip, - @Field("platformOs") String platformOs, - @Field("ua") String ua); - - } } diff --git a/core/src/model_channel_page/java/com/yizhuan/xchat_android_core/channel_page/model/IChannelPageModel.java b/core/src/model_channel_page/java/com/yizhuan/xchat_android_core/channel_page/model/IChannelPageModel.java index 89a413647..5ce0c2817 100644 --- a/core/src/model_channel_page/java/com/yizhuan/xchat_android_core/channel_page/model/IChannelPageModel.java +++ b/core/src/model_channel_page/java/com/yizhuan/xchat_android_core/channel_page/model/IChannelPageModel.java @@ -14,6 +14,4 @@ public interface IChannelPageModel { Single getChannelPage(); Single checkInviteUserInRoom(String inviteCode); - - void checkZuiyouAd(String oaid); } diff --git a/gradle.properties b/gradle.properties index 1ac8b5d5f..6c0f5682e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,5 +21,5 @@ with_jenkins=false #\u6253\u652F\u6301x86\u7684\u6A21\u62DF\u5668\u5305\u4F7F\u7528 ndk_abi_filters=arm -version_name=2.0.3 -version_code=203 \ No newline at end of file +version_name=2.0.0 +version_code=200 \ No newline at end of file diff --git a/library/src/main/java/com/yizhuan/xchat_android_library/utils/NetworkUtils.java b/library/src/main/java/com/yizhuan/xchat_android_library/utils/NetworkUtils.java index 837168eff..1722a0f56 100644 --- a/library/src/main/java/com/yizhuan/xchat_android_library/utils/NetworkUtils.java +++ b/library/src/main/java/com/yizhuan/xchat_android_library/utils/NetworkUtils.java @@ -39,30 +39,6 @@ public class NetworkUtils { return sWifiLocker; } - public String getLocalHostIp() { - String ipaddress = ""; - try { - Enumeration en = NetworkInterface - .getNetworkInterfaces(); - // 遍历所用的网络接口 - while (en.hasMoreElements()) { - NetworkInterface nif = en.nextElement();// 得到每一个网络接口绑定的所有ip - Enumeration inet = nif.getInetAddresses(); - // 遍历每一个接口绑定的所有ip - while (inet.hasMoreElements()) { - InetAddress ip = inet.nextElement(); - if (!ip.isLoopbackAddress()) { - return ip.getHostAddress(); - } - } - } - } catch (SocketException e) { - e.printStackTrace(); - } - return ipaddress; - - } - public static void lockWifi(Context c) { Log.d(TAG, "lock wifi"); if (!wifiLocker(c).isHeld()) @@ -76,7 +52,7 @@ public class NetworkUtils { } public static boolean isWifiActive(Context c) { - if (c == null) { + if(c == null){ Log.e("xuwakao", "isWifiActive is NULL"); return false; } @@ -87,7 +63,7 @@ public class NetworkUtils { } public static boolean isMobileActive(Context c) { - if (c == null) { + if(c == null){ Log.e("xuwakao", "isWifiActive is NULL"); return false; } @@ -98,7 +74,7 @@ public class NetworkUtils { } public static boolean isNetworkStrictlyAvailable(Context c) { - if (c == null) { + if(c == null){ Log.e("xuwakao", "isNetworkStrictlyAvailable context is NULL"); return false; } @@ -333,7 +309,7 @@ public class NetworkUtils { return "Unknown"; } - public static final int NET_INVALID = 0; // 无网络 + public static final int NET_INVALID = 0 ; // 无网络 public static final int NET_WIFI = 1; public static final int NET_2G = 2; public static final int NET_3G = 3; @@ -447,16 +423,17 @@ public class NetworkUtils { public static String getOperator(Context c) { String sim = getSimOperator(c); - if (FP.empty(sim)) + if(FP.empty(sim)) return ChinaOperator.UNKNOWN; if (sim.startsWith("46003") || sim.startsWith("46005")) { return ChinaOperator.CTL; } else if (sim.startsWith("46001") || sim.startsWith("46006")) { return ChinaOperator.UNICOM; } else if (sim.startsWith("46000") || sim.startsWith("46002") - || sim.startsWith("46007") || sim.startsWith("46020")) { + || sim.startsWith("46007") || sim.startsWith("46020")){ return ChinaOperator.CMCC; - } else { + } + else { return ChinaOperator.UNKNOWN; } } @@ -470,16 +447,17 @@ public class NetworkUtils { public static String getLocalIpAddress() { try { - for (Enumeration en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) { + for (Enumeration en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf = en.nextElement(); - for (Enumeration enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements(); ) { + for (Enumeration enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) { InetAddress inetAddress = enumIpAddr.nextElement(); - if (!inetAddress.isLoopbackAddress() && inetAddress instanceof Inet4Address) { - return inetAddress.getHostAddress(); + if (!inetAddress.isLoopbackAddress()) { + return inetAddress.getHostAddress().toString(); } } } } catch (SocketException ex) { + Log.e("NetworkUtils getLocalIpAddress:", ex.toString()); } return null; }