增加最右推广接口调用
This commit is contained in:
@@ -67,6 +67,7 @@ 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;
|
||||||
@@ -741,6 +742,7 @@ 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,9 +6,16 @@ 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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,6 +68,21 @@ 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 {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,6 +96,18 @@ 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,4 +14,6 @@ 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.0
|
version_name=2.0.3
|
||||||
version_code=200
|
version_code=203
|
@@ -39,6 +39,30 @@ 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())
|
||||||
@@ -432,8 +456,7 @@ public class NetworkUtils {
|
|||||||
} 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -451,13 +474,12 @@ public class NetworkUtils {
|
|||||||
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()) {
|
if (!inetAddress.isLoopbackAddress() && inetAddress instanceof Inet4Address) {
|
||||||
return inetAddress.getHostAddress().toString();
|
return inetAddress.getHostAddress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SocketException ex) {
|
} catch (SocketException ex) {
|
||||||
Log.e("NetworkUtils getLocalIpAddress:", ex.toString());
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user