version:3.0.7_beta

update:2020.07.07
fix:会卸载自带的可以卸载的应用,显示系统隐藏的应用,
add:手动检查更新按钮
This commit is contained in:
2020-07-07 11:05:47 +08:00
parent 32ea55c8e7
commit 3f400f763d
16 changed files with 630 additions and 571 deletions

View File

@@ -105,6 +105,7 @@
<action android:name="android.intent.action.BATTERY_OKAY" />
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
<action android:name="android.intent.action.DATE_CHANGED" />
<action android:name="android.intent.action.LOCALE_CHANGED" />
<action android:name="android.intent.action.TIME_TICK" />
<action android:name="android.intent.action.USER_PRESENT" />
<action android:name="android.intent.action.SCREEN_ON" />

View File

@@ -329,8 +329,8 @@ public class MyApplication extends MultiDexApplication {
}
public static void setJpushTags() {
Log.e("jiguangInterface", "30s后重新设置tags");
Observable.timer(30000, TimeUnit.MILLISECONDS)
Log.e("jiguangInterface", "10s后重新设置tags");
Observable.timer(10000, TimeUnit.MILLISECONDS)
.observeOn(rx.android.schedulers.AndroidSchedulers.mainThread())
.subscribe(new Action1<Long>() {
@Override
@@ -394,8 +394,8 @@ public class MyApplication extends MultiDexApplication {
}
public static void setJpushAlias() {
Log.e("jiguangInterface", "30s后重新设置alias");
Observable.timer(30000, TimeUnit.MILLISECONDS)
Log.e("jiguangInterface", "10s后重新设置alias");
Observable.timer(10000, TimeUnit.MILLISECONDS)
.observeOn(rx.android.schedulers.AndroidSchedulers.mainThread())
.subscribe(new Action1<Long>() {
@Override

View File

@@ -1,18 +1,16 @@
package com.mjsheng.myappstore.activity;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.BatteryManager;
import android.os.Build;
import android.os.Bundle;
@@ -25,13 +23,14 @@ import android.os.SystemClock;
import android.provider.Settings;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.AppCompatActivity;
import android.text.Layout;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.alibaba.fastjson.JSON;
import com.arialyy.aria.core.Aria;
@@ -45,19 +44,16 @@ import com.hjq.permissions.OnPermission;
import com.hjq.permissions.Permission;
import com.hjq.permissions.XXPermissions;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheMode;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okserver.download.DownloadManager;
import com.lzy.okserver.download.DownloadService;
import com.mjsheng.myappstore.BuildConfig;
import com.mjsheng.myappstore.MyApplication;
import com.mjsheng.myappstore.R;
import com.mjsheng.myappstore.bean.AppDateInfo;
import com.mjsheng.myappstore.bean.CommonPicBean;
import com.mjsheng.myappstore.bean.CommonPicData;
import com.mjsheng.myappstore.bean.ForceDownloadBean;
import com.mjsheng.myappstore.bean.ForceDownloadData;
import com.mjsheng.myappstore.bean.JsonCallback;
import com.mjsheng.myappstore.bean.LzyResponse;
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
import com.mjsheng.myappstore.bean.NetAndLaunchData;
@@ -76,7 +72,6 @@ import com.mjsheng.myappstore.network.api.ForceDownloadApi;
import com.mjsheng.myappstore.network.api.NetAndLaunchApi;
import com.mjsheng.myappstore.network.api.SystemSettingApi;
import com.mjsheng.myappstore.network.api.UploadAppInfoApi;
import com.mjsheng.myappstore.server.InitJpushServer;
import com.mjsheng.myappstore.server.MyDownloadService;
import com.mjsheng.myappstore.utils.ApkUtils;
import com.mjsheng.myappstore.utils.Configure;
@@ -90,7 +85,6 @@ import com.mjsheng.myappstore.utils.update.AllDialogShowStrategy;
import com.mjsheng.myappstore.utils.update.NotificationDownloadCreator;
import com.mjsheng.myappstore.utils.update.OkhttpCheckWorker;
import com.mjsheng.myappstore.utils.update.ToastCallback;
import com.mjsheng.myappstore.utils.update.ToastTool;
import org.json.JSONObject;
import org.lzh.framework.updatepluginlib.UpdateBuilder;
@@ -98,17 +92,11 @@ import org.lzh.framework.updatepluginlib.UpdateBuilder;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import cn.jpush.android.api.CustomMessage;
import cn.jpush.android.api.JPushInterface;
import cn.jpush.android.api.JPushMessage;
import cn.jpush.android.api.TagAliasCallback;
import cn.jpush.android.service.JPushMessageReceiver;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
@@ -119,11 +107,6 @@ import okhttp3.ResponseBody;
import rx.Observable;
import rx.functions.Action1;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_ADD;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_CHECK;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_CLEAN;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_DELETE;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_GET;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_SET;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.TagAliasBean;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
@@ -138,7 +121,8 @@ public class MainActivity extends AppCompatActivity {
private DownloadManager downloadManager;
private ImageView imageView;
private TextView tv_devsn, tv_devmac, tv_version;
private TextView tv_class, tv_number, tv_name;
private TextView tv_batch, tv_class, tv_number, tv_name;
private Button bt_checkupdate;
private int DeviceInfo;
private RelativeLayout checkupdate;
private ImageView back;
@@ -181,89 +165,13 @@ public class MainActivity extends AppCompatActivity {
}
public void onTagAliasAction(int i) {
Set<String> tags = null;
String alias = null;
int action = -1;
boolean isAliasAction = false;
switch (i) {
//设置手机号码:
case 0:
// handleSetMobileNumber();
return;
//增加tag
case 1:
// tags = getInPutTags();
if (tags == null) {
return;
}
action = ACTION_ADD;
break;
//设置tag
case 2:
// tags = getInPutTags();
if (tags == null) {
return;
}
action = ACTION_SET;
break;
//删除tag
case 3:
// tags = getInPutTags();
if (tags == null) {
return;
}
action = ACTION_DELETE;
break;
//获取所有tag
case 4:
action = ACTION_GET;
break;
//清除所有tag
case 5:
action = ACTION_CLEAN;
break;
case 6:
// tags = getInPutTags();
if (tags == null) {
return;
}
action = ACTION_CHECK;
break;
//设置alias
case 7:
// alias = getInPutAlias();
alias = Utils.getSerial();
if (TextUtils.isEmpty(alias)) {
return;
}
isAliasAction = true;
action = ACTION_SET;
break;
//获取alias
case 8:
isAliasAction = true;
action = ACTION_GET;
break;
//删除alias
case 9:
isAliasAction = true;
action = ACTION_DELETE;
break;
default:
return;
}
public void setAlias() {
TagAliasBean tagAliasBean = new TagAliasBean();
tagAliasBean.action = action;
tagAliasBean.action = ACTION_SET;
sequence++;
if (isAliasAction) {
tagAliasBean.alias = alias;
} else {
tagAliasBean.tags = tags;
}
tagAliasBean.isAliasAction = isAliasAction;
tagAliasBean.alias = Utils.getSerial();
tagAliasBean.isAliasAction = true;
TagAliasOperatorHelper.getInstance().handleAction(getApplicationContext(), sequence, tagAliasBean);
}
@Override
@@ -346,8 +254,12 @@ public class MainActivity extends AppCompatActivity {
.execute(new StringCallback() {
@Override
public void onSuccess(String s, Call call, Response response) {
com.alibaba.fastjson.JSONObject msgObject = JSON.parseObject(s);
Log.e("fht", "sendMACaddress onSuccess" + s);
try {
com.alibaba.fastjson.JSONObject msgObject = JSON.parseObject(s);
Log.e("fht", "sendMACaddress onSuccess" + s);
} catch (Exception e) {
Log.e("fht", "sendMACaddress Exception" + e);
}
}
@Override
@@ -367,16 +279,22 @@ public class MainActivity extends AppCompatActivity {
checkupdate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
continuousClick(COUNTS, DURATION);
// continuousClick(COUNTS, DURATION);
}
});
imageView = findViewById(R.id.imageView);
tv_devsn = findViewById(R.id.tv_devsn);
tv_devsn.setText(Utils.getSerial());
tv_devmac = findViewById(R.id.tv_devmac);
tv_devmac.setText(com.blankj.utilcode.util.DeviceUtils.getMacAddress());
String macaddr = com.blankj.utilcode.util.DeviceUtils.getMacAddress();
if (macaddr.equals("")) {
tv_devmac.setText("获取失败");
} else {
tv_devmac.setText(macaddr);
}
tv_version = findViewById(R.id.version);
tv_version.setText(BuildConfig.VERSION_NAME);
tv_batch = findViewById(R.id.tv_batch);
tv_class = findViewById(R.id.tv_class);
tv_number = findViewById(R.id.tv_number);
tv_name = findViewById(R.id.tv_name);
@@ -391,6 +309,15 @@ public class MainActivity extends AppCompatActivity {
layout_class = findViewById(R.id.layout_class);
layout_number = findViewById(R.id.layout_number);
layout_name = findViewById(R.id.layout_name);
bt_checkupdate = findViewById(R.id.chkupd);
bt_checkupdate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ToastUtil.show("正在检查更新");
HTTPInterface.checkUpdate(mHandler, BuildConfig.APPLICATION_ID);
}
});
}
final static int COUNTS = 5;// 点击次数
@@ -440,29 +367,29 @@ public class MainActivity extends AppCompatActivity {
}
Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case 0:
SPUtils.put(MainActivity.this, "isLogined", 0);
setImageAndText(imageView, "设备未绑定");
break;
case 1:
UserInfo userInfo = (UserInfo) msg.obj;
SPUtils.put(MainActivity.this, "isLogined", 1);
SPUtils.put(MainActivity.this, "member_id", userInfo.getMember_id());
SPUtils.put(MainActivity.this, "sn_id", userInfo.getId());
setImageAndText(imageView, "设备已绑定");
break;
case 2:
SPUtils.put(MainActivity.this, "isLogined", 2);
setImageAndText(imageView, "未经验证的设备,请联系客服");
break;
}
}
};
// Handler handler = new Handler() {
//// @Override
//// public void handleMessage(Message msg) {
//// super.handleMessage(msg);
//// switch (msg.what) {
//// case 0:
//// SPUtils.put(MainActivity.this, "isLogined", 0);
//// setImageAndText(imageView, "设备未绑定");
//// break;
//// case 1:
//// UserInfo userInfo = (UserInfo) msg.obj;
//// SPUtils.put(MainActivity.this, "isLogined", 1);
//// SPUtils.put(MainActivity.this, "member_id", userInfo.getMember_id());
//// SPUtils.put(MainActivity.this, "sn_id", userInfo.getId());
//// setImageAndText(imageView, "设备已绑定");
//// break;
//// case 2:
//// SPUtils.put(MainActivity.this, "isLogined", 2);
//// setImageAndText(imageView, "未经验证的设备,请联系客服");
//// break;
//// }
//// }
//// };
private String[] permission = new String[]{
// Permission.SYSTEM_ALERT_WINDOW,
@@ -630,6 +557,7 @@ public class MainActivity extends AppCompatActivity {
private void checkUpdate() {
HTTPInterface.checkUpdate(mHandler, "com.jiaoguanyi.store");
HTTPInterface.checkUpdate(mHandler, "com.jiaoguanyi.appstore");
}
private Handler mHandler = new Handler() {
@@ -637,6 +565,9 @@ public class MainActivity extends AppCompatActivity {
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case 100:
// ToastUtil.show("已是最新版本");
break;
case 200:
com.alibaba.fastjson.JSONObject jsonObject = (com.alibaba.fastjson.JSONObject) msg.obj;
installAPK(jsonObject);
@@ -648,33 +579,46 @@ public class MainActivity extends AppCompatActivity {
StudentsInfo info = com.alibaba.fastjson.JSONObject.parseObject(String.valueOf(msg.obj), StudentsInfo.class);
if (null != info) {
if (info.getBatch().equals("")) {
tv_class.setText("暂无信息");
layout_class.setVisibility(View.GONE);
tv_batch.setVisibility(View.GONE);
tv_batch.setText("暂无信息");
} else {
tv_class.setText(info.getBatch());
layout_class.setVisibility(View.VISIBLE);
tv_batch.setVisibility(View.VISIBLE);
tv_batch.setText(info.getBatch());
}
if (info.getSno().equals("")) {
tv_number.setText("暂无信息");
layout_number.setVisibility(View.GONE);
// try {
if (info.getClasses().equals("")) {
layout_class.setVisibility(View.GONE);
tv_class.setText("暂无信息");
} else {
layout_class.setVisibility(View.VISIBLE);
tv_class.setText(info.getClasses());
}
// } catch (Exception e) {
// Log.e("fht", e.getMessage());
// }
if (info.getSno().equals("")) {
layout_number.setVisibility(View.GONE);
tv_number.setText("暂无信息");
} else {
tv_number.setText(info.getSno());
layout_number.setVisibility(View.VISIBLE);
tv_number.setText(info.getSno());
}
if (info.getRealname().equals("")) {
tv_name.setText("暂无信息");
layout_name.setVisibility(View.GONE);
tv_name.setText("暂无信息");
} else {
tv_name.setText(info.getRealname());
layout_name.setVisibility(View.VISIBLE);
tv_name.setText(info.getRealname());
}
}
break;
case -2:
tv_batch.setText("暂无信息");
tv_class.setText("暂无信息");
tv_number.setText("暂无信息");
tv_name.setText("暂无信息");
tv_batch.setVisibility(View.GONE);
layout_class.setVisibility(View.GONE);
layout_number.setVisibility(View.GONE);
layout_name.setVisibility(View.GONE);
@@ -686,11 +630,11 @@ public class MainActivity extends AppCompatActivity {
};
private void installAPK(com.alibaba.fastjson.JSONObject jsonObject) {
String url = jsonObject.getString("url");
final String url = jsonObject.getString("url");
int versionCode = jsonObject.getInteger("version_code");
String packageName = jsonObject.getString("package");
final String packageName = jsonObject.getString("package");
String app_name = jsonObject.getString("app_name");
com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
final com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
object.put("app_name", app_name);
object.put("app_package", packageName);
PackageManager pm = getPackageManager();
@@ -701,13 +645,34 @@ public class MainActivity extends AppCompatActivity {
e.printStackTrace();
}
if (packageInfo == null || packageInfo.versionCode < versionCode) {
Aria.download(this)
.load(url) //读取下载地址
.setFilePath(PathUtils.getExternalDownloadsPath() + "/ygj/" + EncryptUtils.encryptMD5ToString(packageName) + ".apk", true)
.setExtendField(object.toJSONString())
.create(); //启动下载}
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("更新:");
builder.setMessage("检测到有新版本,是否更新?");
builder.setIcon(R.mipmap.ic_launcher);
builder.setCancelable(true);
//设置正面按钮
builder.setPositiveButton("更新", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Aria.download(this)
.load(url) //读取下载地址
.setFilePath(PathUtils.getExternalDownloadsPath() + "/ygj/" + EncryptUtils.encryptMD5ToString(packageName) + ".apk", true)
.setExtendField(object.toJSONString())
.create(); //启动下载}
dialog.dismiss();
}
});
//设置反面按钮
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.show();
} else {
// ToastUtil.show("已是最新版本");
ToastUtil.show("已是最新版本");
Log.e("fht", "已是最新版本");
}
@@ -886,11 +851,10 @@ public class MainActivity extends AppCompatActivity {
uploadAppInfo.setInstall_time(firstInstallTime);
// Log.e("mjsheng", "------------------" + uploadAppInfo);
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
} else {
//非系统应用
appList.add(uploadAppInfo);
} else {
}
@@ -936,7 +900,7 @@ public class MainActivity extends AppCompatActivity {
private void initJpush() {
JPushInterface.init(this);
onTagAliasAction(7);
setAlias();
String rid = JPushInterface.getRegistrationID(getApplicationContext());
if (!rid.isEmpty()) {
// ToastUtil.debugShow("RegId:" + rid);
@@ -1014,7 +978,7 @@ public class MainActivity extends AppCompatActivity {
}
}
private void getAppLimitApi() {
private void getAppLimitApi() {
AppLimitApi appLimitApi = Network.getAppLimitApi();
appLimitApi.getAppLimitApi(Configure.HTTP_KEY, Utils.getSerial())
.subscribeOn(Schedulers.io())

View File

@@ -571,8 +571,22 @@ public class HTTPInterface {
PackageManager pm = context.getPackageManager();
for (String pack : newList) {
pm.setApplicationEnabledSetting(pack, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
Log.e("setHideDesktopIcon", pack);
}
}
} else {
//测试
// List<String> newList=new ArrayList<>();
// PackageManager pm = context.getPackageManager();
// newList.add("com.android.quicksearchbox");
// newList.add("com.android.calendar");
// newList.add("com.android.dreams.basic");
// newList.add("com.android.musicfx");
// newList.add("com.android.email");
// for (String pack : newList) {
// pm.setApplicationEnabledSetting(pack, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
// Log.e("setHideDesktopIcon", pack);
// }
}
} catch (Exception e) {
Log.e("fht", "setHideDesktopIcon" + e.getMessage());

View File

@@ -25,10 +25,12 @@ public class BootReceiver extends BroadcastReceiver {
|| intent.getAction().equals("android.intent.action.BATTERY_OKAY")
|| intent.getAction().equals("android.intent.action.ACTION_POWER_CONNECTED")
|| intent.getAction().equals("android.intent.action.DATE_CHANGED")
|| intent.getAction().equals("android.intent.action.LOCALE_CHANGED")
|| intent.getAction().equals("android.intent.action.TIME_TICK")
|| intent.getAction().equals("android.intent.action.USER_PRESENT")
|| intent.getAction().equals("android.intent.action.SCREEN_ON")
|| intent.getAction().equals("android.intent.action.SCREEN_OFF")
) {
//除了USER_PRESENT应该都收不到
Log.e("fht", "BootReceiver MSG:" + intent.getAction());

View File

@@ -140,11 +140,9 @@ public class NewAppReceiver extends BroadcastReceiver {
uploadAppInfo.setInstall_time(firstInstallTime);
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
//非系统应用
appList.add(uploadAppInfo);
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
} else {
appList.add(uploadAppInfo);
}

View File

@@ -1,11 +1,7 @@
package com.mjsheng.myappstore.server;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
@@ -18,7 +14,6 @@ import android.util.Log;
import com.alibaba.fastjson.JSON;
import com.arialyy.aria.core.Aria;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.EncryptUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.PathUtils;
@@ -27,7 +22,6 @@ import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.mjsheng.myappstore.BuildConfig;
import com.mjsheng.myappstore.MyApplication;
import com.mjsheng.myappstore.activity.MainActivity;
import com.mjsheng.myappstore.bean.ForceDownloadBean;
import com.mjsheng.myappstore.bean.ForceDownloadData;
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
@@ -52,11 +46,9 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import cn.jpush.android.api.JPushInterface;
@@ -82,6 +74,7 @@ import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
*/
public class InitJpushServer extends Service {
@Nullable
@Override
public IBinder onBind(Intent intent) {
@@ -92,12 +85,12 @@ public class InitJpushServer extends Service {
public void onCreate() {
Log.e("InitJpushServer", "onCreate");
super.onCreate();
// android.os.Debug.waitForDebugger();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
getAppLimitApi();//获取可以写入的app包名
HTTPInterface.getNetAndLaunchSetting(this);
timerImitate();
@@ -315,14 +308,24 @@ public class InitJpushServer extends Service {
deleteOtherApp(result);
}
private void deleteOtherApp(String packageList) {
Log.e("deleteOtherApp", "packageList:" + packageList);
String[] result = packageList.split(",");
List<String> resultList = new ArrayList<>(Arrays.asList(result));
List<String> packageLists = ApkUtils.queryFilterAppInfo(InitJpushServer.this);
Log.e("deleteOtherApp", "packageLists:" + packageLists.toString());
if (resultList.size() > 0) {
for (final String packageName : packageLists) {
if (Utils.isSystemApp(InitJpushServer.this, packageName)) {
Log.e("deleteOtherApp", "is systemApp:" + packageName);
continue;
}
if (ApkUtils.canremove_systemapp.contains(packageName)) {
continue;
}
if (!resultList.contains(packageName)) {
new Thread(new Runnable() {
@Override

View File

@@ -7,7 +7,6 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Binder;
import android.os.Build;
@@ -19,33 +18,22 @@ import android.widget.Toast;
import com.mjsheng.myappstore.BuildConfig;
import com.mjsheng.myappstore.R;
import com.mjsheng.myappstore.utils.update.ToastTool;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.lang.annotation.ElementType;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import javax.crypto.interfaces.PBEKey;
import cn.jpush.android.api.PushNotificationBuilder;
import rx.Observable;
import rx.Observer;
import rx.Subscriber;
@@ -584,64 +572,57 @@ public class ApkUtils {
// 查询所有已经安装的应用程序
List<ApplicationInfo> appInfos = pm.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);// GET_UNINSTALLED_PACKAGES代表已删除但还有安装目录的
List<String> applicationInfos = new ArrayList<>();
// 创建一个类别为CATEGORY_LAUNCHER的该包名的Intent
Intent resolveIntent = new Intent(Intent.ACTION_MAIN, null);
resolveIntent.addCategory(Intent.CATEGORY_LAUNCHER);
// 通过getPackageManager()的queryIntentActivities方法遍历,得到所有能打开的app的packageName
List<ResolveInfo> resolveinfoList = pm.queryIntentActivities(resolveIntent, 0);
Set<String> allowPackages = new HashSet();
for (ResolveInfo resolveInfo : resolveinfoList) {
allowPackages.add(resolveInfo.activityInfo.packageName);
}
for (ApplicationInfo app : appInfos) {
if ((app.flags & ApplicationInfo.FLAG_SYSTEM) <= 0)//通过flag排除系统应用会将电话、短信也排除掉
{
// Log.e("queryFilterAppInfo", String.valueOf(app.flags));
// Log.e("queryFilterAppInfo", String.valueOf((app.flags & mask)));
if ((app.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
//通过flag排除系统应用会将电话、短信也排除掉
} else {
applicationInfos.add(app.packageName);
Log.e("queryFilterAppInfo", app.packageName);
}
// if(app.uid > 10000){//通过uid排除系统应用在一些手机上效果不好
// applicationInfos.add(app);
// }
}
return applicationInfos;
}
public static List<String> showAllAPP(Context context) {
public static List<String> canremove_systemapp = new ArrayList<String>() {{
//预置的可以卸载的系统应用,判断出来为第三方
this.add("com.android.quicksearchbox");
this.add("com.android.calendar");
this.add("com.android.dreams.basic");
this.add("com.android.musicfx");
this.add("com.android.email");
}};
public static List<String> systemapp = new ArrayList<String>() {{
//需要管控的系统应用
this.add("com.android.gallery3d");
this.add("com.android.deskclock");
this.add("com.android.music");
this.add("com.mediatek.camera");
this.add("com.android.documentsui");
this.add("com.android.soundrecorder");
this.add("com.android.browser");
}};
public static void showAllAPP(Context context) {
PackageManager pm = context.getPackageManager();
// 查询所有已经安装的应用程序
List<ApplicationInfo> appInfos = pm.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);// GET_UNINSTALLED_PACKAGES代表已删除但还有安装目录的
List<String> packageList = new ArrayList<>();
// 创建一个类别为CATEGORY_LAUNCHER的该包名的Intent
Intent resolveIntent = new Intent(Intent.ACTION_MAIN, null);
resolveIntent.addCategory(Intent.CATEGORY_LAUNCHER);
// 通过getPackageManager()的queryIntentActivities方法遍历,得到所有能打开的app的packageName
List<ResolveInfo> resolveinfoList = pm.queryIntentActivities(resolveIntent, 0);
Set<String> allowPackages = new HashSet();
for (ResolveInfo resolveInfo : resolveinfoList) {
allowPackages.add(resolveInfo.activityInfo.packageName);
List<PackageInfo> packages = pm.getInstalledPackages(0);
for (PackageInfo packageInfo : packages) {
if (ApkUtils.canremove_systemapp.contains(packageInfo.packageName)) {
continue;
}
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 1
&& !systemapp.contains(packageInfo.packageName)
) {
} else {
Log.e("showAllAPP", "packageName:" + packageInfo.applicationInfo.packageName);
pm.setApplicationEnabledSetting(packageInfo.applicationInfo.packageName, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
}
}
for (ApplicationInfo app : appInfos) {
// if((app.flags & ApplicationInfo.FLAG_SYSTEM) <= 0)//通过flag排除系统应用会将电话、短信也排除掉
// {
// applicationInfos.add(app);
// }
// if(app.uid > 10000){//通过uid排除系统应用在一些手机上效果不好
// applicationInfos.add(app);
// }
// if (allowPackages.contains(app.packageName) && !Arrays.asList(excludePackageName).contains(app.packageName)) {
// if (allowPackages.contains(app.packageName)) {
// packageList.add(app.packageName);
// }
pm.setApplicationEnabledSetting(app.packageName, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
}
return packageList;
}
@@ -661,4 +642,25 @@ public class ApkUtils {
}
}
}
public static boolean isSystemApp(Context context, String pkg) {
try {
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(pkg, 0);
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
if (pkg.equals(context.getPackageName())) {
return true;
} else {
//第三方应用
return false;
}
} else {
//系统应用
return true;
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return true;
}
}
}

View File

@@ -128,7 +128,8 @@ public class AppsManagerUtils {
public static boolean isSystemApp(Context context, String pkg) {
try {
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(pkg, 0);
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) <= 0) {
int mask = ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;
if ((packageInfo.applicationInfo.flags & mask) == 0) {
if (pkg.equals(context.getPackageName())) {
return true;
} else {

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 内部颜色 -->
<solid
android:color="@color/check_update_color" />
<!-- 圆角的幅度 -->
<corners
android:topLeftRadius="@dimen/dp_24"
android:topRightRadius="@dimen/dp_24"
android:bottomLeftRadius="@dimen/dp_24"
android:bottomRightRadius="@dimen/dp_24" />
</shape>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 内部颜色 -->
<solid
android:color="@color/check_update_color_pressed" />
<!-- 圆角的幅度 -->
<corners
android:topLeftRadius="@dimen/dp_24"
android:topRightRadius="@dimen/dp_24"
android:bottomLeftRadius="@dimen/dp_24"
android:bottomRightRadius="@dimen/dp_24" />
</shape>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 没有焦点时的背景颜色 -->
<item android:drawable="@drawable/bt_checkupdate_normnl" android:state_window_focused="false" />
<!-- 非触摸模式下获得焦点并单击时的背景颜色 -->
<item android:drawable="@drawable/bt_checkupdate_normnl" android:state_focused="true" android:state_pressed="true" />
<!-- 触摸模式下单击时的背景颜色 -->
<item android:drawable="@drawable/bt_checkupdate_pressed" android:state_focused="false" android:state_pressed="true" />
<!-- 选中时的背景颜色 -->
<item android:drawable="@drawable/bt_checkupdate_normnl" android:state_selected="true" />
<!-- 获得焦点时的背景 颜色 -->
<item android:drawable="@drawable/bt_checkupdate_normnl" android:state_focused="true" />
</selector>

View File

@@ -23,7 +23,7 @@
android:gravity="center_horizontal"
android:text="我的设备"
android:textColor="#000000"
android:textSize="@dimen/sp_16"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@@ -54,241 +54,261 @@
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bannerLayout"
app:layout_constraintVertical_bias="0.05">
app:layout_constraintVertical_bias="0.05"></ImageView>
</ImageView>
<LinearLayout
android:id="@+id/linearLayout"
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_150"
android:layout_marginTop="12dp"
android:layout_marginRight="@dimen/dp_150"
android:orientation="vertical"
android:layout_height="0dp"
android:fadingEdge="none"
android:overScrollMode="never"
android:scrollbars="none"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView">
<RelativeLayout
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_20">
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_150"
android:layout_marginTop="12dp"
android:layout_marginRight="@dimen/dp_150"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_batch">
<TextView
android:id="@+id/tv_batch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="设备SN"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_devsn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="设备SN"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_20">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="MAC地址"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_devmac"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="MAC地址"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/checkupdate"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_20">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="版本"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="版本"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_class"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_20"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="班级"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_class"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
android:textSize="@dimen/sp_12"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30">
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="设备SN"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<RelativeLayout
android:id="@+id/layout_number"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_20"
android:visibility="gone">
<TextView
android:id="@+id/tv_devsn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="设备SN"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="MAC地址"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_devmac"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="MAC地址"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_class"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="班级"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_class"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_number"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="学号"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_name"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="姓名"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/checkupdate"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="版本"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="版本"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<Button
android:id="@+id/chkupd"
android:layout_width="@dimen/dp_240"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="学号"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="@drawable/bt_checkupdate_selector"
android:stateListAnimator="@null"
android:text="检查更新"
android:textColor="@color/white"
android:textSize="@dimen/sp_12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout" />
<TextView
android:id="@+id/tv_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_name"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_20"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="姓名"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</ScrollView>
</RelativeLayout>
</LinearLayout>
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:text="连续点击版本号,自动下载新版本"
android:textSize="@dimen/sp_9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout" />
</android.support.constraint.ConstraintLayout>

View File

@@ -24,7 +24,7 @@
android:gravity="center_horizontal"
android:text="我的设备"
android:textColor="#000000"
android:textSize="@dimen/sp_16"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@@ -45,8 +45,8 @@
<ImageView
android:id="@+id/imageView"
android:layout_width="@dimen/dp_160"
android:layout_height="@dimen/dp_160"
android:layout_width="@dimen/dp_150"
android:layout_height="@dimen/dp_150"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/logo"
@@ -54,22 +54,35 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.15">
app:layout_constraintVertical_bias="0.096">
</ImageView>
<TextView
android:id="@+id/tv_batch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_64"
android:layout_marginTop="56dp"
android:layout_marginTop="16dp"
android:layout_marginRight="@dimen/dp_64"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView">
app:layout_constraintTop_toBottomOf="@+id/tv_batch">
<RelativeLayout
@@ -137,6 +150,114 @@
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_class"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_10"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="班级"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_class"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_number"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_10"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="学号"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_name"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_10"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="姓名"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
@@ -174,127 +295,19 @@
</RelativeLayout>
<RelativeLayout
android:visibility="gone"
android:id="@+id/layout_class"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_10">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="班级"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_class"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
android:visibility="gone"
android:id="@+id/layout_number"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_10">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="学号"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout
android:visibility="gone"
android:id="@+id/layout_name"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_10">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="姓名"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="暂无信息"
android:textColor="#000000"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
</LinearLayout>
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
<Button
android:id="@+id/chkupd"
android:layout_width="@dimen/dp_180"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:text="连续点击版本号,自动下载新版本"
android:textSize="@dimen/sp_9"
android:layout_marginTop="16dp"
android:background="@drawable/bt_checkupdate_selector"
android:stateListAnimator="@null"
android:text="检查更新"
android:textColor="@color/white"
android:textSize="@dimen/sp_12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout" />

View File

@@ -45,5 +45,7 @@
<color name="main_text_color">#ff797979</color>
<color name="main_green_color">#55b68a</color>
<color name="appstore_selecte_color">#8f82bc</color>
<color name="check_update_color">#00A0E9</color>
<color name="check_update_color_pressed">#047AAF</color>
</resources>