diff --git a/AndroidManifest-common.xml b/AndroidManifest-common.xml
index 07f16de..e61e138 100644
--- a/AndroidManifest-common.xml
+++ b/AndroidManifest-common.xml
@@ -45,23 +45,11 @@
-
-
-
-
-
-
-
-
-
-
@@ -238,100 +226,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:value="333898268" />
+ android:value="3bb4bc02061344cc9499a338a9a187d9" />
diff --git a/build.gradle b/build.gradle
index fdc0b82..0642738 100644
--- a/build.gradle
+++ b/build.gradle
@@ -11,7 +11,6 @@ buildscript {
dependencies {
classpath GRADLE_CLASS_PATH
classpath PROTOBUF_CLASS_PATH
- classpath "com.tencent.android.tpns:tpnsplugin:1.8.0"
}
}
@@ -36,24 +35,9 @@ final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/framework_inter
apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'
-//apply plugin: "com.tencent.android.tpns"
android {
-// gradle.projectsEvaluated {
-// tasks.withType(JavaCompile) {
-// Set fileSet = options.bootstrapClasspath.getFiles()
-// List newFileList = new ArrayList<>();
-// //JAVA语法,可连续调用,输入参数建议为相对路径
-// newFileList.add(new File("libs/framework.jar"))
-// //最后将原始参数添加
-// newFileList.addAll(fileSet)
-// options.bootstrapClasspath = files(
-// newFileList.toArray()
-// )
-// }
-// }
-
lintOptions {
checkReleaseBuilds false
abortOnError false
@@ -66,13 +50,8 @@ android {
minSdkVersion 26
targetSdkVersion 28
-// //MTK
- versionCode 49
- versionName "2.3.9"
-
-// //cube
-// versionCode 80
-// versionName "6.4.0"
+ versionCode 3
+ versionName "1.0.2"
ndk {
//选择要添加的对应 cpu 类型的 .so 库。
@@ -91,69 +70,7 @@ android {
//签名
signingConfigs {
- zhanRui {
- storeFile file("src/doc/zhanxun.keystore")
- storePassword "123456"
- keyAlias "zhanxun"
- keyPassword "123456"
- v1SigningEnabled true
- v2SigningEnabled true
- }
-
- zhanRuiUserdebug {
- storeFile file("src/doc/zhanxunUserdebug.keystore")
- storePassword "123456"
- keyAlias "zhanxunUserdebug"
- keyPassword "123456"
- v1SigningEnabled true
- v2SigningEnabled false
- }
-
- zhanRui12 {
- storeFile file("src/doc/zhanrui12.jks")
- storePassword "123456"
- keyAlias "zhanrui12"
- keyPassword "123456"
- v1SigningEnabled true
- v2SigningEnabled true
- }
-
- mtk {
- storeFile file("src/doc/xueshibaoos.jks")
- storePassword "123456"
- keyAlias "xueshibaoos"
- keyPassword "123456"
- v1SigningEnabled true
- v2SigningEnabled true
- }
-
- TeclastP20S {
- storeFile file("src/doc/MTKP20S.keystore")
- storePassword "123456"
- keyAlias "MTKP20S"
- keyPassword "123456"
- v2SigningEnabled false
- }
-
- zhanruiG10Z{
- storeFile file("src/doc/zhanruiG10Z.keystore")
- storePassword "123456"
- keyAlias "zhanruiG10Z"
- keyPassword "123456"
- v1SigningEnabled true
- v2SigningEnabled true
- }
-
- G10P {
- storeFile file("src/doc/G10PMTK11.jks")
- storePassword "123456"
- keyAlias "G10PMTK11"
- keyPassword "123456"
- v1SigningEnabled true
- v2SigningEnabled true
- }
-
- U807 {
+ U807 {
storeFile file("src/doc/AllwinnerU807.jks")
storePassword "123456"
keyAlias "u807"
@@ -177,85 +94,6 @@ android {
signingConfig signingConfigs.U807
}
- G10PDebug.initWith(debug)
- G10PDebug {
- buildConfigField "String", "platform", '"MTK11"'
- versionNameSuffix "-debug"
- debuggable true
- signingConfig signingConfigs.G10P
- }
-
- G10PRelease.initWith(release)
- G10PRelease {
- buildConfigField "String", "platform", '"MTK11"'
- signingConfig signingConfigs.G10P
- }
-
- zhanRuiDebug.initWith(debug)
- zhanRuiDebug {
- versionNameSuffix "-debug"
- buildConfigField "String", "platform", '"ZhanRui"'
- debuggable true
- signingConfig signingConfigs.zhanRui
- }
-
- zhanRuiRelease.initWith(release)
- zhanRuiRelease {
- buildConfigField "String", "platform", '"ZhanRui"'
- signingConfig signingConfigs.zhanRui
- }
-
- //userdebug rom使用这个版本
- zhanRuiUserdebug.initWith(zhanRuiDebug)
- zhanRuiUserdebug {
- versionNameSuffix "-debug"
- buildConfigField "String", "platform", '"ZhanRui"'
- debuggable true
- signingConfig signingConfigs.zhanRuiUserdebug
- }
-
- zhanRui12Debug.initWith(debug)
- zhanRui12Debug {
- versionNameSuffix "-debug"
- buildConfigField "String", "platform", '"AH6016"'
- debuggable true
- signingConfig signingConfigs.zhanRui12
- }
-
- zhanRui12Release.initWith(release)
- zhanRui12Release {
- buildConfigField "String", "platform", '"AH6016"'
- signingConfig signingConfigs.zhanRui12
- }
-
- TeclastP20SDebug.initWith(debug)
- TeclastP20SDebug {
- debuggable true
- versionNameSuffix "-debug"
- buildConfigField "String", "platform", '"P20S"'
- signingConfig signingConfigs.TeclastP20S
- }
-
- TeclastP20SRelease.initWith(release)
- TeclastP20SRelease {
- buildConfigField "String", "platform", '"P20S"'
- signingConfig signingConfigs.TeclastP20S
- }
-
- zhanruiG10ZDebug.initWith(debug)
- zhanruiG10ZDebug {
- buildConfigField "String", "platform", '"ZR6016"'
- versionNameSuffix "-debug"
- debuggable true
- signingConfig signingConfigs.zhanruiG10Z
- }
-
- zhanruiG10ZRelease.initWith(release)
- zhanruiG10ZRelease {
- buildConfigField "String", "platform", '"ZR6016"'
- signingConfig signingConfigs.zhanruiG10Z
- }
-
debug {
buildConfigField "String", "platform", '"MTK"'
debuggable true
@@ -264,7 +102,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//Zipalign优化
zipAlignEnabled true
- signingConfig signingConfigs.mtk
+ signingConfig signingConfigs.U807
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
@@ -285,7 +123,7 @@ android {
//Zipalign优化
zipAlignEnabled true
//签名
- signingConfig signingConfigs.mtk
+ signingConfig signingConfigs.U807
//将release版本的包名重命名,加上版本及日期
applicationVariants.all { variant ->
variant.outputs.each { output ->
@@ -460,8 +298,6 @@ dependencies {
implementation 'com.jakewharton:disklrucache:2.0.2'
//mmkv
implementation 'com.tencent:mmkv-static:1.2.13'
- //腾讯移动推送 TPNS
- implementation 'com.tencent.tpns:tpns:1.3.2.0-release'
//阿里云推送
implementation 'com.aliyun.ams:alicloud-android-push:3.8.0'
//下载
diff --git a/res/drawable-hdpi/com_uiui_aios.png b/res/drawable-hdpi/com_uiui_aios.png
new file mode 100644
index 0000000..7e25fd7
Binary files /dev/null and b/res/drawable-hdpi/com_uiui_aios.png differ
diff --git a/res/drawable-hdpi/com_uiui_zyos.png b/res/drawable-hdpi/com_uiui_zyos.png
new file mode 100644
index 0000000..573c1b4
Binary files /dev/null and b/res/drawable-hdpi/com_uiui_zyos.png differ
diff --git a/res/drawable-hdpi/system_switch.png b/res/drawable-hdpi/system_switch.png
new file mode 100644
index 0000000..fa4f4d1
Binary files /dev/null and b/res/drawable-hdpi/system_switch.png differ
diff --git a/res/drawable-hdpi/wallpapers.jpg b/res/drawable-hdpi/wallpapers.jpg
new file mode 100644
index 0000000..d7ea3dd
Binary files /dev/null and b/res/drawable-hdpi/wallpapers.jpg differ
diff --git a/res/drawable-hdpi/wallpapers.png b/res/drawable-hdpi/wallpapers.png
deleted file mode 100644
index ea4b174..0000000
Binary files a/res/drawable-hdpi/wallpapers.png and /dev/null differ
diff --git a/res/mipmap-hdpi/ic_launcher_home.png b/res/mipmap-hdpi/ic_launcher_home.png
index 1cd4d0e..26fa396 100644
Binary files a/res/mipmap-hdpi/ic_launcher_home.png and b/res/mipmap-hdpi/ic_launcher_home.png differ
diff --git a/res/mipmap-hdpi/ic_launcher_home_foreground.png b/res/mipmap-hdpi/ic_launcher_home_foreground.png
deleted file mode 100644
index d068d92..0000000
Binary files a/res/mipmap-hdpi/ic_launcher_home_foreground.png and /dev/null differ
diff --git a/res/mipmap-mdpi/ic_launcher_home.png b/res/mipmap-mdpi/ic_launcher_home.png
index 1cd4d0e..26fa396 100644
Binary files a/res/mipmap-mdpi/ic_launcher_home.png and b/res/mipmap-mdpi/ic_launcher_home.png differ
diff --git a/res/mipmap-mdpi/ic_launcher_home_foreground.png b/res/mipmap-mdpi/ic_launcher_home_foreground.png
deleted file mode 100644
index 0ed9f4d..0000000
Binary files a/res/mipmap-mdpi/ic_launcher_home_foreground.png and /dev/null differ
diff --git a/res/mipmap-xhdpi/ic_launcher_home.png b/res/mipmap-xhdpi/ic_launcher_home.png
index 1cd4d0e..26fa396 100644
Binary files a/res/mipmap-xhdpi/ic_launcher_home.png and b/res/mipmap-xhdpi/ic_launcher_home.png differ
diff --git a/res/mipmap-xhdpi/ic_launcher_home_foreground.png b/res/mipmap-xhdpi/ic_launcher_home_foreground.png
deleted file mode 100644
index 7a9daf5..0000000
Binary files a/res/mipmap-xhdpi/ic_launcher_home_foreground.png and /dev/null differ
diff --git a/res/mipmap-xxhdpi/ic_launcher_home.png b/res/mipmap-xxhdpi/ic_launcher_home.png
index 1cd4d0e..26fa396 100644
Binary files a/res/mipmap-xxhdpi/ic_launcher_home.png and b/res/mipmap-xxhdpi/ic_launcher_home.png differ
diff --git a/res/mipmap-xxhdpi/ic_launcher_home_foreground.png b/res/mipmap-xxhdpi/ic_launcher_home_foreground.png
deleted file mode 100644
index 03b493e..0000000
Binary files a/res/mipmap-xxhdpi/ic_launcher_home_foreground.png and /dev/null differ
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6833e5c..f78f839 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -23,7 +23,7 @@
Launcher3
- 桌面
+ 管控桌面
文件夹
@@ -340,4 +340,6 @@
Failed: %1$s
+
+ 系统切换
diff --git a/res/xml/default_workspace_6x4.xml b/res/xml/default_workspace_6x4.xml
index fea249f..9a4aa6e 100644
--- a/res/xml/default_workspace_6x4.xml
+++ b/res/xml/default_workspace_6x4.xml
@@ -87,7 +87,7 @@
launcher:screen="1"
launcher:x="1"
launcher:y="0">
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -169,4 +177,54 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/xml/device_profiles.xml b/res/xml/device_profiles.xml
index a8f981a..29790f4 100644
--- a/res/xml/device_profiles.xml
+++ b/res/xml/device_profiles.xml
@@ -135,8 +135,8 @@
launcher:name="Large Phone"
launcher:minWidthDps="406"
launcher:minHeightDps="694"
- launcher:iconImageSize="70"
- launcher:iconTextSize="14.4"
+ launcher:iconImageSize="90"
+ launcher:iconTextSize="16"
launcher:canBeDefault="true" />
diff --git a/src/com/uiuipad/os/CellLayout.java b/src/com/uiuipad/os/CellLayout.java
index 80f6cc8..62d8691 100644
--- a/src/com/uiuipad/os/CellLayout.java
+++ b/src/com/uiuipad/os/CellLayout.java
@@ -2552,12 +2552,12 @@ public class CellLayout extends ViewGroup implements Transposable {
}
public int getDesiredWidth() {
- return getPaddingLeft() + getPaddingRight() + (4 * mCellWidth);
+ return getPaddingLeft() + getPaddingRight() + (3 * mCellWidth);
//固定返回文件夹宽度
}
public int getDesiredHeight() {
- return getPaddingTop() + getPaddingBottom() + (4 * mCellHeight);
+ return getPaddingTop() + getPaddingBottom() + (3 * mCellHeight);
//固定返回文件夹高度
}
diff --git a/src/com/uiuipad/os/Launcher.java b/src/com/uiuipad/os/Launcher.java
index 9f75111..6f5b54e 100644
--- a/src/com/uiuipad/os/Launcher.java
+++ b/src/com/uiuipad/os/Launcher.java
@@ -105,7 +105,6 @@ import com.uiuipad.os.model.AppLaunchTracker;
import com.uiuipad.os.model.ModelWriter;
import com.uiuipad.os.network.bean.AppPasswdBean;
import com.uiuipad.os.network.bean.BaseResponse;
-import com.uiuipad.os.network.HTTPInterface;
import com.uiuipad.os.network.NetInterfaceManager;
import com.uiuipad.os.network.bean.NewestAppUpdateResult;
import com.uiuipad.os.notification.NotificationListener;
@@ -156,9 +155,6 @@ import com.uiuipad.os.widget.custom.CustomWidgetParser;
import com.arialyy.aria.core.Aria;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
-import com.tencent.android.tpush.XGIOperateCallback;
-import com.tencent.android.tpush.XGPushConfig;
-import com.tencent.android.tpush.XGPushManager;
import com.tencent.mmkv.MMKV;
import java.io.File;
@@ -480,25 +476,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
});
JGYUtils.getInstance().wakeUpAppstore();
JGYUtils.getInstance().wakeUpDeviceInfo();
- XGPushConfig.enableDebug(this, true);
- XGPushManager.registerPush(this, new XGIOperateCallback() {
- @Override
- public void onSuccess(Object data, int flag) {
- //token在设备卸载重装的时候有可能会变
- Log.e("TPush", "注册成功,设备token为:" + data);
- NetInterfaceManager.getInstance().setPushTag(true, new NetInterfaceManager.onCompleteCallback() {
- @Override
- public void onComplete() {
-
- }
- });
- }
-
- @Override
- public void onFail(Object data, int errCode, String msg) {
- Log.e("TPush", "注册失败,错误码:" + errCode + ",错误信息:" + msg);
- }
- });
PushServiceFactory.init(this);
final CloudPushService pushService = PushServiceFactory.getCloudPushService();
pushService.setLogLevel(CloudPushService.LOG_DEBUG);
@@ -1173,43 +1150,8 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
Log.e("onStart", "app = null" + packageName);
return;
}
- sendAppUsageRecord(packageName);
}
- private void sendAppUsageRecord(String packageName) {
- Log.e("sendAppUsageRecord", "packageName: " + packageName);
- String app_name = APKUtils.getAppNameByPackage(Launcher.this, packageName);
- long openTime = TimeUtils.getInstance().getStartTime() / 1000;
- long closeTime = TimeUtils.getInstance().getEndTime() / 1000;
- NetInterfaceManager.getInstance()
- .getAppUsageRecordControl()
- .sendAppUsageRecord(Utils.getSerial(Launcher.this), packageName, app_name, openTime, closeTime)
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(new Observer() {
- @Override
- public void onSubscribe(Disposable d) {
- Log.e("sendAppUsageRecord", "onSubscribe: ");
- }
-
- @Override
- public void onNext(BaseResponse baseResponse) {
- Log.e("sendAppUsageRecord", "onNext: " + baseResponse);
- }
-
- @Override
- public void onError(Throwable e) {
- Log.e("sendAppUsageRecord", "onError: " + e.getMessage());
- }
-
- @Override
- public void onComplete() {
- Log.e("sendAppUsageRecord", "onComplete: ");
- }
- });
- }
-
-
private void handleDeferredResume() {
if (hasBeenResumed() && !mStateManager.getState().disableInteraction) {
getUserEventDispatcher().logActionCommand(Action.Command.RESUME,
@@ -1286,7 +1228,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
mUpdate.checkUpdate(System.currentTimeMillis());
mPasswd.getPassword(System.currentTimeMillis());
TimeUtils.getInstance().setAppPackageName(BuildConfig.APPLICATION_ID);
- HTTPInterface.sendRunningApp(Launcher.this);
JGYUtils.getInstance().wakeUpAppstore();
JGYUtils.getInstance().wakeUpDeviceInfo();
checkIsRest();
@@ -1344,7 +1285,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
@Override
public void onNext(Long aLong) {
Log.e("passwdObserver", "onNext: " + aLong);
- HTTPInterface.getAppPasswd();
+
}
@Override
@@ -1380,7 +1321,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
@Override
public void onNext(Long aLong) {
Log.e("updateObserver", "onNext: " + aLong);
- checkUpdate();
}
@Override
@@ -1394,77 +1334,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
}
};
- private void checkUpdate() {
- NetInterfaceManager.getInstance()
- .getCheckUpdateObservable()
- .getCheckUpdate(BuildConfig.APPLICATION_ID,
- BuildConfig.VERSION_CODE,
- JGYUtils.getInstance().checkAppPlatform())
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(new Observer>() {
- @Override
- public void onSubscribe(Disposable d) {
- Log.e("checkUpdate", "onSubscribe: ");
- }
-
- @Override
- public void onNext(BaseResponse response) {
- Log.e("checkUpdate", "onNext: " + response);
- int code = response.code;
- if (code == 200) {
- NewestAppUpdateResult result = response.data;
- checkAppUpdate(result);
- } else {
- Log.e(TAG, "onNext: " + "not find update");
- }
- }
-
- @Override
- public void onError(Throwable e) {
- Log.e("checkUpdate", "onError: " + e.getMessage());
- }
-
- @Override
- public void onComplete() {
- Log.e("checkUpdate", "onComplete: ");
- }
- });
- }
-
- private void checkAppUpdate(NewestAppUpdateResult result) {
- int version_code = result.getVersion_code();
- String app_package = result.getApp_package();
- String url = result.getUrl();
- PackageInfo info = null;
- try {
- info = getPackageManager().getPackageInfo(app_package, 0);
- } catch (PackageManager.NameNotFoundException e) {
- e.printStackTrace();
- }
- long appVersionCode;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
- appVersionCode = info.getLongVersionCode();
- } else {
- appVersionCode = info.versionCode;
- }
- if (info != null && appVersionCode < version_code) {
- Aria.download(this)
- .load(url)
- .setExtendField(result.toString())
- .setFilePath(ContextCompat.getExternalFilesDirs(Launcher.this, Environment.DIRECTORY_DOWNLOADS)[0].getAbsolutePath() + File.separator + getFileNamefromURL(url))
- .ignoreFilePathOccupy()
- .create();
- } else {
- Log.e(TAG, "checkAppUpdate: " + app_package + " :无需更新");
- }
- }
-
- public static String getFileNamefromURL(String url) {
- int position = url.lastIndexOf("/");
- return url.substring(position + 1);
- }
-
@Override
protected void onPause() {
// Ensure that items added to Launcher are queued until Launcher returns
@@ -3067,7 +2936,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
// Setting the touch point to (-1, -1) will show the options popup in the center of
// the screen.
-// OptionsPopupView.showDefaultOptions(this, -1, -1);
+ OptionsPopupView.showDefaultOptions(this, -1, -1);
}
return true;
}
diff --git a/src/com/uiuipad/os/folder/ClippedFolderIconLayoutRule.java b/src/com/uiuipad/os/folder/ClippedFolderIconLayoutRule.java
index 370faa3..018f661 100644
--- a/src/com/uiuipad/os/folder/ClippedFolderIconLayoutRule.java
+++ b/src/com/uiuipad/os/folder/ClippedFolderIconLayoutRule.java
@@ -6,7 +6,7 @@ public class ClippedFolderIconLayoutRule {
static final int MAX_NUM_ITEMS_IN_PREVIEW = Integer.MAX_VALUE;
private static final int MIN_NUM_ITEMS_IN_PREVIEW = 2;
- private static final float MIN_SCALE = 0.16f;
+ private static final float MIN_SCALE = 0.22f;
private static final float MAX_SCALE = 0.58f;
private static final float MAX_RADIUS_DILATION = 0.15f;
private static final float ITEM_RADIUS_SCALE_FACTOR = 1.33f;
@@ -55,8 +55,8 @@ public class ClippedFolderIconLayoutRule {
// transX = mTmpPoint[0];
// transY = mTmpPoint[1];
//图标根据大小居中
- float x = (mAvailableSpace - mIconSize * 4 * MIN_SCALE - 2) / 2;
- int tempIndex = index % 16;
+ float x = (mAvailableSpace - mIconSize * 3 * MIN_SCALE - 2) / 2;
+ int tempIndex = index % 9;
transX = x + mIconSize * MIN_SCALE * getCol(tempIndex) + getCol(tempIndex) * 2;
transY = x + mIconSize * MIN_SCALE * (getRow(tempIndex) - 1) + (getRow(tempIndex) - 1) * 2;
// Log.e("fht", "transX: "+transX);
@@ -79,11 +79,11 @@ public class ClippedFolderIconLayoutRule {
/* 20180702 modify begin */
private int getRow(int index) {
- return index / 4 + 1;
+ return index / 3 + 1;
}
private int getCol(int index) {
- return (index) % 4;
+ return (index) % 3;
}
/* 20180702 modify end */
@@ -96,11 +96,11 @@ public class ClippedFolderIconLayoutRule {
*/
private void getGridPosition(int row, int col, float[] result) {
// We use position 0 and 3 to calculate the x and y distances between items.
- getPosition(0, 4, result);
+ getPosition(0, 3, result);
float left = result[0];
float top = result[1];
- getPosition(3, 4, result);
+ getPosition(3, 3, result);
float dx = result[0] - left;
float dy = result[1] - top;
diff --git a/src/com/uiuipad/os/folder/FolderPagedView.java b/src/com/uiuipad/os/folder/FolderPagedView.java
index 2056f2b..6ec3751 100644
--- a/src/com/uiuipad/os/folder/FolderPagedView.java
+++ b/src/com/uiuipad/os/folder/FolderPagedView.java
@@ -93,8 +93,8 @@ public class FolderPagedView extends PagedView {
InvariantDeviceProfile profile = LauncherAppState.getIDP(context);
// mMaxCountX = profile.numFolderColumns;
// mMaxCountY = profile.numFolderRows;
- mMaxCountX = 4;
- mMaxCountY = 4;
+ mMaxCountX = 3;
+ mMaxCountY = 3;
mMaxItemsPerPage = mMaxCountX * mMaxCountY;
mInflater = LayoutInflater.from(context);
@@ -129,9 +129,9 @@ public class FolderPagedView extends PagedView {
} else {
done = false;
/* 添加新计算 begin */
- if(count >4){
- gridCountX = 4;
- gridCountY = (count+1)/4 + 1;
+ if(count >3){
+ gridCountX = 3;
+ gridCountY = (count+1)/3 + 1;
}else{
gridCountX = count;
gridCountY =1 ;
diff --git a/src/com/uiuipad/os/icons/IconCache.java b/src/com/uiuipad/os/icons/IconCache.java
index 6961d07..7858f46 100644
--- a/src/com/uiuipad/os/icons/IconCache.java
+++ b/src/com/uiuipad/os/icons/IconCache.java
@@ -240,6 +240,7 @@ public class IconCache extends BaseIconCache {
this.add("com.android.calendar.AllInOneActivity");//日历
this.add("com.android.camera.CameraLauncher");//相机
this.add("com.mediatek.camera.CameraLauncher");//相机
+ this.add("com.softwinner.camera.CameraLauncher");//相机
this.add("com.android.contacts.activities.PeopleActivity");//通讯录
this.add("com.android.deskclock.DeskClock");//时钟
this.add("com.android.dialer.DialtactsActivity");//电话
@@ -247,6 +248,7 @@ public class IconCache extends BaseIconCache {
this.add("com.android.dialer.main.impl.MainActivity");//电话
this.add("com.android.gallery3d.v2.app.GalleryActivity2");//图库
this.add("com.android.gallery3d.app.GalleryActivity");//图库
+ this.add("com.google.android.apps.photos.home.HomeActivity");//图库
this.add("com.android.messaging.ui.conversationlist.ConversationListActivity");//信息
this.add("com.android.music.MusicBrowserActivity");//音乐
this.add("com.android.providers.downloads.ui.DownloadList");//下载
@@ -256,11 +258,17 @@ public class IconCache extends BaseIconCache {
this.add("com.android.soundrecorder.SoundRecorder");//录音机
this.add("com.android.stk.StkMain");//sim卡
this.add("com.sprd.gallery3d.app.NewVideoActivity");//视频
+ this.add("com.softwinner.videoplayer.view.activity.HomePageActivity");//视频
this.add("com.mediatek.filemanager.FileManagerOperationActivity");//文件管理
+ this.add("com.google.android.apps.nbu.files.home.HomeActivity");//文件管理
this.add("com.android.documentsui.LauncherActivity");//下载
this.add("com.mediatek.fmradio.FmRadioActivity");//收音机
this.add("com.android.fmradio.FmMainActivity");//收音机
this.add("com.android.email.activity.Welcome");//电子邮件
+ this.add("com.uiui.aios.activity.main.MainActivity");//学习桌面
+ this.add("com.uiui.zyos.activity.main.MainActivity");//学习桌面
+ this.add("com.android.permissioncontroller.role.ui.DefaultAppActivity");//系统切换
+ this.add("com.cube.setlauncherdef.MainActivity");//系统切换
}};
private List appIconList = new ArrayList() {{
this.add("com_android_appstore");
@@ -271,6 +279,7 @@ public class IconCache extends BaseIconCache {
this.add("com_android_calendar");
this.add("com_android_camera");
this.add("com_android_camera");
+ this.add("com_android_camera");
this.add("com_android_contacts");
this.add("com_android_deskclock");
this.add("com_android_dialer");
@@ -278,6 +287,7 @@ public class IconCache extends BaseIconCache {
this.add("com_android_dialer");
this.add("com_android_gallery3d_app");
this.add("com_android_gallery3d_app");
+ this.add("com_android_gallery3d_app");
this.add("com_android_mms_ui");
this.add("com_android_music");
this.add("com_android_providers_downloads_ui");
@@ -287,11 +297,17 @@ public class IconCache extends BaseIconCache {
this.add("com_android_soundrecorder");
this.add("com_android_stk_stkmain");
this.add("com_android_vdieo");
+ this.add("com_android_vdieo");
+ this.add("com_mediatek_filemanager");
this.add("com_mediatek_filemanager");
this.add("com_mediatek_filemanager");
this.add("com_mediatek_fmradio");
this.add("com_mediatek_fmradio");//收音机
this.add("com_android_email");
+ this.add("com_uiui_aios");
+ this.add("com_uiui_zyos");
+ this.add("system_switch");
+ this.add("system_switch");
}};
public Drawable getFullResIcon(LauncherActivityInfo info) {
diff --git a/src/com/uiuipad/os/model/LoaderTask.java b/src/com/uiuipad/os/model/LoaderTask.java
index b2b0f75..824a789 100644
--- a/src/com/uiuipad/os/model/LoaderTask.java
+++ b/src/com/uiuipad/os/model/LoaderTask.java
@@ -268,46 +268,33 @@ public class LoaderTask implements Runnable {
* 系统应用只显示这几个
*/
public static HashSet showApp = new HashSet() {{
-// this.add(BuildConfig.APPLICATION_ID);
- //aoleyun
-// this.add("com.aoleyun.sn");
- this.add("com.aoleyun.appstore");
- this.add("com.aoleyun.postern");
- this.add("com.aoleyun.browser");
- this.add("com.aoleyun.info");
- this.add("com.aoleyun.file");
- this.add("com.aoleyun.reos");
- this.add("com.aoleyunos.dop1");
- this.add("com.aoleyunos.dop2");
- //system
+ this.add("com.uiuipad.find");
+ this.add("com.uiuipad.browser");
+ this.add("com.uiui.aios");
+ this.add("com.uiui.zyos");
+
this.add("com.android.dialer");
this.add("com.android.messaging");
this.add("com.android.contacts");
this.add("com.android.documentsui");
-// this.add("com.android.messaging");
this.add("com.android.music");
this.add("com.android.calendar");
this.add("com.android.gallery3d");
- this.add("com.mediatek.camera");
this.add("com.android.camera");
this.add("com.android.camera2");
this.add("com.android.calculator");
- this.add("com.android.calculator2");
this.add("com.android.settings");
this.add("com.android.stk");
- this.add("com.mediatek.camera");
- this.add("com.mediatek.filemanager");
- //uiui
- this.add("com.calculator.uiui");
- this.add("com.notepad.uiui");
- this.add("com.calendar.uiui");
- this.add("com.alarmclock.uiui");
- this.add("com.uiui.videoplayer");
- //aihua
- this.add("com.liuyang.jcstudentside");
- this.add("com.alibaba.android.rimet");
- this.add("com.tencent.wemeet.app");
- this.add("com.qi.studycomputer.launcher");
+
+ this.add("com.softwinner.camera");
+ this.add("com.google.android.apps.photos");
+ this.add("com.android.calculator2");
+ this.add("com.android.soundrecorder");
+ this.add("com.google.android.deskclock");
+ this.add("com.softwinner.videoplayer");
+ this.add("com.google.android.apps.nbu.files");
+ this.add("com.android.permissioncontroller");
+// this.add("");
}};
//add for load all app on workspace
@@ -331,26 +318,26 @@ public class LoaderTask implements Runnable {
)
continue;
/*系统应用*/
- if (JGYUtils.getInstance().getDeviceIsLocked() && aihuaUnlock != 1) {
- if ((app.getApplicationFlags() & ApplicationInfo.FLAG_SYSTEM) == 1) {
- if (!showApp.contains(app.getApplicationInfo().packageName)) {
- Log.e("verifyApplications", "skip1: " + app.getApplicationInfo().packageName);
- continue;
- }
- } else {
- if (TextUtils.isEmpty(whiteList)) {
- if (!showApp.contains(app.getApplicationInfo().packageName)) {
- Log.e("verifyApplications", "skip2: " + app.getApplicationInfo().packageName);
- continue;
- }
- } else if (!whiteList.contains(app.getApplicationInfo().packageName)) {
- if (!showApp.contains(app.getApplicationInfo().packageName)) {
- Log.e("verifyApplications", "skip3: " + app.getApplicationInfo().packageName);
- continue;
- }
- }
- }
- }
+// if (JGYUtils.getInstance().getDeviceIsLocked() && aihuaUnlock != 1) {
+// if ((app.getApplicationFlags() & ApplicationInfo.FLAG_SYSTEM) == 1) {
+// if (!showApp.contains(app.getApplicationInfo().packageName)) {
+// Log.e("verifyApplications", "skip1: " + app.getApplicationInfo().packageName);
+// continue;
+// }
+// } else {
+// if (TextUtils.isEmpty(whiteList)) {
+// if (!showApp.contains(app.getApplicationInfo().packageName)) {
+// Log.e("verifyApplications", "skip2: " + app.getApplicationInfo().packageName);
+// continue;
+// }
+// } else if (!whiteList.contains(app.getApplicationInfo().packageName)) {
+// if (!showApp.contains(app.getApplicationInfo().packageName)) {
+// Log.e("verifyApplications", "skip3: " + app.getApplicationInfo().packageName);
+// continue;
+// }
+// }
+// }
+// }
Log.e("verifyApplications", "AddApp: " + app.getApplicationInfo().packageName);
InstallShortcutReceiver.PendingInstallShortcutInfo pendingInstallShortcutInfo = new InstallShortcutReceiver.PendingInstallShortcutInfo(app, context);
added.add(pendingInstallShortcutInfo);
diff --git a/src/com/uiuipad/os/network/HTTPInterface.java b/src/com/uiuipad/os/network/HTTPInterface.java
deleted file mode 100644
index 8703530..0000000
--- a/src/com/uiuipad/os/network/HTTPInterface.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package com.uiuipad.os.network;
-
-import android.content.Context;
-import android.util.Log;
-
-import com.uiuipad.os.network.bean.AppPasswdBean;
-import com.uiuipad.os.network.bean.BaseResponse;
-import com.uiuipad.os.uiuiutils.APKUtils;
-import com.uiuipad.os.uiuiutils.TimeUtils;
-import com.google.gson.Gson;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import com.tencent.mmkv.MMKV;
-
-import java.util.List;
-
-import io.reactivex.Observer;
-import io.reactivex.disposables.Disposable;
-
-/**
- * @author : fanhuitong
- * e-mail :
- * @date : 2021/10/27 15:31
- * desc :
- * version: 1.0
- */
-public class HTTPInterface {
- private static final String TAG = HTTPInterface.class.getSimpleName();
-
- public static void getAppPasswd() {
- NetInterfaceManager.getInstance().getAppPasswordObservable()
- .subscribe(new Observer>>() {
- @Override
- public void onSubscribe(Disposable d) {
- Log.e("getAppPasswd", "onSubscribe: ");
- }
-
- @Override
- public void onNext(BaseResponse> listBaseResponse) {
- Log.e("getAppPasswd", "onNext: " + listBaseResponse);
- if (listBaseResponse.code == 200) {
- List beanList = listBaseResponse.data;
- String jsonString = JsonParser.parseString(new Gson().toJson(beanList)).getAsJsonArray().toString();
- MMKV.defaultMMKV().encode("ApplicationLock", jsonString);
- Log.e("getAppPasswd", "onNext: " + jsonString);
- } else {
- MMKV.defaultMMKV().encode("ApplicationLock", "");
- }
- }
-
- @Override
- public void onError(Throwable e) {
- Log.e("getAppPasswd", "onError: " + e.getMessage());
- }
-
- @Override
- public void onComplete() {
- Log.e("getAppPasswd", "onComplete: ");
- }
- });
- }
-
- /**
- * 发送正在运行的app信息
- *
- * @param context
- */
- public static void sendRunningApp(Context context) {
- String packageName = TimeUtils.getInstance().getAppPackageName();
- Log.e("SendRunningApp", "packageName: " + packageName);
- long time = TimeUtils.getInstance().getStartTime();
- JsonObject jsonObject = new JsonObject();
- jsonObject.addProperty("app_package", packageName);
- jsonObject.addProperty("version_name", APKUtils.getAPPVersionName(context, packageName));
- jsonObject.addProperty("run_time", time / 1000);
- jsonObject.addProperty("app_name", APKUtils.getAppNameByPackage(context, packageName));
- jsonObject.addProperty("status", 1);
- String jsonString = jsonObject.toString();
- NetInterfaceManager.getInstance().getRunningAppObservable(jsonString)
- .subscribe(new Observer() {
- @Override
- public void onSubscribe(Disposable d) {
- Log.e("SendRunningApp", "onSubscribe: ");
- }
-
- @Override
- public void onNext(BaseResponse baseResponse) {
- Log.e("SendRunningApp", "onNext: " + baseResponse);
- }
-
- @Override
- public void onError(Throwable e) {
- Log.e("SendRunningApp", "onError: " + e.getMessage());
- }
-
- @Override
- public void onComplete() {
- Log.e("SendRunningApp", "onComplete: ");
- }
- });
- }
-
-// private static void setTag(Context context, Set set) {
-// TagAliasOperatorHelper.TagAliasBean tagAliasBean = new TagAliasOperatorHelper.TagAliasBean();
-// tagAliasBean.action = ACTION_SET;
-// sequence++;
-// tagAliasBean.tags = set;
-// tagAliasBean.isAliasAction = false;
-// TagAliasOperatorHelper.getInstance().handleAction(context, sequence, tagAliasBean);
-// }
-
-}
diff --git a/src/com/uiuipad/os/network/NetInterfaceManager.java b/src/com/uiuipad/os/network/NetInterfaceManager.java
index 6f210ca..1052cfa 100644
--- a/src/com/uiuipad/os/network/NetInterfaceManager.java
+++ b/src/com/uiuipad/os/network/NetInterfaceManager.java
@@ -2,45 +2,27 @@ package com.uiuipad.os.network;
import android.annotation.SuppressLint;
import android.content.Context;
-import android.text.TextUtils;
-import android.util.Log;
-import com.alibaba.sdk.android.push.CloudPushService;
-import com.alibaba.sdk.android.push.CommonCallback;
-import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
-import com.uiuipad.os.disklrucache.CacheHelper;
-import com.uiuipad.os.manager.ConnectManager;
-import com.uiuipad.os.manager.ConnectMode;
-import com.uiuipad.os.network.api.AddAppLog;
-import com.uiuipad.os.network.api.AppUsageRecordApi;
-import com.uiuipad.os.network.api.CheckUpdate;
-import com.uiuipad.os.network.api.GetAppPassword;
-import com.uiuipad.os.network.api.GetPushTagsApi;
-import com.uiuipad.os.network.api.RunningApp;
-import com.uiuipad.os.network.api.SendScreenshotApi;
-import com.uiuipad.os.network.bean.AppPasswdBean;
-import com.uiuipad.os.network.bean.BaseResponse;
-import com.uiuipad.os.network.bean.Batch;
-import com.uiuipad.os.network.interceptor.RepeatRequestInterceptor;
-import com.uiuipad.os.uiuiutils.JGYUtils;
-import com.uiuipad.os.uiuiutils.Utils;
-import com.tencent.android.tpush.XGIOperateCallback;
-import com.tencent.android.tpush.XGPushManager;
import com.tencent.mmkv.MMKV;
+import com.uiuipad.os.disklrucache.CacheHelper;
+import com.uiuipad.os.network.api.CloudLessonAppApi;
+import com.uiuipad.os.network.api.CloudLessonSettingApi;
+import com.uiuipad.os.network.api.TimeManageAppApi;
+import com.uiuipad.os.network.api.TimeManageSnApi;
+import com.uiuipad.os.network.api.UploadAppUseLogApi;
+import com.uiuipad.os.network.bean.BaseResponse;
+import com.uiuipad.os.network.bean.TimeManageApp;
+import com.uiuipad.os.network.bean.TimeManageSn;
+import com.uiuipad.os.network.interceptor.RepeatRequestInterceptor;
+import com.uiuipad.os.uiuiutils.Utils;
import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
+import java.util.Map;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
-import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
-import io.reactivex.annotations.NonNull;
-import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import okhttp3.Cache;
import okhttp3.OkHttpClient;
@@ -112,162 +94,39 @@ public class NetInterfaceManager {
return sInstance;
}
-
- public Observable getRunningAppObservable(String json) {
- return mRetrofit.create(RunningApp.class)
- .sendRunningInfo(Utils.getSerial(mContext), json)
+ public Observable getCloudLessonSettingObservable() {
+ return mRetrofit.create(CloudLessonSettingApi.class)
+ .getCloudLessonSetting(Utils.getSerial(mContext))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
- public Observable>> getAppPasswordObservable() {
- return mRetrofit.create(GetAppPassword.class)
- .getAppPasswd(Utils.getSerial(mContext))
+ public Observable getCloudLessonAppObservable() {
+ return mRetrofit.create(CloudLessonAppApi.class)
+ .getCloudLessonApp(Utils.getSerial(mContext))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
- public SendScreenshotApi getScreenshotApi() {
- return mRetrofit.create(SendScreenshotApi.class);
- }
-
- public AddAppLog getapplogControl() {
- return mRetrofit.create(AddAppLog.class);
- }
-
- /**
- * 获取极光推送的tag
- *
- * @return
- */
- public Observable> getPushTagsObservable() {
- return mRetrofit.create(GetPushTagsApi.class)
- .getPushTags(Utils.getSerial(mContext))
+ public Observable getUploadAppUseLogObservable(Map params) {
+ return mRetrofit.create(UploadAppUseLogApi.class)
+ .uploadAppUseLog(params)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
-
- public AppUsageRecordApi getAppUsageRecordControl() {
- return mRetrofit.create(AppUsageRecordApi.class);
+ public Observable> getTimeManageSnObservable() {
+ return mRetrofit.create(TimeManageSnApi.class)
+ .getTimeManageSn(Utils.getSerial(mContext))
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread());
}
- public CheckUpdate getCheckUpdateObservable() {
- return mRetrofit.create(CheckUpdate.class);
+ public Observable>> getTimeManageAppObservable() {
+ return mRetrofit.create(TimeManageAppApi.class)
+ .getTimeManageSn(Utils.getSerial(mContext))
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread());
}
-
- public interface onCompleteCallback {
- void onComplete();
- }
-
- public void setPushTag(boolean refresh, onCompleteCallback callback) {
- ConnectMode connectMode = ConnectMode.TWO_DAY;
- if (refresh) {
- connectMode = ConnectMode.ONE_DAY;
- }
- if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_DEVICES_TAGS, connectMode)) {
- setPushTag(callback);
- } else {
- String jsonString = cacheHelper.getAsString(UrlAddress.GET_DEVICES_TAGS);
- //为 "" 是已经请求成功的
- if (jsonString == null) {
- setPushTag(callback);
- } else {
- Set tagSets = mMMKV.decodeStringSet(UrlAddress.GET_DEVICES_TAGS + "pushset");
- Log.e("setPushTags", "tagSets: " + tagSets);
- clearAndAppendTags(tagSets);
- callback.onComplete();
- }
- }
- }
-
- public void setPushTag(onCompleteCallback callback) {
- Set set = new HashSet();
- JGYUtils.getInstance().getAppPlatform(new JGYUtils.GetAppPlatformCallback() {
- @Override
- public void AppPlatform(int platform) {
- if (platform == JGYUtils.MTKPlatform) {
- set.add(JGYUtils.MTKTag);
- } else if (platform == JGYUtils.ZhanruiPlatform) {
- set.add(JGYUtils.ZhanruiTag);
- } else if (platform == JGYUtils.CubePlatform) {
- set.add(JGYUtils.CubeTag);
- } else if (platform == JGYUtils.MTK11Platform) {
- set.add(JGYUtils.MTK11Tag);
- } else if (platform == JGYUtils.TeclastP20sPlatform) {
- set.add(JGYUtils.TeclastP20sTag);
- } else if (platform == JGYUtils.AH6016Platform) {
- set.add(JGYUtils.AH6016Tag);
- }else if (platform == JGYUtils.ZR6016Platform) {
- set.add(JGYUtils.ZR6016Tag);
- }
- }
- });
- getPushTagsObservable()
- .subscribe(new Observer>() {
- @Override
- public void onSubscribe(@NonNull Disposable d) {
- Log.e("setPushTag", "onSubscribe: ");
- }
-
- @Override
- public void onNext(@NonNull BaseResponse response) {
- Log.e("setPushTag", "onNext: " + response);
- if (response.code == 200) {
- String batch = response.data.getBatch();
- cacheHelper.put(UrlAddress.GET_DEVICES_TAGS, batch);
- if (!TextUtils.isEmpty(batch)) {
- set.add(batch);
- } else {
- Log.e("setPushTag", "onNext: " + "batch empty");
- }
- } else {
- cacheHelper.put(UrlAddress.GET_DEVICES_TAGS, "");
- }
- }
-
- @Override
- public void onError(@NonNull Throwable e) {
- Log.e("setPushTag", "onError: " + e.getMessage());
- onComplete();
- }
-
- @Override
- public void onComplete() {
- Log.e("setPushTag", "onComplete: ");
- mMMKV.encode(UrlAddress.GET_DEVICES_TAGS + "pushset", set);
- clearAndAppendTags(set);
- callback.onComplete();
- }
- });
- }
-
- synchronized private void clearAndAppendTags(Set tagSets) {
- XGPushManager.clearAndAppendTags(mContext, "clearAndAppendTags :" + System.currentTimeMillis(), tagSets, new XGIOperateCallback() {
- @Override
- public void onSuccess(Object o, int i) {
- Log.e("clearAndAppendTags", "onSuccess: " + o);
- }
-
- @Override
- public void onFail(Object o, int i, String s) {
- Log.e("clearAndAppendTags", "onFail: " + o);
- }
- });
- String[] tag = new ArrayList<>(tagSets).toArray(new String[tagSets.size()]);
- CloudPushService pushService = PushServiceFactory.getCloudPushService();
- pushService.bindTag(CloudPushService.DEVICE_TARGET, tag, null, new CommonCallback() {
- @Override
- public void onSuccess(String s) {
- Log.e("bindTag", "bind tag " + Arrays.toString(tag) + " success\n");
- }
-
- @Override
- public void onFailed(String errorCode, String errorMsg) {
- Log.e("bindTag", "bind tag " + Arrays.toString(tag) + " failed." +
- "errorCode: " + errorCode + ", errorMsg:" + errorMsg + "\n");
- }
- });
- }
-}
\ No newline at end of file
+}
diff --git a/src/com/uiuipad/os/network/UrlAddress.java b/src/com/uiuipad/os/network/UrlAddress.java
index c479ad8..d75ea1f 100644
--- a/src/com/uiuipad/os/network/UrlAddress.java
+++ b/src/com/uiuipad/os/network/UrlAddress.java
@@ -1,22 +1,22 @@
package com.uiuipad.os.network;
public class UrlAddress {
- public static final String ROOT_URL = "https://led.aoleyun.cn/api/";
- public static final String APP_LOG = "app/addAppLog";
- //获取正在运行的app
- public static final String RUN_NEW_APP = "And/runNewApp";
- //更新
- public final static String GET_NEWESTAPPUPDATE = "Silent/silent";
- //是否有应用密码锁
- public final static String GET_APP_ISLOCKED = "And/isApplicationLock";
- //验证应用密码锁
- public final static String CHECK_APP_PASSWD = "And/checkApplicationLock";
- //获取所有应用密码
- public final static String GET_APP_PASSWD = "And/getApplicationLock";
- //获取设备标签
- public static final String GET_DEVICES_TAGS = "Sn/getSnTag";
- //发送app使用时长
- public static final String SEND_APP_RECORD = "And/appUsageRecord";
- //上传截图
- public static final String SEND_SCREENSHOT = "Screenshot/addImg";
-}
+ public static final String ROOT_URL = "https://kxapi.uiuios.com/android/";
+
+ /*上传应用使用记录*/
+ public static final String UPLOAD_APP_USE_LOG = "app/app/uploadAppUseLog";
+
+ /*获取专注模式设置*/
+ @Deprecated
+ public static final String GET_CLOUD_LESSON_SETTING = "equipment/manage/getCloudLessonSetting";
+ /*获取专注模式应用*/
+ @Deprecated
+ public static final String GET_CLOUD_LESSON_APP = "equipment/manage/getCloudLessonApp";
+ /*
+ * 时间管控
+ * */
+ /*获取整机时间管控*/
+ public static final String GET_TIME_MANAGE_SN = "equipment/timeManage/getTimeManageSn";
+ /*获取应用时间管控*/
+ public static final String GET_TIME_MANAGE_APP = "equipment/timeManage/getTimeManageApp";
+}
\ No newline at end of file
diff --git a/src/com/uiuipad/os/network/api/AddAppLog.java b/src/com/uiuipad/os/network/api/AddAppLog.java
deleted file mode 100644
index 3764765..0000000
--- a/src/com/uiuipad/os/network/api/AddAppLog.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.uiuipad.os.network.api;
-
-import com.uiuipad.os.network.bean.BaseResponse;
-import com.uiuipad.os.network.UrlAddress;
-
-import io.reactivex.Observable;
-import retrofit2.http.Field;
-import retrofit2.http.FormUrlEncoded;
-import retrofit2.http.POST;
-
-public interface AddAppLog {
- @FormUrlEncoded
- @POST(UrlAddress.APP_LOG)
- Observable addLog(
- @Field("sn") String sn,
- @Field("packageName") String packageName,
- @Field("versionCode") long versionCode,
- @Field("createTime") long createTime,
- @Field("type") long type
- );
-}
diff --git a/src/com/uiuipad/os/network/api/AppUsageRecordApi.java b/src/com/uiuipad/os/network/api/AppUsageRecordApi.java
deleted file mode 100644
index d65b4c0..0000000
--- a/src/com/uiuipad/os/network/api/AppUsageRecordApi.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.uiuipad.os.network.api;
-
-import com.uiuipad.os.network.bean.BaseResponse;
-import com.uiuipad.os.network.UrlAddress;
-
-
-import io.reactivex.Observable;
-import retrofit2.http.Field;
-import retrofit2.http.FormUrlEncoded;
-import retrofit2.http.POST;
-
-public interface AppUsageRecordApi {
- @FormUrlEncoded
- @POST(UrlAddress.SEND_APP_RECORD)
- Observable sendAppUsageRecord(
- @Field("sn") String sn,
- @Field("app_package") String app_package,
- @Field("app_name") String app_name,
- @Field("open_time") long open_time,
- @Field("close_time") long close_time
- );
-}
diff --git a/src/com/uiuipad/os/network/api/CheckUpdate.java b/src/com/uiuipad/os/network/api/CheckUpdate.java
deleted file mode 100644
index 3454e6e..0000000
--- a/src/com/uiuipad/os/network/api/CheckUpdate.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.uiuipad.os.network.api;
-
-import com.uiuipad.os.network.bean.BaseResponse;
-import com.uiuipad.os.network.bean.NewestAppUpdateResult;
-import com.uiuipad.os.network.UrlAddress;
-
-import io.reactivex.Observable;
-import retrofit2.http.Field;
-import retrofit2.http.FormUrlEncoded;
-import retrofit2.http.POST;
-
-public interface CheckUpdate {
- @FormUrlEncoded
- @POST(UrlAddress.GET_NEWESTAPPUPDATE)
- Observable> getCheckUpdate(
- @Field("package")String packageName,
- @Field("versionCode")int versionCode,
- @Field("type")int type
- );
-}
diff --git a/src/com/uiuipad/os/network/api/GetPushTagsApi.java b/src/com/uiuipad/os/network/api/CloudLessonAppApi.java
similarity index 61%
rename from src/com/uiuipad/os/network/api/GetPushTagsApi.java
rename to src/com/uiuipad/os/network/api/CloudLessonAppApi.java
index 1afc872..70553ba 100644
--- a/src/com/uiuipad/os/network/api/GetPushTagsApi.java
+++ b/src/com/uiuipad/os/network/api/CloudLessonAppApi.java
@@ -1,17 +1,15 @@
package com.uiuipad.os.network.api;
-
-import com.uiuipad.os.network.bean.BaseResponse;
import com.uiuipad.os.network.UrlAddress;
-import com.uiuipad.os.network.bean.Batch;
+import com.uiuipad.os.network.bean.BaseResponse;
import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;
-public interface GetPushTagsApi {
- @GET(UrlAddress.GET_DEVICES_TAGS)
- Observable> getPushTags(
+public interface CloudLessonAppApi {
+ @GET(UrlAddress.GET_CLOUD_LESSON_APP)
+ Observable getCloudLessonApp(
@Query("sn") String sn
);
}
diff --git a/src/com/uiuipad/os/network/api/CloudLessonSettingApi.java b/src/com/uiuipad/os/network/api/CloudLessonSettingApi.java
new file mode 100644
index 0000000..9b73dc8
--- /dev/null
+++ b/src/com/uiuipad/os/network/api/CloudLessonSettingApi.java
@@ -0,0 +1,15 @@
+package com.uiuipad.os.network.api;
+
+import com.uiuipad.os.network.UrlAddress;
+import com.uiuipad.os.network.bean.BaseResponse;
+
+import io.reactivex.Observable;
+import retrofit2.http.GET;
+import retrofit2.http.Query;
+
+public interface CloudLessonSettingApi {
+ @GET(UrlAddress.GET_CLOUD_LESSON_SETTING)
+ Observable getCloudLessonSetting(
+ @Query("sn") String sn
+ );
+}
diff --git a/src/com/uiuipad/os/network/api/SendScreenshotApi.java b/src/com/uiuipad/os/network/api/SendScreenshotApi.java
deleted file mode 100644
index 044b964..0000000
--- a/src/com/uiuipad/os/network/api/SendScreenshotApi.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.uiuipad.os.network.api;
-
-import com.uiuipad.os.network.bean.BaseResponse;
-import com.uiuipad.os.network.UrlAddress;
-
-import java.util.Map;
-
-import io.reactivex.Observable;
-import okhttp3.MultipartBody;
-import retrofit2.http.Multipart;
-import retrofit2.http.POST;
-import retrofit2.http.Part;
-import retrofit2.http.QueryMap;
-
-public interface SendScreenshotApi {
- @Multipart
- @POST(UrlAddress.SEND_SCREENSHOT)
- Observable sendScreenshot(
- @QueryMap Map params,
- @Part MultipartBody.Part body
- );
-}
diff --git a/src/com/uiuipad/os/network/api/GetAppPassword.java b/src/com/uiuipad/os/network/api/TimeManageAppApi.java
similarity index 50%
rename from src/com/uiuipad/os/network/api/GetAppPassword.java
rename to src/com/uiuipad/os/network/api/TimeManageAppApi.java
index b05e4cf..9861737 100644
--- a/src/com/uiuipad/os/network/api/GetAppPassword.java
+++ b/src/com/uiuipad/os/network/api/TimeManageAppApi.java
@@ -1,8 +1,8 @@
package com.uiuipad.os.network.api;
-import com.uiuipad.os.network.bean.AppPasswdBean;
-import com.uiuipad.os.network.bean.BaseResponse;
import com.uiuipad.os.network.UrlAddress;
+import com.uiuipad.os.network.bean.BaseResponse;
+import com.uiuipad.os.network.bean.TimeManageApp;
import java.util.List;
@@ -10,16 +10,9 @@ import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;
-/**
- * @author : fanhuitong
- * e-mail :
- * @date : 2021/10/22 18:06
- * desc :
- * version: 1.0
- */
-public interface GetAppPassword {
- @GET(UrlAddress.GET_APP_PASSWD)
- Observable>> getAppPasswd(
+public interface TimeManageAppApi {
+ @GET(UrlAddress.GET_TIME_MANAGE_APP)
+ Observable>> getTimeManageSn(
@Query("sn") String sn
);
}
diff --git a/src/com/uiuipad/os/network/api/TimeManageSnApi.java b/src/com/uiuipad/os/network/api/TimeManageSnApi.java
new file mode 100644
index 0000000..b727339
--- /dev/null
+++ b/src/com/uiuipad/os/network/api/TimeManageSnApi.java
@@ -0,0 +1,16 @@
+package com.uiuipad.os.network.api;
+
+import com.uiuipad.os.network.UrlAddress;
+import com.uiuipad.os.network.bean.BaseResponse;
+import com.uiuipad.os.network.bean.TimeManageSn;
+
+import io.reactivex.Observable;
+import retrofit2.http.GET;
+import retrofit2.http.Query;
+
+public interface TimeManageSnApi {
+ @GET(UrlAddress.GET_TIME_MANAGE_SN)
+ Observable> getTimeManageSn(
+ @Query("sn") String sn
+ );
+}
diff --git a/src/com/uiuipad/os/network/api/RunningApp.java b/src/com/uiuipad/os/network/api/UploadAppUseLogApi.java
similarity index 55%
rename from src/com/uiuipad/os/network/api/RunningApp.java
rename to src/com/uiuipad/os/network/api/UploadAppUseLogApi.java
index 0b5bec6..425fe4c 100644
--- a/src/com/uiuipad/os/network/api/RunningApp.java
+++ b/src/com/uiuipad/os/network/api/UploadAppUseLogApi.java
@@ -1,18 +1,20 @@
package com.uiuipad.os.network.api;
-import com.uiuipad.os.network.bean.BaseResponse;
import com.uiuipad.os.network.UrlAddress;
+import com.uiuipad.os.network.bean.BaseResponse;
+
+import java.util.Map;
import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
+import retrofit2.http.PartMap;
-public interface RunningApp {
+public interface UploadAppUseLogApi {
@FormUrlEncoded
- @POST(UrlAddress.RUN_NEW_APP)
- Observable sendRunningInfo(
- @Field("sn") String sn,
- @Field("app") String app
+ @POST(UrlAddress.UPLOAD_APP_USE_LOG)
+ Observable uploadAppUseLog(
+ @PartMap Map params
);
}
diff --git a/src/com/uiuipad/os/network/bean/TimeManageApp.java b/src/com/uiuipad/os/network/bean/TimeManageApp.java
new file mode 100644
index 0000000..a8077b6
--- /dev/null
+++ b/src/com/uiuipad/os/network/bean/TimeManageApp.java
@@ -0,0 +1,72 @@
+package com.uiuipad.os.network.bean;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class TimeManageApp implements Serializable {
+ private static final long serialVersionUID = 8994636991878020624L;
+
+ String app_package;
+ int class_id;
+ int use_type;
+ long work_time;
+ long rest_time;
+ long today_time;
+ List time_part;
+
+ public String getApp_package() {
+ return app_package;
+ }
+
+ public void setApp_package(String app_package) {
+ this.app_package = app_package;
+ }
+
+ public int getClass_id() {
+ return class_id;
+ }
+
+ public void setClass_id(int class_id) {
+ this.class_id = class_id;
+ }
+
+ public int getUse_type() {
+ return use_type;
+ }
+
+ public void setUse_type(int use_type) {
+ this.use_type = use_type;
+ }
+
+ public long getWork_time() {
+ return work_time;
+ }
+
+ public void setWork_time(long work_time) {
+ this.work_time = work_time;
+ }
+
+ public long getRest_time() {
+ return rest_time;
+ }
+
+ public void setRest_time(long rest_time) {
+ this.rest_time = rest_time;
+ }
+
+ public long getToday_time() {
+ return today_time;
+ }
+
+ public void setToday_time(long today_time) {
+ this.today_time = today_time;
+ }
+
+ public List getTime_part() {
+ return time_part;
+ }
+
+ public void setTime_part(List time_part) {
+ this.time_part = time_part;
+ }
+}
diff --git a/src/com/uiuipad/os/network/bean/TimeManagePart.java b/src/com/uiuipad/os/network/bean/TimeManagePart.java
new file mode 100644
index 0000000..720bc61
--- /dev/null
+++ b/src/com/uiuipad/os/network/bean/TimeManagePart.java
@@ -0,0 +1,35 @@
+package com.uiuipad.os.network.bean;
+
+import java.io.Serializable;
+
+public class TimeManagePart implements Serializable {
+ private static final long serialVersionUID = -3944199351838956883L;
+
+ String start_time;
+ String end_time;
+ int day_type;
+
+ public String getStart_time() {
+ return start_time;
+ }
+
+ public void setStart_time(String start_time) {
+ this.start_time = start_time;
+ }
+
+ public String getEnd_time() {
+ return end_time;
+ }
+
+ public void setEnd_time(String end_time) {
+ this.end_time = end_time;
+ }
+
+ public int getDay_type() {
+ return day_type;
+ }
+
+ public void setDay_type(int day_type) {
+ this.day_type = day_type;
+ }
+}
diff --git a/src/com/uiuipad/os/network/bean/TimeManageSn.java b/src/com/uiuipad/os/network/bean/TimeManageSn.java
new file mode 100644
index 0000000..c8ebc8e
--- /dev/null
+++ b/src/com/uiuipad/os/network/bean/TimeManageSn.java
@@ -0,0 +1,45 @@
+package com.uiuipad.os.network.bean;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class TimeManageSn implements Serializable {
+ private static final long serialVersionUID = 7571406354160374162L;
+
+ long work_time;
+ long rest_time;
+ long today_time;
+ List time_part;
+
+ public long getWork_time() {
+ return work_time;
+ }
+
+ public void setWork_time(long work_time) {
+ this.work_time = work_time;
+ }
+
+ public long getRest_time() {
+ return rest_time;
+ }
+
+ public void setRest_time(long rest_time) {
+ this.rest_time = rest_time;
+ }
+
+ public long getToday_time() {
+ return today_time;
+ }
+
+ public void setToday_time(long today_time) {
+ this.today_time = today_time;
+ }
+
+ public List getTime_part() {
+ return time_part;
+ }
+
+ public void setTime_part(List time_part) {
+ this.time_part = time_part;
+ }
+}
diff --git a/src/com/uiuipad/os/push/PushManager.java b/src/com/uiuipad/os/push/PushManager.java
index 8993204..6d6c688 100644
--- a/src/com/uiuipad/os/push/PushManager.java
+++ b/src/com/uiuipad/os/push/PushManager.java
@@ -3,8 +3,6 @@ package com.uiuipad.os.push;
import android.annotation.SuppressLint;
import android.content.Context;
-import com.uiuipad.os.network.HTTPInterface;
-
public class PushManager {
private static final String TAG = PushManager.class.getSimpleName();
@@ -38,7 +36,6 @@ public class PushManager {
public void setPushContent(String title, String extras) {
switch (title) {
case UPDATEPASSWD:
- HTTPInterface.getAppPasswd();
break;
default:
}
diff --git a/src/com/uiuipad/os/push/tpush/Constants.java b/src/com/uiuipad/os/push/tpush/Constants.java
deleted file mode 100644
index ecd3e87..0000000
--- a/src/com/uiuipad/os/push/tpush/Constants.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.uiuipad.os.push.tpush;
-
-/**
- * Created by chacewang on 2019/7/5.
- */
-
-public class Constants {
- public static final int TEST_LOCAL_NOTIFICATION = 1;
- public static final int TEST_NOTIFICATION = 2;
- public static final int TEST_SET_TAG = 3;
- public static final int TEST_DEL_TAG = 4;
- public static final int TEST_SET_ACCOUNT = 5;
- public static final int TEST_DEL_ACCOUNT = 6;
-
- public static final String LOCAL_NOTIFICATION_TITLE = "localtest";
- public static final String TEST_TAG_NAME = "DiagnosisTag";
-}
diff --git a/src/com/uiuipad/os/push/tpush/MessageReceiver.java b/src/com/uiuipad/os/push/tpush/MessageReceiver.java
deleted file mode 100644
index dae6176..0000000
--- a/src/com/uiuipad/os/push/tpush/MessageReceiver.java
+++ /dev/null
@@ -1,296 +0,0 @@
-package com.uiuipad.os.push.tpush;
-
-import android.content.Context;
-import android.content.Intent;
-import android.text.TextUtils;
-import android.util.Log;
-import android.widget.Toast;
-
-import com.uiuipad.os.push.PushManager;
-import com.uiuipad.os.push.tpush.common.NotificationService;
-import com.uiuipad.os.push.tpush.po.XGNotification;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import com.tencent.android.tpush.NotificationAction;
-import com.tencent.android.tpush.XGPushBaseReceiver;
-import com.tencent.android.tpush.XGPushClickedResult;
-import com.tencent.android.tpush.XGPushRegisterResult;
-import com.tencent.android.tpush.XGPushShowedResult;
-import com.tencent.android.tpush.XGPushTextMessage;
-
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-
-public class MessageReceiver extends XGPushBaseReceiver {
- private static final String TAG = MessageReceiver.class.getSimpleName();
-
- public static final String UPDATE_LISTVIEW_ACTION = "com.qq.xgdemo.activity.UPDATE_LISTVIEW";
- public static final String TEST_ACTION = "com.qq.xgdemo.activity.TEST_ACTION";
- public static final String LogTag = "xg.test";
-
- /**
- * 消息透传处理
- *
- * @param context
- * @param message 解析自定义的 JSON
- */
- @Override
- public void onTextMessage(Context context, XGPushTextMessage message) {
- String text = "收到消息:" + message.toString();
- // 获取自定义key-value
- String customContent = message.getCustomContent();
- if (customContent != null && customContent.length() != 0) {
- JsonObject obj = JsonParser.parseString(customContent).getAsJsonObject();
- // key1为前台配置的key
- if (!TextUtils.isEmpty(obj.get("key").getAsString())) {
- String value = obj.get("key").getAsString();
- Log.d(LogTag, "get custom value:" + value);
- }
- // ...
- }
- // APP自主处理消息的过程...
- Log.e(LogTag, text);
- show(context, text);
- processCustomMessage(context, message);
- }
-
- /**
- * 通知展示
- *
- * @param context
- * @param notifiShowedRlt 包含通知的内容
- */
- @Override
- public void onNotificationShowedResult(Context context, XGPushShowedResult notifiShowedRlt) {
- if (context == null || notifiShowedRlt == null) {
- return;
- }
- XGNotification notific = new XGNotification();
- notific.setMsg_id(notifiShowedRlt.getMsgId());
- notific.setTitle(notifiShowedRlt.getTitle());
- notific.setContent(notifiShowedRlt.getContent());
- // notificationActionType==1为Activity,2为url,3为intent
- notific.setNotificationActionType(notifiShowedRlt
- .getNotificationActionType());
- // Activity,url,intent都可以通过getActivity()获得
- notific.setActivity(notifiShowedRlt.getActivity());
- notific.setUpdate_time(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
- .format(Calendar.getInstance().getTime()));
- NotificationService.getInstance(context).save(notific);
-
- Intent testIntent = new Intent(TEST_ACTION);
- if (notifiShowedRlt.getTitle().equals(Constants.LOCAL_NOTIFICATION_TITLE)) {
- testIntent.putExtra("step", Constants.TEST_LOCAL_NOTIFICATION);
- } else {
- testIntent.putExtra("step", Constants.TEST_NOTIFICATION);
- }
- context.sendBroadcast(testIntent);
-
- Intent viewIntent = new Intent(UPDATE_LISTVIEW_ACTION);
- context.sendBroadcast(viewIntent);
- show(context, "您有1条新消息, " + "通知被展示 , " + notifiShowedRlt.toString());
- Log.d(LogTag, "您有1条新消息, " + "通知被展示 , " + notifiShowedRlt.toString() + ", PushChannel:" + notifiShowedRlt.getPushChannel());
- }
-
- /**
- * 注册回调
- *
- * @param context
- * @param errorCode 0 为成功,其它为错误码
- */
- @Override
- public void onRegisterResult(Context context, int errorCode, XGPushRegisterResult message) {
- if (context == null || message == null) {
- return;
- }
- String text = "";
- if (errorCode == XGPushBaseReceiver.SUCCESS) {
- // 在这里拿token
- String token = message.getToken();
- text = "注册成功1. token:" + token;
- } else {
- text = message + "注册失败,错误码:" + errorCode;
- }
- Log.d(LogTag, text);
- show(context, text);
- }
-
- /**
- * 反注册回调
- *
- * @param context
- * @param errorCode 0 为成功,其它为错误码
- */
- @Override
- public void onUnregisterResult(Context context, int errorCode) {
- if (context == null) {
- return;
- }
- String text = "";
- if (errorCode == XGPushBaseReceiver.SUCCESS) {
- text = "反注册成功";
- } else {
- text = "反注册失败" + errorCode;
- }
- Log.d(LogTag, text);
- show(context, text);
-
- }
-
- /**
- * 设置标签回调
- *
- * @param context
- * @param errorCode 0 为成功,其它为错误码
- * @param tagName 设置的 TAG
- */
- @Override
- public void onSetTagResult(Context context, int errorCode, String tagName) {
- if (context == null) {
- return;
- }
- String text = "";
- if (errorCode == XGPushBaseReceiver.SUCCESS) {
- text = "\"" + tagName + "\"设置成功";
- } else {
- text = "\"" + tagName + "\"设置失败,错误码:" + errorCode;
- }
- Log.d(LogTag, text);
- show(context, text);
-
- Intent testIntent = new Intent(TEST_ACTION);
- testIntent.putExtra("step", Constants.TEST_SET_TAG);
- context.sendBroadcast(testIntent);
- }
-
- /**
- * 删除标签的回调
- *
- * @param context
- * @param errorCode 0 为成功,其它为错误码
- * @param tagName 设置的 TAG
- */
- @Override
- public void onDeleteTagResult(Context context, int errorCode, String tagName) {
- if (context == null) {
- return;
- }
- String text = "";
- if (errorCode == XGPushBaseReceiver.SUCCESS) {
- text = "\"" + tagName + "\"删除成功";
- } else {
- text = "\"" + tagName + "\"删除失败,错误码:" + errorCode;
- }
- Log.d(LogTag, text);
- show(context, text);
-
- Intent testIntent = new Intent(TEST_ACTION);
- testIntent.putExtra("step", Constants.TEST_DEL_TAG);
- context.sendBroadcast(testIntent);
- }
-
- /**
- * 设置账号回调
- *
- * @param context
- * @param errorCode 0 为成功,其它为错误码
- * @param account 设置的账号
- */
- @Override
- public void onSetAccountResult(Context context, int errorCode, String account) {
- Intent testIntent = new Intent(TEST_ACTION);
- testIntent.putExtra("step", Constants.TEST_SET_ACCOUNT);
- context.sendBroadcast(testIntent);
- }
-
-
- /**
- * 删除账号回调
- *
- * @param context
- * @param errorCode 0 为成功,其它为错误码
- * @param account 设置的账号
- */
- @Override
- public void onDeleteAccountResult(Context context, int errorCode, String account) {
- Intent testIntent = new Intent(TEST_ACTION);
- testIntent.putExtra("step", Constants.TEST_DEL_ACCOUNT);
- context.sendBroadcast(testIntent);
- }
-
- @Override
- public void onSetAttributeResult(Context context, int i, String s) {
-
- }
-
- @Override
- public void onDeleteAttributeResult(Context context, int i, String s) {
-
- }
-
- @Override
- public void onQueryTagsResult(Context context, int errorCode, String data, String operateName) {
- Log.i(LogTag, "action - onQueryTagsResult, errorCode:" + errorCode + ", operateName:" + operateName + ", data: " + data);
- }
-
- /**
- * 通知点击回调 actionType=1为该消息被清除,actionType=0为该消息被点击
- *
- * @param context
- * @param message 包含被点击通知的内容
- */
- @Override
- public void onNotificationClickedResult(Context context, XGPushClickedResult message) {
- if (context == null || message == null) {
- return;
- }
- String text = "";
- if (message.getActionType() == NotificationAction.clicked.getType()) {
- // 通知在通知栏被点击啦。。。。。
- // APP自己处理点击的相关动作
- // 这个动作可以在activity的onResume也能监听,请看第3点相关内容
- text = "通知被打开 :" + message;
- } else if (message.getActionType() == NotificationAction.delete.getType()) {
- // 通知被清除啦。。。。
- // APP自己处理通知被清除后的相关动作
- text = "通知被清除 :" + message;
- }
- Toast.makeText(context, "广播接收到通知被点击:" + message.toString(),
- Toast.LENGTH_SHORT).show();
- // 获取自定义key-value
- String customContent = message.getCustomContent();
- if (customContent != null && customContent.length() != 0) {
- JsonObject obj = JsonParser.parseString(customContent).getAsJsonObject();
- // key1为前台配置的key
- if (!TextUtils.isEmpty(obj.get("key").getAsString())) {
- String value = obj.get("key").getAsString();
- Log.d(LogTag, "get custom value:" + value);
- }
- // ...
- }
- // APP自主处理的过程。。。
- Log.d(LogTag, text);
- show(context, text);
- }
-
- private void show(Context context, String text) {
-// Toast.makeText(context, text, Toast.LENGTH_SHORT).show();
- }
-
- private void processCustomMessage(Context context, XGPushTextMessage message) {
- if (context == null || message == null) {
- return;
- }
-
- String title = message.getTitle();
- String content = message.getContent();
- JsonObject extrasJson = JsonParser.parseString(content).getAsJsonObject();
-
- String extras = "";
- if (extrasJson.get("extras") != null) {
- extras = extrasJson.get("extras").toString();
- }
- PushManager.getInstance().setPushContent(title, extras);
- }
-
-}
diff --git a/src/com/uiuipad/os/push/tpush/common/DBOpenHelper.java b/src/com/uiuipad/os/push/tpush/common/DBOpenHelper.java
deleted file mode 100644
index 1aa61ab..0000000
--- a/src/com/uiuipad/os/push/tpush/common/DBOpenHelper.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.uiuipad.os.push.tpush.common;
-
-import android.content.Context;
-import android.database.sqlite.SQLiteDatabase;
-import android.database.sqlite.SQLiteOpenHelper;
-
-public class DBOpenHelper extends SQLiteOpenHelper {
-
- public DBOpenHelper(Context context) {
- super(context, "XGExample.db", null, 1);
- }
-
- @Override
- public void onCreate(SQLiteDatabase db) {
- db.execSQL("CREATE TABLE notification (id integer primary key autoincrement,msg_id varchar(64),title varchar(128),activity varchar(256),notificationActionType varchar(512),content text,update_time varchar(16))");
- }
-
- @Override
- public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
-
- }
-
-}
diff --git a/src/com/uiuipad/os/push/tpush/common/NotificationService.java b/src/com/uiuipad/os/push/tpush/common/NotificationService.java
deleted file mode 100644
index afe1404..0000000
--- a/src/com/uiuipad/os/push/tpush/common/NotificationService.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package com.uiuipad.os.push.tpush.common;
-
-import android.content.ContentValues;
-import android.content.Context;
-import android.database.Cursor;
-import android.database.sqlite.SQLiteDatabase;
-
-
-import com.uiuipad.os.push.tpush.po.XGNotification;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class NotificationService {
- private DBOpenHelper dbOpenHelper;
- private static NotificationService instance = null;
-
- public NotificationService(Context context) {
- this.dbOpenHelper = new DBOpenHelper(context);
- }
-
- public synchronized static NotificationService getInstance(Context ctx) {
- if (null == instance) {
- instance = new NotificationService(ctx);
- }
- return instance;
- }
-
- public void save(XGNotification notification) {
- SQLiteDatabase db = dbOpenHelper.getWritableDatabase();
- ContentValues values = new ContentValues();
- values.put("msg_id", notification.getMsg_id());
- values.put("title", notification.getTitle());
- values.put("content", notification.getContent());
- values.put("activity", notification.getActivity());
- values.put("notificationActionType", notification.getNotificationActionType());
- values.put("update_time", notification.getUpdate_time());
- db.insert("notification", null, values);
- }
-
- public void delete(Integer id) {
- SQLiteDatabase db = dbOpenHelper.getWritableDatabase();
- db.delete("notification", "id=?", new String[] { id.toString() });
- }
-
- public void deleteAll() {
- SQLiteDatabase db = dbOpenHelper.getWritableDatabase();
- db.delete("notification", "", null);
- }
-
- public void update(XGNotification notification) {
- SQLiteDatabase db = dbOpenHelper.getWritableDatabase();
- ContentValues values = new ContentValues();
- values.put("msg_id", notification.getMsg_id());
- values.put("title", notification.getTitle());
- values.put("content", notification.getContent());
- values.put("activity", notification.getActivity());
- values.put("notificationActionType", notification.getNotificationActionType());
- values.put("update_time", notification.getUpdate_time());
- db.update("notification", values, "id=?", new String[] { notification
- .getId().toString() });
- }
-
- public XGNotification find(Integer id) {
- SQLiteDatabase db = dbOpenHelper.getReadableDatabase();
- Cursor cursor = db
- .query("notification",
- new String[] { "id,msg_id,title,content,activity,notificationActionType,update_time" },
- "id=?", new String[] { id.toString() }, null, null,
- null, "1");
- try {
- if (cursor.moveToFirst()) {
- return new XGNotification(cursor.getInt(cursor
- .getColumnIndex("id")), cursor.getLong(cursor
- .getColumnIndex("msg_id")), cursor.getString(cursor
- .getColumnIndex("title")), cursor.getString(cursor
- .getColumnIndex("content")), cursor.getString(cursor
- .getColumnIndex("activity")), cursor.getInt(cursor
- .getColumnIndex("notificationActionType")), cursor.getString(cursor
- .getColumnIndex("update_time")));
- }
- return null;
- } finally {
- cursor.close();
- }
- }
-
- public List getScrollData(int currentPage, int lineSize,
- String msg_id) {
- String firstResult = String.valueOf((currentPage - 1) * lineSize);
- SQLiteDatabase db = dbOpenHelper.getReadableDatabase();
- Cursor cursor = null;
- try {
- if (msg_id == null || "".equals(msg_id)) {
- cursor = db
- .query("notification",
- new String[] { "id,msg_id,title,content,activity,notificationActionType,update_time" },
- null, null, null, null, "update_time DESC",
- firstResult + "," + lineSize);
- } else {
- cursor = db
- .query("notification",
- new String[] { "id,msg_id,title,content,activity,notificationActionType,update_time" },
- "msg_id like ?", new String[] { msg_id + "%" },
- null, null, "update_time DESC", firstResult
- + "," + lineSize);
- }
- List notifications = new ArrayList();
- while (cursor.moveToNext()) {
- notifications.add(new XGNotification(cursor.getInt(cursor
- .getColumnIndex("id")), cursor.getLong(cursor
- .getColumnIndex("msg_id")), cursor.getString(cursor
- .getColumnIndex("title")), cursor.getString(cursor
- .getColumnIndex("content")), cursor.getString(cursor
- .getColumnIndex("activity")), cursor.getInt(cursor
- .getColumnIndex("notificationActionType")), cursor.getString(cursor
- .getColumnIndex("update_time"))));
- }
- return notifications;
- } finally {
- cursor.close();
- }
- }
-
- public int getCount() {
- SQLiteDatabase db = dbOpenHelper.getReadableDatabase();
- Cursor cursor = db.rawQuery("select count(*) from notification", null);
- try {
- cursor.moveToFirst();
- return cursor.getInt(0);
- } finally {
- cursor.close();
- }
- }
-}
diff --git a/src/com/uiuipad/os/push/tpush/po/XGNotification.java b/src/com/uiuipad/os/push/tpush/po/XGNotification.java
deleted file mode 100644
index 28468d8..0000000
--- a/src/com/uiuipad/os/push/tpush/po/XGNotification.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.uiuipad.os.push.tpush.po;
-
-public class XGNotification {
- private Integer id;
- private Long msg_id;
- private String title;
- private String content;
- private String activity;
- private int notificationActionType;
- private String update_time;
-
- public XGNotification() {
-
- }
-
- public XGNotification(Integer id, Long msg_id, String title,
- String content, String activity, int notificationActionType, String update_time) {
- super();
- this.id = id;
- this.msg_id = msg_id;
- this.title = title;
- this.content = content;
- this.activity = activity;
- this.notificationActionType = notificationActionType;
- this.update_time = update_time;
- }
-
- public Integer getId() {
- return id;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- public Long getMsg_id() {
- return msg_id;
- }
-
- public void setMsg_id(Long msg_id) {
- this.msg_id = msg_id;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public String getContent() {
- return content;
- }
-
- public void setContent(String content) {
- this.content = content;
- }
-
- public String getUpdate_time() {
- return update_time;
- }
-
- public void setUpdate_time(String update_time) {
- this.update_time = update_time;
- }
-
- public String getActivity() {
- return activity;
- }
-
- public void setActivity(String activity) {
- this.activity = activity;
- }
-
- public int getNotificationActionType() {
- return notificationActionType;
- }
-
- public void setNotificationActionType(int notificationActionType) {
- this.notificationActionType = notificationActionType;
- }
-}
diff --git a/src/com/uiuipad/os/service/MainService.java b/src/com/uiuipad/os/service/MainService.java
index 179f910..c0d7ee6 100644
--- a/src/com/uiuipad/os/service/MainService.java
+++ b/src/com/uiuipad/os/service/MainService.java
@@ -93,125 +93,6 @@ public class MainService extends Service {
}
}
- private final static long ONE_HOURS_TIME = 60 * 60 * 1000;
- private final static long TEN_MINUTES_TIME = 60 * 10 * 1000;
-
- private void isScreenshot() {
- //1、检测应用使用情况,如果设备长时间运行一个应用,超过1小时,启动截屏一次。
- //2、检测设备在非正常时间使用时,使用第三方应用,在运行10分钟后,启动截屏功能一次
- //屏幕未点亮时不用截图
- // TODO: 2021/12/20 计算当前app打开时间
- String topPackageName = ForegroundAppUtil.getForegroundPackageName(MainService.this);
- Log.e(TAG, "isScreenshot: " + topPackageName);
- String pkg = TimeUtils.getInstance().getAppPackageName();
- if (TextUtils.isEmpty(pkg) || BuildConfig.APPLICATION_ID.equals(pkg)) {
- return;
- }
-
- PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
- //true为打开,false为关闭
- boolean screenOn = powerManager.isInteractive();
- Log.e(TAG, "isScreenshot: screenOn = " + screenOn);
- if (!screenOn) return;
-
- long startTime = TimeUtils.getInstance().getStartTime();
- if (TimeUtils.getInstance().isNormalTime()) {//正常时间段
- if (System.currentTimeMillis() - startTime >= ONE_HOURS_TIME) {
- Log.e(TAG, "isScreenshot: " + "截图");
- doscreenshot(System.currentTimeMillis() / 1000);
- }
- } else {//非正常时间段
- if (System.currentTimeMillis() - startTime >= TEN_MINUTES_TIME) {
- Log.e(TAG, "isScreenshot: " + "截图");
- doscreenshot(System.currentTimeMillis() / 1000);
- }
- }
- }
-
- public void doscreenshot(final long time) {
- Observable.create(new ObservableOnSubscribe() {
- @Override
- public void subscribe(ObservableEmitter e) throws Exception {
- String filepath = getExternalFilesDir("db").getAbsolutePath();
- int n = CmdUtil.execute("screencap -p " + filepath + File.separator + time + ".db").code;
- e.onNext(n);
- }
- }).subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(new Observer() {
- @Override
- public void onSubscribe(Disposable d) {
-
- }
-
- @Override
- public void onNext(Integer integer) {
- if (integer == 0) {
- uplaodImage(time);
- } else {
- Log.e("doss", "失败");
- }
- }
-
- @Override
- public void onError(Throwable e) {
- Log.e("doss", "Throwable=" + e.getMessage());
- }
-
- @Override
- public void onComplete() {
-
- }
- });
- }
-
- private void uplaodImage(long time) {
- String filepath = getExternalFilesDir("db").getAbsolutePath();
-// String filepath = mContext.getFileStreamPath("screenshot").getAbsolutePath();
- //放在app内部data下面
- File file = new File(filepath + File.separator + time + ".db");
- //不要直接使用常用图片格式
- if (!file.exists()) {
- Log.e("uplaodImage", "File does not exists");
- return;
- }
- //设置图片格式
-// RequestBody requestFile = RequestBody.create(MediaType.parse("image/jpg"), file);
- //File转RequestBody
- MediaType mediaType = MediaType.Companion.parse("image/png");
- RequestBody fileBody = RequestBody.Companion.create(file, mediaType);
- //设置一个file文件
- MultipartBody.Part body = MultipartBody.Part.createFormData("file", file.getName(), fileBody);
- Map params = new HashMap<>();
- params.put("sn", Utils.getSerial(MainService.this));
- params.put("createtime", String.valueOf(time));
- NetInterfaceManager.getInstance().getScreenshotApi()
- .sendScreenshot(params, body)
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(new Observer() {
- @Override
- public void onSubscribe(Disposable d) {
- Log.e("uplaodImage", "onSubscribe: ");
- }
-
- @Override
- public void onNext(BaseResponse baseResponse) {
- Log.e("uplaodImage", "onNext: " + baseResponse.msg);
- }
-
- @Override
- public void onError(Throwable e) {
- Log.e("uplaodImage", "onError: " + e.getMessage());
- }
-
- @Override
- public void onComplete() {
- Log.e("uplaodImage", "onComplete: ");
- }
- });
- }
-
@Override
public void onDestroy() {
super.onDestroy();
diff --git a/src/com/uiuipad/os/touch/WorkspaceTouchListener.java b/src/com/uiuipad/os/touch/WorkspaceTouchListener.java
index 29def6e..741164d 100644
--- a/src/com/uiuipad/os/touch/WorkspaceTouchListener.java
+++ b/src/com/uiuipad/os/touch/WorkspaceTouchListener.java
@@ -40,6 +40,7 @@ import com.uiuipad.os.Workspace;
import com.uiuipad.os.dragndrop.DragLayer;
import com.uiuipad.os.userevent.nano.LauncherLogProto.Action;
import com.uiuipad.os.userevent.nano.LauncherLogProto.ContainerType;
+import com.uiuipad.os.views.OptionsPopupView;
/**
* Helper class to handle touch on empty space in workspace and show options popup on long press
@@ -174,7 +175,7 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe
mLauncher.getUserEventDispatcher().logActionOnContainer(Action.Touch.LONGPRESS,
Action.Direction.NONE, ContainerType.WORKSPACE,
mWorkspace.getCurrentPage());
-// OptionsPopupView.showDefaultOptions(mLauncher, mTouchDownPoint.x, mTouchDownPoint.y);
+ OptionsPopupView.showDefaultOptions(mLauncher, mTouchDownPoint.x, mTouchDownPoint.y);
} else {
cancelLongPress();
}
diff --git a/src/doc/G10PMTK11.jks b/src/doc/G10PMTK11.jks
deleted file mode 100644
index 324fa31..0000000
Binary files a/src/doc/G10PMTK11.jks and /dev/null differ
diff --git a/src/doc/MTKP20S.keystore b/src/doc/MTKP20S.keystore
deleted file mode 100644
index 1156f88..0000000
Binary files a/src/doc/MTKP20S.keystore and /dev/null differ
diff --git a/src/doc/xueshibaoos.jks b/src/doc/xueshibaoos.jks
deleted file mode 100644
index b94a626..0000000
Binary files a/src/doc/xueshibaoos.jks and /dev/null differ
diff --git a/src/doc/zhanrui12.jks b/src/doc/zhanrui12.jks
deleted file mode 100644
index 584d145..0000000
Binary files a/src/doc/zhanrui12.jks and /dev/null differ
diff --git a/src/doc/zhanruiG10Z.keystore b/src/doc/zhanruiG10Z.keystore
deleted file mode 100644
index fb9b0bb..0000000
Binary files a/src/doc/zhanruiG10Z.keystore and /dev/null differ
diff --git a/src/doc/zhanxun.keystore b/src/doc/zhanxun.keystore
deleted file mode 100644
index 7c46fbc..0000000
Binary files a/src/doc/zhanxun.keystore and /dev/null differ
diff --git a/src/doc/zhanxunUserdebug.keystore b/src/doc/zhanxunUserdebug.keystore
deleted file mode 100644
index 6d8f9ee..0000000
Binary files a/src/doc/zhanxunUserdebug.keystore and /dev/null differ