refactor: 优化api包名接口,减少接口文件
This commit is contained in:
@@ -170,7 +170,7 @@ public class SplashActivity extends AppCompatActivity {
|
||||
Log.e(TAG, "getCustomVersion: " + Utils.getCustomVersion());
|
||||
Log.e(TAG, "getRomVersion: " + Utils.getRomVersion());
|
||||
Log.i(TAG, "debugTest: " + BuildConfig.VERSION_NAME);
|
||||
Log.i(TAG, "debugTest: " + Utils.getAPPVersionName(PackageNames.APPSTORE, this));
|
||||
Log.i(TAG, "debugTest: " + Utils.getAppVersionName(PackageNames.APPSTORE, this));
|
||||
Log.i(TAG, "debugTest: " + Utils.getAndroid7MAC());
|
||||
Log.i(TAG, "debugTest: launcher3 " + JgyUtils.getInstance().getStartClassName("com.android.launcher3"));
|
||||
// try {
|
||||
|
||||
@@ -141,10 +141,8 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
public MutableLiveData<JsonObject> mUpdateInfoData = new MutableLiveData<>();
|
||||
|
||||
public void checkUpdateInfo() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getUpdateApi()
|
||||
.getUpdate(BuildConfig.APPLICATION_ID,
|
||||
JgyUtils.getInstance().checkAppPlatform())
|
||||
NetInterfaceManager.getInstance().getAppDownloadApi()
|
||||
.getUpdate(BuildConfig.APPLICATION_ID, JgyUtils.getInstance().checkAppPlatform())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
@@ -222,7 +220,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
|
||||
} else {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultDesktop( getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getDefaultDesktop(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
@@ -292,7 +290,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
|| "HT01".equals(Build.MODEL)) {
|
||||
mShowPanel.setValue(true);
|
||||
} else if ("G10-M".equals(Build.MODEL)
|
||||
||"Ebox201W".equals(Build.MODEL)) {
|
||||
|| "Ebox201W".equals(Build.MODEL)) {
|
||||
mShowPanel.setValue(false);
|
||||
}
|
||||
|
||||
@@ -345,7 +343,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
});
|
||||
}
|
||||
|
||||
public void getPushTags(){
|
||||
public void getPushTags() {
|
||||
NetInterfaceManager.getInstance().setPushTags(getLifecycle(), new NetInterfaceManager.PushTagCallback() {
|
||||
@Override
|
||||
public void setPushTag(String tag) {
|
||||
|
||||
71
app/src/main/java/com/aoleyun/sn/base/BaseService.java
Normal file
71
app/src/main/java/com/aoleyun/sn/base/BaseService.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package com.aoleyun.sn.base;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.LifecycleRegistry;
|
||||
|
||||
import com.trello.rxlifecycle4.LifecycleProvider;
|
||||
import com.trello.rxlifecycle4.LifecycleTransformer;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.trello.rxlifecycle4.android.RxLifecycleAndroid;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
|
||||
public abstract class BaseService extends Service implements LifecycleProvider<ActivityEvent>, LifecycleOwner {
|
||||
|
||||
private final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
|
||||
|
||||
public BehaviorSubject<ActivityEvent> getLifecycleSubject() {
|
||||
return lifecycleSubject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Observable<ActivityEvent> lifecycle() {
|
||||
return lifecycleSubject.hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <T> LifecycleTransformer<T> bindUntilEvent(ActivityEvent event) {
|
||||
return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <T> LifecycleTransformer<T> bindToLifecycle() {
|
||||
return RxLifecycleAndroid.bindActivity(lifecycleSubject);
|
||||
}
|
||||
|
||||
private final LifecycleRegistry lifecycleRegistry = new LifecycleRegistry(this);
|
||||
|
||||
@Override
|
||||
public Lifecycle getLifecycle() {
|
||||
return lifecycleRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
lifecycleSubject.onNext(ActivityEvent.CREATE);
|
||||
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_CREATE);
|
||||
//修补在Service中LiveData不能触发
|
||||
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_START);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_RESUME);
|
||||
return super.onStartCommand(intent, flags, startId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
lifecycleSubject.onNext(ActivityEvent.DESTROY);
|
||||
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_DESTROY);
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,58 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppAttr;
|
||||
import com.aoleyun.sn.bean.AppID;
|
||||
import com.aoleyun.sn.bean.Appground;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||
import com.aoleyun.sn.bean.TopApp;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface AppControlApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.NET_AND_LAUNCH_API)
|
||||
Observable<NetAndLaunchBean> getNetAndLaunchApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SN_APP_ATTR)
|
||||
Observable<BaseResponse<List<AppAttr>>> getSnAppAttr(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_TOP_APP_CONTROL)
|
||||
Observable<BaseResponse<TopApp>> getSnAppControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_APPID)
|
||||
Observable<BaseResponse<List<AppID>>> getDeselectIDApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_APPINSIDEWEB)
|
||||
Observable<BaseResponse> getNewAppinsideWeb(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_APPINSIDEWEB)
|
||||
Observable<BaseResponse<List<Appground>>> getAppinsideWeb(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +1,41 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppUpdateInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface ForceDownloadApi {
|
||||
public interface AppDownloadApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.CHECK_UPDATE)
|
||||
//1MTK平台 2展锐平台
|
||||
Observable<BaseResponse<AppUpdateInfo>> getUpdate(
|
||||
@Field("package") String packageName,
|
||||
@Field("type") int type
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.CHECK_UPDATE)
|
||||
Observable<BaseResponse<AppUpdateInfo>> getUpdate(
|
||||
@FieldMap Map<String, String> params
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SN_APP_TEST)
|
||||
Observable<BaseResponse<List<ForceDownloadData>>> getTestUpdate(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_FORCE_INSTALL_LIST)
|
||||
Observable<BaseResponse<List<ForceDownloadData>>> getForceDownloadApi(
|
||||
@@ -26,5 +48,4 @@ public interface ForceDownloadApi {
|
||||
@Query("key") String key,
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface AppImgApi {
|
||||
@GET(UrlAddress.GET_IS_APP_IMG)
|
||||
Observable<BaseResponse> getIsAppImg(
|
||||
@Query("package") String pkg
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppDateInfo;
|
||||
import com.aoleyun.sn.bean.AppLimit;
|
||||
import com.aoleyun.sn.bean.AppListInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.CustomROMApp;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface AppInstallStrategyApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_WHITE_PACKAGE_LIST)
|
||||
Observable<BaseResponse<AppLimit>> getAppLimitApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_ALL_APP)
|
||||
Observable<BaseResponse<List<AppListInfo>>> getAllAppList(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_ADMIN_APP)
|
||||
Observable<BaseResponse<List<AppDateInfo>>> getAdminApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.HTTP_TAG_COMMOAPP)
|
||||
Observable<BaseResponse<List<AppDateInfo>>> getRankApp(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("page") String page
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_ROM_APP)
|
||||
Observable<BaseResponse<CustomROMApp>> getRomApp(
|
||||
@Field("key") String key,
|
||||
@Field("version_number") String version_number
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppLimit;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface AppLimitApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_WHITE_PACKAGE_LIST)
|
||||
Observable<BaseResponse<AppLimit>> getAppLimitApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppSettings;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface AppSettingApi {
|
||||
@GET(UrlAddress.APP_SETTING)
|
||||
Observable<BaseResponse<AppSettings>> getAppSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
|
||||
import com.aoleyun.sn.bean.Appground;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface AppinsideWebApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_APPINSIDEWEB)
|
||||
Observable<BaseResponse<List<Appground>>> getAppinsideWeb(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface BatteryInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_BATTERY_INFO)
|
||||
Observable<BaseResponse> sendBatteryInfo(
|
||||
@Field("sn") String sn,
|
||||
@Field("key") String key,
|
||||
@Field("battery_quantity") String battery_quantity,
|
||||
@Field("battery_temperature") String battery_temperature,
|
||||
@Field("battery_voltage") String battery_voltage,
|
||||
@Field("charge_current") String charge_current,
|
||||
@Field("charge_voltage") String charge_voltage,
|
||||
@Field("battery_status") String battery_status,
|
||||
@Field("charge_type") String charge_type,
|
||||
@Field("charge_current_max") String charge_current_max,
|
||||
@Field("charge_voltage_max") String charge_voltage_max,
|
||||
@Field("battery_health") String battery_health,
|
||||
@Field("quantity_max") String quantity_max,
|
||||
@Field("battery_desc") String battery_desc,
|
||||
@Field("charge_speed") String charge_speed
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.BlacklistBean;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface BlackListApi {
|
||||
@GET(UrlAddress.BLACK_LIST)
|
||||
Observable<BaseResponse<BlacklistBean>> getBlackList(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.BrowserBookmarks;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface BrowserBookmarksApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_HOMEPAG_TAG)
|
||||
Observable<BaseResponse<BrowserBookmarks>> getBrowserBookmarks(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.BrowserData;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface BrowserListApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_BROWSER_LIST)
|
||||
Observable<BaseResponse<BrowserData>> getBrowserList(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppUpdateInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface CheckUpdateApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.CHECK_UPDATE)
|
||||
//1MTK平台 2展锐平台
|
||||
Observable<BaseResponse<AppUpdateInfo>> getUpdate(
|
||||
@Field("package") String packages,
|
||||
@Field("type") int type
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.LessonApp;
|
||||
import com.aoleyun.sn.bean.LessonSetting;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
@@ -13,4 +14,9 @@ public interface CloudLessonApi {
|
||||
Observable<BaseResponse<LessonSetting>> getCloudLessonSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_CLOUD_LESSON_APP)
|
||||
Observable<BaseResponse<LessonApp>> getCloudLessonApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.LessonApp;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface CloudLessonAppApi {
|
||||
@GET(UrlAddress.GET_CLOUD_LESSON_APP)
|
||||
Observable<BaseResponse<LessonApp>> getCloudLessonApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.CustomROMApp;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface CustomROMAppApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_ROM_APP)
|
||||
Observable<BaseResponse<CustomROMApp>> getROMApp(
|
||||
@Field("key") String key,
|
||||
@Field("version_number") String version_number
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.DefaultApp;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface DefaultAppApi {
|
||||
@GET(UrlAddress.GET_DEFAULT_APP)
|
||||
Observable<BaseResponse<DefaultApp>> getDefaultApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppID;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface DeselectIDApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_APPID)
|
||||
Observable<BaseResponse<List<AppID>>> getDeselectIDApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface DesktopIconApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_HIDE_DESKTOPICON)
|
||||
Observable<BaseResponse> getDesktopIcon(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface DesktopsDiyUpdateApi {
|
||||
@GET(UrlAddress.GET_DESKTOPS_DIY_UPDATE)
|
||||
Observable<BaseResponse<ForceDownloadData>> getDesktopsDiyUpdate(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface DevicesLockedStateApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_DEVICES_LOCKED)
|
||||
Observable<BaseResponse> getLockedState(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.Batch;
|
||||
import com.aoleyun.sn.bean.DeveloperBean;
|
||||
import com.aoleyun.sn.bean.EBagCode;
|
||||
import com.aoleyun.sn.bean.ScreenLockState;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface DevicesStatusApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_DEVICES_LOCKED)
|
||||
Observable<BaseResponse> getLockedState(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_DEVICES_TAGS)
|
||||
Observable<BaseResponse<Batch>> getPushTags(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_STUDENTS_INFO)
|
||||
Observable<BaseResponse<StudentsInfo>> getStudentsInfo(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_LOCK_SCREEN_STATE)
|
||||
Observable<BaseResponse<ScreenLockState>> getScreenLockState(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_DEVELOPER)
|
||||
Observable<BaseResponse<DeveloperBean>> getDeveloperState(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_EBAG_CODE)
|
||||
Observable<BaseResponse<EBagCode>> getEBagCode(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SN_CONFIRM_BIND)
|
||||
Observable<BaseResponse> snConfirmBind(
|
||||
@Field("sn") String sn,
|
||||
@Field("userId") String userId,
|
||||
@Field("type") int type
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppDateInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetAdminAppApi {
|
||||
@GET(UrlAddress.GET_ADMIN_APP)
|
||||
Observable<BaseResponse<List<AppDateInfo>>> getAdminApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppListInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetAllAppApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_ALL_APP)
|
||||
Observable<BaseResponse<List<AppListInfo>>> getAllAppList(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetAppLogApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_APP_LOG)
|
||||
Observable<BaseResponse> getAppLog(
|
||||
@Field("sn") String sn,
|
||||
@Field("random") String random,
|
||||
@Field("data") String data
|
||||
);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetBatchApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_BATCH)
|
||||
Observable<ResponseBody> getBatch(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetDesktopApi {
|
||||
@GET(UrlAddress.GET_DESKTOP)
|
||||
Observable<BaseResponse<ForceDownloadData>> getDesktop(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.DeveloperBean;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetDeveloperApi {
|
||||
@GET(UrlAddress.GET_DEVELOPER)
|
||||
Observable<BaseResponse<DeveloperBean>> getDeveloperState(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.EBagCode;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetEBagCodeApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_EBAG_CODE)
|
||||
Observable<BaseResponse<EBagCode>> getEBagCode(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetLockStateApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_LOCK_STATE)
|
||||
Observable<ResponseBody> getLockState(
|
||||
@Field("sn") String sn,
|
||||
@Field("status") String status,
|
||||
@Field("time") String time
|
||||
);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.PoweroffBean;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetPoweroffApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_POWEROFF_TIME)
|
||||
Observable<BaseResponse<List<PoweroffBean>>> getPoweroffTime(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.Batch;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetPushTagsApi {
|
||||
@GET(UrlAddress.GET_DEVICES_TAGS)
|
||||
Observable<BaseResponse<Batch>> getPushTags(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.SnRunLog;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetSnRunLogApi {
|
||||
@GET(UrlAddress.GET_LOG_ORDER)
|
||||
Observable<BaseResponse<SnRunLog>> getSnRunLog(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface GetUploadLogApi {
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPLOAD_LOG_FILE)
|
||||
Observable<BaseResponse> UploadLog(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.WiFiAlias;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* @author : fanhuitong
|
||||
* e-mail :
|
||||
* @date : 2021/10/26 10:07
|
||||
* desc :
|
||||
* version: 1.0
|
||||
*/
|
||||
public interface GetWiFiAliasApi {
|
||||
@GET(UrlAddress.GET_WIFI_ALIAS_PW)
|
||||
Observable<BaseResponse<List<WiFiAlias>>> getWiFiAlias(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,21 +1,37 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.SnRunLog;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface GetUploadIsLogApi {
|
||||
public interface LogApi {
|
||||
|
||||
@GET(UrlAddress.GET_LOG_ORDER)
|
||||
Observable<BaseResponse<SnRunLog>> getSnRunLog(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPLOAD_LOG_FILE)
|
||||
Observable<BaseResponse> uploadLog(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPLOAD_IS_LOG_FILE)
|
||||
Observable<BaseResponse> sendSnisLog(
|
||||
Observable<BaseResponse> sendSnLog(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.LogoImg;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface LogoImgApi {
|
||||
@GET(UrlAddress.GET_LOGO_IMG)
|
||||
Observable<BaseResponse<LogoImg>> getLogoImg(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface MACAddressApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_DEVICES)
|
||||
Observable<BaseResponse> sendMACaddress(
|
||||
@Field("sn") String sn,
|
||||
@Field("mac") String mac,
|
||||
@Field("jpush_id") String jpushId,
|
||||
@Field("devices_version") String devicesVersion,
|
||||
@Field("appstore_version") String appstoreVersion,
|
||||
@Field("store_version") String storeVersion,
|
||||
@Field("desktop_version") String desktop_version,
|
||||
@Field("local_mac") String local_mac,
|
||||
@Field("wifi_status") int wifi_status,
|
||||
@Field("PN_ip") String PN_ip,
|
||||
@Field("LAN_ip") String LAN_ip,
|
||||
@Field("bluetooth") String bluetooth,
|
||||
@Field("wifi_name") String wifi_name,
|
||||
@Field("browser_version") String browser_version,
|
||||
@Field("notice_version") String notice_version,
|
||||
@Field("platform") String platform,
|
||||
@Field("wifi_operator") String wifi_operator,
|
||||
@Field("network_type") String network_type,
|
||||
@Field("network_operator") String network_operator,
|
||||
@Field("sn_phone") String sn_phone,
|
||||
@Field("dpi") int dpi
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface NetAndLaunchApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.NET_AND_LAUNCH_API)
|
||||
Observable<NetAndLaunchBean> getNetAndLaunchApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface NetworkConnectApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.NETWORK_CONNECT)
|
||||
Observable<BaseResponse> sendNetwork(
|
||||
@Field("sn") String sn,
|
||||
@Field("time") String time
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface NewAppinsideWebApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_APPINSIDEWEB)
|
||||
Observable<BaseResponse> getAppinsideWeb(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppDateInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface RankCommonAppApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.HTTP_TAG_COMMOAPP)
|
||||
Observable<BaseResponse<List<AppDateInfo>>> getRankApp(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("page") String page
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.ScreenLockState;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface ScreenLockStateApi {
|
||||
@GET(UrlAddress.GET_LOCK_SCREEN_STATE)
|
||||
Observable<BaseResponse<ScreenLockState>> getScreenLockState(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
@Deprecated
|
||||
public interface SendDownloadInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_DOWNLOAD_FILE_INFO)
|
||||
Observable<BaseResponse> sendDownloadTimes(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("userId") int userId,
|
||||
@Field("package_name") String package_name,
|
||||
@Field("app_size") long app_size
|
||||
);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface SendDownloadTimesApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_DOWNLOAD_TIMES)
|
||||
Observable<BaseResponse> sendDownloadTimes(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("package") String packages,
|
||||
@Field("app_id") String app_id
|
||||
);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
/**
|
||||
* @author : fanhuitong
|
||||
* e-mail :
|
||||
* @date : 2021/10/2115:02
|
||||
* desc :
|
||||
* version: 1.0
|
||||
*/
|
||||
public interface SendRestoreTimesApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_RESTORE_TIMES)
|
||||
Observable<BaseResponse> sendRestoreTimes(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface SendScreenStatusApi {
|
||||
@FormUrlEncoded
|
||||
@POST(BuildConfig.SCREEN_URL)
|
||||
Observable<BaseResponse> sendScreenStatus(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("is_online") int is_online
|
||||
);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
@Deprecated
|
||||
public interface SendScreenshotApi {
|
||||
@Multipart
|
||||
@POST(UrlAddress.SEND_SCREENSHOT)
|
||||
Observable<BaseResponse> sendScreenshot(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface SendScreenshotCall {
|
||||
@Multipart
|
||||
@POST(UrlAddress.SEND_SCREENSHOT)
|
||||
Call<BaseResponse> sendScreenshot(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SnApi {
|
||||
@GET(UrlAddress.GET_SN_APP_TEST)
|
||||
Observable<BaseResponse<List<ForceDownloadData>>> getTestUpdate(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SN_EFENCE)
|
||||
Observable<BaseResponse> geElectronicFence(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppAttr;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SnAppAttrApi {
|
||||
@GET(UrlAddress.GET_SN_APP_ATTR)
|
||||
Observable<BaseResponse<List<AppAttr>>> getSnAppAttr(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface SnConfirmBindApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SN_CONFIRM_BIND)
|
||||
Observable<BaseResponse> snConfirmBind(
|
||||
@Field("sn") String sn,
|
||||
@Field("userId") String userId,
|
||||
@Field("type") int type
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.SnSetting;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SnSettingApi {
|
||||
@GET(UrlAddress.GET_SN_SETTING)
|
||||
Observable<BaseResponse<SnSetting>> getSnSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.SnTimeControl;
|
||||
import com.aoleyun.sn.bean.TimeControlData;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SnTimeControlApi {
|
||||
@GET(UrlAddress.GET_SN_TIME_CONTROL)
|
||||
Observable<BaseResponse<SnTimeControl>> getSnTimeControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_TIME_CONTROL)
|
||||
Observable<BaseResponse<TimeControlData>> getTimeControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface StudentsInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_STUDENTS_INFO)
|
||||
Observable<BaseResponse<StudentsInfo>> getStudentsInfo(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.DefaultApp;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.bean.LogoImg;
|
||||
import com.aoleyun.sn.bean.Wallpaper;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SystemCustomApi {
|
||||
@GET(UrlAddress.GET_LOGO_IMG)
|
||||
Observable<BaseResponse<LogoImg>> getLogoImg(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_WALLPAPER)
|
||||
Observable<BaseResponse<Wallpaper>> getWallpaper(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_DESKTOP)
|
||||
Observable<BaseResponse<ForceDownloadData>> getDesktop(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_DESKTOPS_DIY_UPDATE)
|
||||
Observable<BaseResponse<ForceDownloadData>> getDesktopsDiyUpdate(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_DEFAULT_APP)
|
||||
Observable<BaseResponse<DefaultApp>> getDefaultApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,17 +1,98 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppSettings;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.BlacklistBean;
|
||||
import com.aoleyun.sn.bean.BrowserBookmarks;
|
||||
import com.aoleyun.sn.bean.BrowserData;
|
||||
import com.aoleyun.sn.bean.PoweroffBean;
|
||||
import com.aoleyun.sn.bean.SnSetting;
|
||||
import com.aoleyun.sn.bean.SnTimeControl;
|
||||
import com.aoleyun.sn.bean.TimeControlData;
|
||||
import com.aoleyun.sn.bean.WhitelistBean;
|
||||
import com.aoleyun.sn.bean.WiFiAlias;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SystemSettingApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_FIRMWARE)
|
||||
Observable<BaseResponse> getSystemSettingApi(
|
||||
Observable<BaseResponse> getSystemSettings(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SN_SETTING)
|
||||
Observable<BaseResponse<SnSetting>> getSnSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SN_EFENCE)
|
||||
Observable<BaseResponse> geElectronicFence(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_HIDE_DESKTOPICON)
|
||||
Observable<BaseResponse> getDesktopIcon(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SN_TIME_CONTROL)
|
||||
Observable<BaseResponse<SnTimeControl>> getSnTimeControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_TIME_CONTROL)
|
||||
Observable<BaseResponse<TimeControlData>> getTimeControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_WIFI_ALIAS_PW)
|
||||
Observable<BaseResponse<List<WiFiAlias>>> getWiFiAlias(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_POWEROFF_TIME)
|
||||
Observable<BaseResponse<List<PoweroffBean>>> getPoweroffTime(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.APP_SETTING)
|
||||
Observable<BaseResponse<AppSettings>> getAppSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.BLACK_LIST)
|
||||
Observable<BaseResponse<BlacklistBean>> getBlackList(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.WHITE_LIST)
|
||||
Observable<BaseResponse<WhitelistBean>> getWhiteList(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_HOMEPAG_TAG)
|
||||
Observable<BaseResponse<BrowserBookmarks>> getBrowserBookmarks(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_BROWSER_LIST)
|
||||
Observable<BaseResponse<BrowserData>> getBrowserList(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.TopApp;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface TopAppControlApi {
|
||||
@GET(UrlAddress.GET_TOP_APP_CONTROL)
|
||||
Observable<BaseResponse<TopApp>> getSnAppControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface UpdateDeviceInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPDATE_DEVICEINFO)
|
||||
Observable<BaseResponse> updateDeviceInfo(
|
||||
@Field("sn") String sn,
|
||||
@Field("key") String key,
|
||||
@Field("machine") String machine,
|
||||
@Field("hardware") String hardware,
|
||||
@Field("address") String address,
|
||||
@Field("other") String other
|
||||
);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.PartMap;
|
||||
|
||||
public interface UploadAppImgApi {
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPLOAD_APP_IMG)
|
||||
Call<BaseResponse> uploadAppImg(
|
||||
@PartMap Map<String, RequestBody> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface UploadAppInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPLOAD_APPINFO)
|
||||
Observable<BaseResponse> getUploadAppInfoApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("app_infoes") String json
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.PartMap;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface UploadInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(BuildConfig.SCREEN_URL)
|
||||
@Deprecated
|
||||
Observable<BaseResponse> sendScreenStatus(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("is_online") int is_online
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPLOAD_APPINFO)
|
||||
@Deprecated
|
||||
Observable<BaseResponse> getUploadAppInfoApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("app_infoes") String json
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPLOAD_APPINFO)
|
||||
Observable<BaseResponse> getUploadAppInfoApi(
|
||||
@FieldMap Map<String, String> params
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_DEVICES)
|
||||
Observable<BaseResponse> sendMACaddress(
|
||||
@Field("sn") String sn,
|
||||
@Field("mac") String mac,
|
||||
@Field("jpush_id") String jpushId,
|
||||
@Field("devices_version") String devicesVersion,
|
||||
@Field("appstore_version") String appstoreVersion,
|
||||
@Field("store_version") String storeVersion,
|
||||
@Field("desktop_version") String desktop_version,
|
||||
@Field("local_mac") String local_mac,
|
||||
@Field("wifi_status") int wifi_status,
|
||||
@Field("PN_ip") String PN_ip,
|
||||
@Field("LAN_ip") String LAN_ip,
|
||||
@Field("bluetooth") String bluetooth,
|
||||
@Field("wifi_name") String wifi_name,
|
||||
@Field("browser_version") String browser_version,
|
||||
@Field("notice_version") String notice_version,
|
||||
@Field("platform") String platform,
|
||||
@Field("wifi_operator") String wifi_operator,
|
||||
@Field("network_type") String network_type,
|
||||
@Field("network_operator") String network_operator,
|
||||
@Field("sn_phone") String sn_phone,
|
||||
@Field("dpi") int dpi
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPDATE_DEVICEINFO)
|
||||
Observable<BaseResponse> updateDeviceInfo(
|
||||
@Field("sn") String sn,
|
||||
@Field("key") String key,
|
||||
@Field("machine") String machine,
|
||||
@Field("hardware") String hardware,
|
||||
@Field("address") String address,
|
||||
@Field("other") String other
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPDATE_DEVICEINFO)
|
||||
Observable<BaseResponse> updateDeviceInfo(
|
||||
@FieldMap Map<String, String> params
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_APP_LOG)
|
||||
Observable<BaseResponse> getAppLog(
|
||||
@Field("sn") String sn,
|
||||
@Field("random") String random,
|
||||
@Field("data") String data
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_RESTORE_TIMES)
|
||||
Observable<BaseResponse> sendRestoreTimes(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@Multipart
|
||||
@POST(UrlAddress.SEND_SCREENSHOT)
|
||||
Call<BaseResponse> sendScreenshot(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
|
||||
@Deprecated
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_LOCK_STATE)
|
||||
Observable<ResponseBody> getLockState(
|
||||
@Field("sn") String sn,
|
||||
@Field("status") String status,
|
||||
@Field("time") String time
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_BATTERY_INFO)
|
||||
Observable<BaseResponse> sendBatteryInfo(
|
||||
@Field("sn") String sn,
|
||||
@Field("key") String key,
|
||||
@Field("battery_quantity") String battery_quantity,
|
||||
@Field("battery_temperature") String battery_temperature,
|
||||
@Field("battery_voltage") String battery_voltage,
|
||||
@Field("charge_current") String charge_current,
|
||||
@Field("charge_voltage") String charge_voltage,
|
||||
@Field("battery_status") String battery_status,
|
||||
@Field("charge_type") String charge_type,
|
||||
@Field("charge_current_max") String charge_current_max,
|
||||
@Field("charge_voltage_max") String charge_voltage_max,
|
||||
@Field("battery_health") String battery_health,
|
||||
@Field("quantity_max") String quantity_max,
|
||||
@Field("battery_desc") String battery_desc,
|
||||
@Field("charge_speed") String charge_speed
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.NETWORK_CONNECT)
|
||||
Observable<BaseResponse> sendNetwork(
|
||||
@Field("sn") String sn,
|
||||
@Field("time") String time
|
||||
);
|
||||
|
||||
@Deprecated
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_DOWNLOAD_TIMES)
|
||||
Observable<BaseResponse> sendDownloadTimes(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("package") String packages,
|
||||
@Field("app_id") String app_id
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_IS_APP_IMG)
|
||||
Observable<BaseResponse> getIsAppImg(
|
||||
@Query("package") String pkg
|
||||
);
|
||||
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPLOAD_APP_IMG)
|
||||
Call<BaseResponse> uploadAppImg(
|
||||
@PartMap Map<String, RequestBody> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.Wallpaper;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface WallpaperApi {
|
||||
@GET(UrlAddress.GET_WALLPAPER)
|
||||
Observable<BaseResponse<Wallpaper>> getWallpaper(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.WhitelistBean;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface WhiteListApi {
|
||||
@GET(UrlAddress.WHITE_LIST)
|
||||
Observable<BaseResponse<WhitelistBean>> getWhiteList(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
30
app/src/main/java/com/aoleyun/sn/network/cache/CacheEntry.java
vendored
Normal file
30
app/src/main/java/com/aoleyun/sn/network/cache/CacheEntry.java
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.aoleyun.sn.network.cache;
|
||||
|
||||
/**
|
||||
* 缓存实体:存储请求结果、创建时间、有效期
|
||||
*
|
||||
* @param <T> 接口返回数据类型
|
||||
*/
|
||||
public class CacheEntry<T> {
|
||||
// 缓存的成功数据
|
||||
private final T data;
|
||||
// 缓存创建时间(毫秒)
|
||||
private final long createTime;
|
||||
// 缓存有效期(毫秒)
|
||||
private final long expireTimeMillis;
|
||||
|
||||
public CacheEntry(T data, long createTime, long expireTimeMillis) {
|
||||
this.data = data;
|
||||
this.createTime = createTime;
|
||||
this.expireTimeMillis = expireTimeMillis;
|
||||
}
|
||||
|
||||
// 判断缓存是否过期
|
||||
public boolean isExpired() {
|
||||
return System.currentTimeMillis() - createTime > expireTimeMillis;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
63
app/src/main/java/com/aoleyun/sn/network/cache/RxCacheManager.java
vendored
Normal file
63
app/src/main/java/com/aoleyun/sn/network/cache/RxCacheManager.java
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
package com.aoleyun.sn.network.cache;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* 全局缓存管理器:线程安全,存储所有接口缓存
|
||||
*/
|
||||
public class RxCacheManager {
|
||||
// 单例
|
||||
private static volatile RxCacheManager INSTANCE;
|
||||
// 缓存容器:key=请求唯一标识,value=缓存实体
|
||||
private final ConcurrentHashMap<String, CacheEntry<?>> cacheMap;
|
||||
|
||||
private RxCacheManager() {
|
||||
cacheMap = new ConcurrentHashMap<>();
|
||||
}
|
||||
|
||||
public static RxCacheManager getInstance() {
|
||||
if (INSTANCE == null) {
|
||||
synchronized (RxCacheManager.class) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new RxCacheManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存缓存
|
||||
*/
|
||||
public <T> void saveCache(String key, T data, long expireTimeMillis) {
|
||||
if (key == null || data == null) return;
|
||||
cacheMap.put(key, new CacheEntry<>(data, System.currentTimeMillis(), expireTimeMillis));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存(自动判断过期)
|
||||
*/
|
||||
public <T> T getCache(String key) {
|
||||
CacheEntry<?> entry = cacheMap.get(key);
|
||||
if (entry == null || entry.isExpired()) {
|
||||
// 缓存不存在/已过期,移除并返回null
|
||||
cacheMap.remove(key);
|
||||
return null;
|
||||
}
|
||||
return (T) entry.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空所有缓存
|
||||
*/
|
||||
public void clearAllCache() {
|
||||
cacheMap.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定缓存
|
||||
*/
|
||||
public void removeCache(String key) {
|
||||
cacheMap.remove(key);
|
||||
}
|
||||
}
|
||||
38
app/src/main/java/com/aoleyun/sn/network/cache/RxCacheRequest.java
vendored
Normal file
38
app/src/main/java/com/aoleyun/sn/network/cache/RxCacheRequest.java
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.aoleyun.sn.network.cache;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 优化后:无需手动传CacheKey,自动从请求获取
|
||||
*/
|
||||
public class RxCacheRequest {
|
||||
private static final RxCacheManager CACHE_MANAGER = RxCacheManager.getInstance();
|
||||
|
||||
/**
|
||||
* 极简调用:仅需 网络请求Observable + 缓存过期时间
|
||||
*
|
||||
* @param networkObservable 原始网络请求
|
||||
* @param expireTimeMillis 缓存有效期(毫秒)
|
||||
* @return 带自动缓存的Observable
|
||||
*/
|
||||
public static <T> Observable<T> withCache(Observable<T> networkObservable, String cacheKey, long expireTimeMillis) {
|
||||
return Observable.defer(() -> {
|
||||
|
||||
// 2. 读取缓存
|
||||
T cacheData = CACHE_MANAGER.getCache(cacheKey);
|
||||
if (cacheData != null) {
|
||||
return Observable.just(cacheData);
|
||||
}
|
||||
|
||||
// 3. 无缓存则发起网络请求,成功后缓存
|
||||
return networkObservable
|
||||
.subscribeOn(Schedulers.io())
|
||||
.doOnNext(data -> CACHE_MANAGER.saveCache(cacheKey, data, expireTimeMillis));
|
||||
})
|
||||
.subscribeOn(Schedulers.io()) // 缓存IO切到子线程
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
}
|
||||
66
app/src/main/java/com/aoleyun/sn/network/cache/RxTimeCacheManager.java
vendored
Normal file
66
app/src/main/java/com/aoleyun/sn/network/cache/RxTimeCacheManager.java
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
package com.aoleyun.sn.network.cache;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.ObservableSource;
|
||||
import io.reactivex.rxjava3.core.ObservableTransformer;
|
||||
|
||||
public class RxTimeCacheManager {
|
||||
|
||||
// Thread-safe memory cache to hold our data and its timestamp
|
||||
private static final ConcurrentHashMap<String, CacheEntry<?>> cacheMap = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* Industry Standard RxJava Cache Transformer.
|
||||
* * @param cacheKey Unique key for this specific request (e.g., URL or Method Name)
|
||||
*
|
||||
* @param validTimeMillis How long the data is valid before a new network request is allowed
|
||||
*/
|
||||
public static <T> ObservableTransformer<T, T> applyCache(final String cacheKey, final long validTimeMillis) {
|
||||
return new ObservableTransformer<T, T>() {
|
||||
@Override
|
||||
public ObservableSource<T> apply(Observable<T> upstream) {
|
||||
// defer() ensures this logic runs EVERY time someone subscribes, not at initialization
|
||||
return Observable.defer(() -> {
|
||||
CacheEntry<?> entry = cacheMap.get(cacheKey);
|
||||
long currentTime = System.currentTimeMillis();
|
||||
|
||||
// 1. Check if cache exists and is within the time limit
|
||||
if (entry != null && (currentTime - entry.timestamp) < validTimeMillis) {
|
||||
// Cache HIT -> Return cached data immediately, do not trigger network
|
||||
@SuppressWarnings("unchecked")
|
||||
T cachedData = (T) entry.data;
|
||||
return Observable.just(cachedData);
|
||||
}
|
||||
|
||||
// 2. Cache MISS or EXPIRED -> Trigger upstream (network) and save result
|
||||
return upstream.doOnNext(data -> {
|
||||
// Save the fresh data and current timestamp back to the cache
|
||||
cacheMap.put(cacheKey, new CacheEntry<>(data, System.currentTimeMillis()));
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears a specific cache key if you need to force a refresh manually.
|
||||
*/
|
||||
public static void clearCache(String cacheKey) {
|
||||
cacheMap.remove(cacheKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal wrapper to hold the payload and the time it was fetched.
|
||||
*/
|
||||
private static class CacheEntry<T> {
|
||||
final T data;
|
||||
final long timestamp;
|
||||
|
||||
CacheEntry(T data, long timestamp) {
|
||||
this.data = data;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -616,7 +616,7 @@ public class PushManager {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", Utils.getSerial(mContext));
|
||||
params.put("createtime", String.valueOf(createTime));
|
||||
Call<BaseResponse> call = NetInterfaceManager.getInstance().getScreenshotCall().sendScreenshot(params, body);
|
||||
Call<BaseResponse> call = NetInterfaceManager.getInstance().getUploadInfoApi().sendScreenshot(params, body);
|
||||
call.enqueue(new RetryCallback<BaseResponse>(call, 10, 30 * 1000) {
|
||||
@Override
|
||||
public void onRequestResponse(Call call, Response response) {
|
||||
@@ -1066,7 +1066,7 @@ public class PushManager {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", Utils.getSerial(mContext));
|
||||
params.put("createtime", String.valueOf(time));
|
||||
Call<BaseResponse> call = NetInterfaceManager.getInstance().getScreenshotCall().sendScreenshot(params, body);
|
||||
Call<BaseResponse> call = NetInterfaceManager.getInstance().getUploadInfoApi().sendScreenshot(params, body);
|
||||
call.enqueue(new RetryCallback<BaseResponse>(call, 10, 30 * 1000) {
|
||||
@Override
|
||||
public void onRequestResponse(Call call, Response response) {
|
||||
@@ -1504,7 +1504,7 @@ public class PushManager {
|
||||
|
||||
private void bind(final String id, int type) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getSnConfirmBindApi()
|
||||
.getDevicesStatusApi()
|
||||
.snConfirmBind(Utils.getSerial(mContext), id, type)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.gson.GsonUtils;
|
||||
import com.aoleyun.sn.manager.MapManager;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.network.api.aoleyun.SendScreenStatusApi;
|
||||
import com.aoleyun.sn.network.api.aoleyun.UploadInfoApi;
|
||||
import com.aoleyun.sn.receiver.NewAppReceiver;
|
||||
import com.aoleyun.sn.rlog.LogDBManager;
|
||||
import com.aoleyun.sn.service.main.MainService;
|
||||
@@ -387,8 +387,8 @@ public class GuardService extends Service {
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
|
||||
.build();
|
||||
SendScreenStatusApi sendScreenStatusApi = retrofit.create(SendScreenStatusApi.class);
|
||||
sendScreenStatusApi.sendScreenStatus(NetInterfaceManager.HTTP_KEY, Utils.getSerial(this), status)
|
||||
UploadInfoApi uploadInfoApi = retrofit.create(UploadInfoApi.class);
|
||||
uploadInfoApi.sendScreenStatus(NetInterfaceManager.HTTP_KEY, Utils.getSerial(this), status)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@@ -424,7 +424,7 @@ public class GuardService extends Service {
|
||||
return;
|
||||
}
|
||||
NetInterfaceManager.getInstance()
|
||||
.getLockState()
|
||||
.getUploadInfoApi()
|
||||
.getLockState(Utils.getSerial(this), status, time)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
||||
@@ -268,8 +268,8 @@ public class LogcatService extends Service {
|
||||
//设置一个file文件
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("file", file.getName(), fileBody);
|
||||
|
||||
NetInterfaceManager.getInstance().getUploadLogApi()
|
||||
.UploadLog(params, body)
|
||||
NetInterfaceManager.getInstance().getLogApi()
|
||||
.uploadLog(params, body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
|
||||
@@ -309,7 +309,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
String customVersion = Utils.getCustomVersion();
|
||||
Log.e(TAG, "getROMApp: " + customVersion);
|
||||
NetInterfaceManager.getInstance()
|
||||
.getCustomROMApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getCustomRomApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getRomAppFinish();
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.app.AlarmManager;
|
||||
import android.app.IActivityManager;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -44,6 +43,7 @@ import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.activity.main.MainActivity;
|
||||
import com.aoleyun.sn.base.BaseService;
|
||||
import com.aoleyun.sn.bean.PoweroffBean;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
@@ -68,10 +68,7 @@ import com.google.gson.reflect.TypeToken;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.trello.rxlifecycle4.LifecycleProvider;
|
||||
import com.trello.rxlifecycle4.LifecycleTransformer;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.trello.rxlifecycle4.android.RxLifecycleAndroid;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -86,14 +83,14 @@ import io.reactivex.rxjava3.core.ObservableEmitter;
|
||||
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
|
||||
public class MainService extends Service implements MainSContact.MainView, NetworkUtils.OnNetworkStatusChangedListener, LifecycleProvider<ActivityEvent> {
|
||||
public class MainService extends BaseService implements MainSContact.MainView, NetworkUtils.OnNetworkStatusChangedListener, LifecycleProvider<ActivityEvent> {
|
||||
private static final String TAG = "MainService";
|
||||
|
||||
public MainSPresenter mPresenter;
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
public MainSPresenter mPresenter;
|
||||
|
||||
private static final String JXW_LAUNCHER = "com.wyt.wangkexueximvvm";
|
||||
|
||||
@Override
|
||||
@@ -278,23 +275,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
};
|
||||
|
||||
private final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
|
||||
|
||||
@Override
|
||||
public Observable<ActivityEvent> lifecycle() {
|
||||
return lifecycleSubject.hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> LifecycleTransformer<T> bindUntilEvent(ActivityEvent event) {
|
||||
return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> LifecycleTransformer<T> bindToLifecycle() {
|
||||
return RxLifecycleAndroid.bindActivity(lifecycleSubject);
|
||||
}
|
||||
|
||||
private WifiReceiver mWifiReceiver;
|
||||
|
||||
private void registerWiFiReceiver() {
|
||||
@@ -382,6 +362,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
String action = intent.getAction();
|
||||
Log.e("RefreshReceiver", "onReceive: " + action);
|
||||
if (!TextUtils.isEmpty(action)) {
|
||||
NetInterfaceManager.clearAllCache();
|
||||
mPresenter.getLockedState();
|
||||
}
|
||||
}
|
||||
@@ -465,10 +446,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
Log.e(TAG, "onCreate: ");
|
||||
lifecycleSubject.onNext(ActivityEvent.CREATE);
|
||||
mPresenter = new MainSPresenter(this);
|
||||
mPresenter.attachView(this);
|
||||
mPresenter.setLifecycle(lifecycleSubject);
|
||||
mPresenter.setLifecycle(getLifecycleSubject());
|
||||
if ("YX-T01".equalsIgnoreCase(Build.MODEL)) {
|
||||
JgyUtils.getInstance().setTongyiAppTop();
|
||||
}
|
||||
@@ -647,7 +627,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
lifecycleSubject.onNext(ActivityEvent.DESTROY);
|
||||
unRegisterReceivers();
|
||||
NetworkUtils.unregisterNetworkStatusChangedListener(this);
|
||||
mPresenter.detachView();
|
||||
|
||||
@@ -434,35 +434,7 @@ public class JgyUtils {
|
||||
|
||||
public String getAppPlatform() {
|
||||
String platform = BuildConfig.platform;
|
||||
if (MTKTag.equalsIgnoreCase(platform)) {
|
||||
return MTKTag;
|
||||
} else if (ZhanruiTag.equalsIgnoreCase(platform)) {
|
||||
return ZhanruiTag;
|
||||
}
|
||||
// else if (CubeTag.equalsIgnoreCase(platform)) {
|
||||
// return CubeTag;
|
||||
// }
|
||||
else if (MTK11Tag.equalsIgnoreCase(platform)) {
|
||||
return MTK11Tag;
|
||||
} else if (TeclastP20sTag.equalsIgnoreCase(platform)) {
|
||||
return TeclastP20sTag;
|
||||
} else if (AH6016Tag.equalsIgnoreCase(platform)) {
|
||||
return AH6016Tag;
|
||||
} else if (ZR6016Tag.equalsIgnoreCase(platform)) {
|
||||
return ZR6016Tag;
|
||||
} else if (HRAD13Tag.equalsIgnoreCase(platform)) {
|
||||
return HRAD13Tag;
|
||||
} else if (G10PTag.equalsIgnoreCase(platform)) {
|
||||
return G10PTag;
|
||||
} else if (C2Tag.equalsIgnoreCase(platform)) {
|
||||
return C2Tag;
|
||||
} else if (YXPD1TAG.equalsIgnoreCase(platform)) {
|
||||
return YXPD1TAG;
|
||||
} else if (G11TAG.equalsIgnoreCase(platform)) {
|
||||
return G11TAG;
|
||||
} else {
|
||||
return Other;
|
||||
}
|
||||
return platform;
|
||||
}
|
||||
|
||||
public static boolean isOfficialVersion() {
|
||||
@@ -2945,8 +2917,8 @@ public class JgyUtils {
|
||||
jsonObject.addProperty("jpush_id", PushServiceFactory.getCloudPushService().getDeviceId());
|
||||
jsonObject.addProperty("devices_version", Utils.getCustomVersion());
|
||||
jsonObject.addProperty("appstore_version", BuildConfig.VERSION_NAME);
|
||||
jsonObject.addProperty("store_version", Utils.getAPPVersionName(PackageNames.APPSTORE, mContext));
|
||||
jsonObject.addProperty("desktop_version", Utils.getAPPVersionName("com.aoleyun.os", mContext));
|
||||
jsonObject.addProperty("store_version", Utils.getAppVersionName(PackageNames.APPSTORE, mContext));
|
||||
jsonObject.addProperty("desktop_version", Utils.getAppVersionName("com.aoleyun.os", mContext));
|
||||
jsonObject.addProperty("local_mac", Utils.getAndroid7MAC());
|
||||
// jsonObject.addProperty("wifi_status", Utils.obtainWifiInfo(mContext));
|
||||
jsonObject.addProperty("PN_ip", mMMKV.decodeString(NetInterfaceManager.PublicIP, ""));
|
||||
|
||||
@@ -741,7 +741,7 @@ public class Utils {
|
||||
}
|
||||
|
||||
//获取App版本号
|
||||
public static String getAPPVersionName(String pck, Context context) {
|
||||
public static String getAppVersionName(String pck, Context context) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
String versionName;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user