@@ -67,7 +67,6 @@ import com.yizhuan.xchat_android_core.Env;
|
|||||||
import com.yizhuan.xchat_android_core.UriProvider;
|
import com.yizhuan.xchat_android_core.UriProvider;
|
||||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||||
import com.yizhuan.xchat_android_core.channel.ChannelModel;
|
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.customer_server.CustomerServerModel;
|
||||||
import com.yizhuan.xchat_android_core.family.model.FamilyModel;
|
import com.yizhuan.xchat_android_core.family.model.FamilyModel;
|
||||||
import com.yizhuan.xchat_android_core.gift.GiftModel;
|
import com.yizhuan.xchat_android_core.gift.GiftModel;
|
||||||
@@ -742,7 +741,6 @@ public class XChatApplication extends Application {
|
|||||||
GlobalHandleManager.get().init();
|
GlobalHandleManager.get().init();
|
||||||
|
|
||||||
InitialModel.get().init(true).subscribe();
|
InitialModel.get().init(true).subscribe();
|
||||||
ChannelPageModel.get().checkZuiyouAd(oaid);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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.user.bean.InviteUserInfo;
|
||||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
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 io.reactivex.Single;
|
||||||
import retrofit2.http.Field;
|
|
||||||
import retrofit2.http.FormUrlEncoded;
|
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.POST;
|
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,21 +61,6 @@ public class ChannelPageModel extends BaseModel implements IChannelPageModel {
|
|||||||
.compose(RxHelper.handleSchAndExce());
|
.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 {
|
private interface Api {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,18 +74,6 @@ public class ChannelPageModel extends BaseModel implements IChannelPageModel {
|
|||||||
*/
|
*/
|
||||||
@GET("/user/v2/checkInviteUserInRoom")
|
@GET("/user/v2/checkInviteUserInRoom")
|
||||||
Single<ServiceResult<InviteUserInfo>> checkInviteUserInRoom(@Query("inviteCode") String inviteCode);
|
Single<ServiceResult<InviteUserInfo>> checkInviteUserInRoom(@Query("inviteCode") String inviteCode);
|
||||||
|
|
||||||
/**
|
|
||||||
* 最右推广接口
|
|
||||||
*/
|
|
||||||
@FormUrlEncoded
|
|
||||||
@POST("/zuiyouAd/activeTrack")
|
|
||||||
Single<ServiceResult<ChannelPageInfo>> checkZuiyouAd(@Field("adroidId") String adroidId,
|
|
||||||
@Field("ip") String ip,
|
|
||||||
@Field("platformOs") String platformOs,
|
|
||||||
@Field("ua") String ua);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -14,6 +14,4 @@ public interface IChannelPageModel {
|
|||||||
Single<ChannelPageInfo> getChannelPage();
|
Single<ChannelPageInfo> getChannelPage();
|
||||||
|
|
||||||
Single<InviteUserInfo> checkInviteUserInRoom(String inviteCode);
|
Single<InviteUserInfo> checkInviteUserInRoom(String inviteCode);
|
||||||
|
|
||||||
void checkZuiyouAd(String oaid);
|
|
||||||
}
|
}
|
||||||
|
@@ -21,5 +21,5 @@ with_jenkins=false
|
|||||||
#\u6253\u652F\u6301x86\u7684\u6A21\u62DF\u5668\u5305\u4F7F\u7528
|
#\u6253\u652F\u6301x86\u7684\u6A21\u62DF\u5668\u5305\u4F7F\u7528
|
||||||
ndk_abi_filters=arm
|
ndk_abi_filters=arm
|
||||||
|
|
||||||
version_name=2.0.3
|
version_name=2.0.0
|
||||||
version_code=203
|
version_code=200
|
@@ -39,30 +39,6 @@ public class NetworkUtils {
|
|||||||
return sWifiLocker;
|
return sWifiLocker;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLocalHostIp() {
|
|
||||||
String ipaddress = "";
|
|
||||||
try {
|
|
||||||
Enumeration<NetworkInterface> en = NetworkInterface
|
|
||||||
.getNetworkInterfaces();
|
|
||||||
// 遍历所用的网络接口
|
|
||||||
while (en.hasMoreElements()) {
|
|
||||||
NetworkInterface nif = en.nextElement();// 得到每一个网络接口绑定的所有ip
|
|
||||||
Enumeration<InetAddress> 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) {
|
public static void lockWifi(Context c) {
|
||||||
Log.d(TAG, "lock wifi");
|
Log.d(TAG, "lock wifi");
|
||||||
if (!wifiLocker(c).isHeld())
|
if (!wifiLocker(c).isHeld())
|
||||||
@@ -76,7 +52,7 @@ public class NetworkUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isWifiActive(Context c) {
|
public static boolean isWifiActive(Context c) {
|
||||||
if (c == null) {
|
if(c == null){
|
||||||
Log.e("xuwakao", "isWifiActive is NULL");
|
Log.e("xuwakao", "isWifiActive is NULL");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -87,7 +63,7 @@ public class NetworkUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isMobileActive(Context c) {
|
public static boolean isMobileActive(Context c) {
|
||||||
if (c == null) {
|
if(c == null){
|
||||||
Log.e("xuwakao", "isWifiActive is NULL");
|
Log.e("xuwakao", "isWifiActive is NULL");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -98,7 +74,7 @@ public class NetworkUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isNetworkStrictlyAvailable(Context c) {
|
public static boolean isNetworkStrictlyAvailable(Context c) {
|
||||||
if (c == null) {
|
if(c == null){
|
||||||
Log.e("xuwakao", "isNetworkStrictlyAvailable context is NULL");
|
Log.e("xuwakao", "isNetworkStrictlyAvailable context is NULL");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -333,7 +309,7 @@ public class NetworkUtils {
|
|||||||
return "Unknown";
|
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_WIFI = 1;
|
||||||
public static final int NET_2G = 2;
|
public static final int NET_2G = 2;
|
||||||
public static final int NET_3G = 3;
|
public static final int NET_3G = 3;
|
||||||
@@ -447,16 +423,17 @@ public class NetworkUtils {
|
|||||||
|
|
||||||
public static String getOperator(Context c) {
|
public static String getOperator(Context c) {
|
||||||
String sim = getSimOperator(c);
|
String sim = getSimOperator(c);
|
||||||
if (FP.empty(sim))
|
if(FP.empty(sim))
|
||||||
return ChinaOperator.UNKNOWN;
|
return ChinaOperator.UNKNOWN;
|
||||||
if (sim.startsWith("46003") || sim.startsWith("46005")) {
|
if (sim.startsWith("46003") || sim.startsWith("46005")) {
|
||||||
return ChinaOperator.CTL;
|
return ChinaOperator.CTL;
|
||||||
} else if (sim.startsWith("46001") || sim.startsWith("46006")) {
|
} else if (sim.startsWith("46001") || sim.startsWith("46006")) {
|
||||||
return ChinaOperator.UNICOM;
|
return ChinaOperator.UNICOM;
|
||||||
} else if (sim.startsWith("46000") || sim.startsWith("46002")
|
} else if (sim.startsWith("46000") || sim.startsWith("46002")
|
||||||
|| sim.startsWith("46007") || sim.startsWith("46020")) {
|
|| sim.startsWith("46007") || sim.startsWith("46020")){
|
||||||
return ChinaOperator.CMCC;
|
return ChinaOperator.CMCC;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return ChinaOperator.UNKNOWN;
|
return ChinaOperator.UNKNOWN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -470,16 +447,17 @@ public class NetworkUtils {
|
|||||||
|
|
||||||
public static String getLocalIpAddress() {
|
public static String getLocalIpAddress() {
|
||||||
try {
|
try {
|
||||||
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) {
|
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
|
||||||
NetworkInterface intf = en.nextElement();
|
NetworkInterface intf = en.nextElement();
|
||||||
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements(); ) {
|
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
|
||||||
InetAddress inetAddress = enumIpAddr.nextElement();
|
InetAddress inetAddress = enumIpAddr.nextElement();
|
||||||
if (!inetAddress.isLoopbackAddress() && inetAddress instanceof Inet4Address) {
|
if (!inetAddress.isLoopbackAddress()) {
|
||||||
return inetAddress.getHostAddress();
|
return inetAddress.getHostAddress().toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SocketException ex) {
|
} catch (SocketException ex) {
|
||||||
|
Log.e("NetworkUtils getLocalIpAddress:", ex.toString());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user