update:2020.06.17
fix:优化没有信息时标签不显示 add:
This commit is contained in:
@@ -15,10 +15,10 @@ android {
|
||||
minSdkVersion 20
|
||||
targetSdkVersion 29
|
||||
|
||||
versionCode 147
|
||||
versionName "3.0.4"//测试jiaoguanyi.cn
|
||||
// versionCode 129
|
||||
// versionName "2.0.0.9"// 正式jiaoguanyi.com 双数正式 单数测试
|
||||
// versionCode 148
|
||||
// versionName "3.0.5"//测试jiaoguanyi.cn
|
||||
versionCode 1002
|
||||
versionName "2.0.1.2"// 正式jiaoguanyi.com 双数正式 单数测试
|
||||
multiDexEnabled true
|
||||
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -652,18 +652,22 @@ public class MainActivity extends AppCompatActivity {
|
||||
layout_class.setVisibility(View.GONE);
|
||||
} else {
|
||||
tv_class.setText(info.getBatch());
|
||||
layout_class.setVisibility(View.VISIBLE);
|
||||
|
||||
}
|
||||
if (info.getSno().equals("")) {
|
||||
tv_number.setText("暂无信息");
|
||||
layout_number.setVisibility(View.GONE);
|
||||
} else {
|
||||
tv_number.setText(info.getSno());
|
||||
layout_number.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (info.getRealname().equals("")) {
|
||||
tv_name.setText("暂无信息");
|
||||
layout_name.setVisibility(View.GONE);
|
||||
} else {
|
||||
tv_name.setText(info.getRealname());
|
||||
layout_name.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -40,10 +40,10 @@ public class Network {
|
||||
// public static final String ROOT_URL = "http://www.as.xueshibao.com.cn/api/"; 弃用
|
||||
// public static final String ROOT_URL = "https://www.jiaoguanyi.com/api/";//正式 弃用
|
||||
|
||||
// public static final String ROOT_URL = "https://partner.jiaoguanyi.com/api/";//正式
|
||||
// public static final String WebsocketURL = "ws://47.107.133.19:1234";
|
||||
public static final String ROOT_URL = "http://www.jiaoguanyi.cn/api/";//测试
|
||||
public static final String WebsocketURL = "ws://47.107.133.19:2345";
|
||||
public static final String ROOT_URL = "https://partner.jiaoguanyi.com/api/";//正式
|
||||
public static final String WebsocketURL = "ws://47.107.133.19:1234";
|
||||
// public static final String ROOT_URL = "http://www.jiaoguanyi.cn/api/";//测试
|
||||
// public static final String WebsocketURL = "ws://47.107.133.19:2345";
|
||||
|
||||
private static UploadAppInfoApi uploadAppInfoApi;
|
||||
private static DeselectIDApi deselectIDApi;
|
||||
|
||||
@@ -105,6 +105,42 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
mContext = context;
|
||||
Bundle bundle = intent.getExtras();
|
||||
|
||||
if (JPushInterface.ACTION_REGISTRATION_ID.equals(intent.getAction())) {
|
||||
String regId = bundle.getString(JPushInterface.EXTRA_REGISTRATION_ID);
|
||||
Log.e(TAG, "[MyReceiver] 接收Registration Id : " + regId);
|
||||
//send the Registration Id to your server...
|
||||
} else if (JPushInterface.ACTION_MESSAGE_RECEIVED.equals(intent.getAction())) {
|
||||
// ToastTool.show("[MyReceiver] 接收到推送下来的自定义消息: " + bundle.getString(JPushInterface.EXTRA_MESSAGE)
|
||||
// + "---" + bundle.getString(JPushInterface.EXTRA_TITLE) + "---" + bundle.getString(JPushInterface.EXTRA_CONTENT_TYPE)
|
||||
// + "---" + bundle.getString(JPushInterface.EXTRA_EXTRA) + "----" + bundle.getString("package_name"));
|
||||
// Log.e(TAG, "[MyReceiver] 接收到推送下来的自定义消息: " + bundle.getString(JPushInterface.EXTRA_MESSAGE)
|
||||
// + "---" + bundle.getString(JPushInterface.EXTRA_TITLE) + "---" + bundle.getString(JPushInterface.EXTRA_CONTENT_TYPE)
|
||||
// + "---" + bundle.getString(JPushInterface.EXTRA_EXTRA) + "----" + bundle.getString("package_name"));
|
||||
processCustomMessage(context, bundle);//屏蔽推送
|
||||
} else if (JPushInterface.ACTION_NOTIFICATION_RECEIVED.equals(intent.getAction())) {
|
||||
Log.e(TAG, "[MyReceiver] 接收到推送下来的通知" + bundle.getString(JPushInterface.EXTRA_EXTRA));
|
||||
// doDownloadAndInstall(bundle.getString(JPushInterface.EXTRA_EXTRA));
|
||||
// LogUtils.e(getBatteryLevel()+"-0-iweroiwerewefeerer-----------");
|
||||
int notifactionId = bundle.getInt(JPushInterface.EXTRA_NOTIFICATION_ID);
|
||||
Log.e(TAG, "[MyReceiver] 接收到推送下来的通知的ID: " + notifactionId);
|
||||
} else if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {
|
||||
Log.e(TAG, "[MyReceiver] 用户点击打开了通知");
|
||||
} else if (JPushInterface.ACTION_RICHPUSH_CALLBACK.equals(intent.getAction())) {
|
||||
Log.e(TAG, "[MyReceiver] 用户收到到RICH PUSH CALLBACK: " + bundle.getString(JPushInterface.EXTRA_EXTRA));
|
||||
//在这里根据 JPushInterface.EXTRA_EXTRA 的内容处理代码,比如打开新的Activity, 打开一个网页等..
|
||||
} else if (JPushInterface.ACTION_CONNECTION_CHANGE.equals(intent.getAction())) {
|
||||
boolean connected = intent.getBooleanExtra(JPushInterface.EXTRA_CONNECTION_CHANGE, false);
|
||||
Log.e(TAG, "[MyReceiver]" + intent.getAction() + " connected state change to " + connected);
|
||||
} else {
|
||||
Log.e(TAG, "[MyReceiver] Unhandled intent - " + intent.getAction());
|
||||
}
|
||||
}
|
||||
|
||||
private void processCustomMessage(final Context context, Bundle bundle) {
|
||||
String message = bundle.getString(JPushInterface.EXTRA_MESSAGE);
|
||||
String title = bundle.getString(JPushInterface.EXTRA_TITLE);
|
||||
@@ -178,15 +214,22 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
MyApplication.sendAppUsedTime(random, sendType);
|
||||
break;
|
||||
case GET_FORCEDOWNLOADURL:
|
||||
com.alibaba.fastjson.JSONObject URI = JSON.parseObject(extras);
|
||||
String versionCode = URI.getString("version_code");
|
||||
String url = URI.getString("url");
|
||||
if (TextUtils.isEmpty(extras)) {
|
||||
Log.e("mjsheng", "settingNetControl extras is null");
|
||||
return;
|
||||
}
|
||||
com.alibaba.fastjson.JSONObject extra = JSON.parseObject(extras);
|
||||
String app_name=extra.getString("app_name");
|
||||
String app_package=extra.getString("package");
|
||||
String url = extra.getString("url");
|
||||
int versionCode = extra.getInteger("version_code");
|
||||
|
||||
com.alibaba.fastjson.JSONObject packageObj = new com.alibaba.fastjson.JSONObject();
|
||||
packageObj.put("app_name", "教管易");
|
||||
packageObj.put("app_package", "com.jiaoguanyi.store");
|
||||
packageObj.put("app_name", app_name);
|
||||
packageObj.put("app_package", app_package);
|
||||
Aria.download(this)
|
||||
.load(url) //读取下载地址
|
||||
.setFilePath(PathUtils.getExternalDownloadsPath() + "/ygj/" + EncryptUtils.encryptMD5ToString("com.jiaoguanyi.store") + ".apk", true)
|
||||
.setFilePath(PathUtils.getExternalDownloadsPath() + "/ygj/" + EncryptUtils.encryptMD5ToString(url) + ".apk", true)
|
||||
.setExtendField(packageObj.toJSONString())
|
||||
.create(); //启动下载}
|
||||
|
||||
@@ -862,46 +905,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
mContext = context;
|
||||
Bundle bundle = intent.getExtras();
|
||||
|
||||
if (JPushInterface.ACTION_REGISTRATION_ID.equals(intent.getAction())) {
|
||||
String regId = bundle.getString(JPushInterface.EXTRA_REGISTRATION_ID);
|
||||
Log.e(TAG, "[MyReceiver] 接收Registration Id : " + regId);
|
||||
//send the Registration Id to your server...
|
||||
} else if (JPushInterface.ACTION_MESSAGE_RECEIVED.equals(intent.getAction())) {
|
||||
// ToastTool.show("[MyReceiver] 接收到推送下来的自定义消息: " + bundle.getString(JPushInterface.EXTRA_MESSAGE)
|
||||
// + "---" + bundle.getString(JPushInterface.EXTRA_TITLE) + "---" + bundle.getString(JPushInterface.EXTRA_CONTENT_TYPE)
|
||||
// + "---" + bundle.getString(JPushInterface.EXTRA_EXTRA) + "----" + bundle.getString("package_name"));
|
||||
// Log.e(TAG, "[MyReceiver] 接收到推送下来的自定义消息: " + bundle.getString(JPushInterface.EXTRA_MESSAGE)
|
||||
// + "---" + bundle.getString(JPushInterface.EXTRA_TITLE) + "---" + bundle.getString(JPushInterface.EXTRA_CONTENT_TYPE)
|
||||
// + "---" + bundle.getString(JPushInterface.EXTRA_EXTRA) + "----" + bundle.getString("package_name"));
|
||||
processCustomMessage(context, bundle);//屏蔽推送
|
||||
} else if (JPushInterface.ACTION_NOTIFICATION_RECEIVED.equals(intent.getAction())) {
|
||||
Log.e(TAG, "[MyReceiver] 接收到推送下来的通知" + bundle.getString(JPushInterface.EXTRA_EXTRA));
|
||||
// doDownloadAndInstall(bundle.getString(JPushInterface.EXTRA_EXTRA));
|
||||
// LogUtils.e(getBatteryLevel()+"-0-iweroiwerewefeerer-----------");
|
||||
int notifactionId = bundle.getInt(JPushInterface.EXTRA_NOTIFICATION_ID);
|
||||
Log.e(TAG, "[MyReceiver] 接收到推送下来的通知的ID: " + notifactionId);
|
||||
|
||||
|
||||
} else if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {
|
||||
Log.e(TAG, "[MyReceiver] 用户点击打开了通知");
|
||||
|
||||
|
||||
} else if (JPushInterface.ACTION_RICHPUSH_CALLBACK.equals(intent.getAction())) {
|
||||
Log.e(TAG, "[MyReceiver] 用户收到到RICH PUSH CALLBACK: " + bundle.getString(JPushInterface.EXTRA_EXTRA));
|
||||
//在这里根据 JPushInterface.EXTRA_EXTRA 的内容处理代码,比如打开新的Activity, 打开一个网页等..
|
||||
|
||||
} else if (JPushInterface.ACTION_CONNECTION_CHANGE.equals(intent.getAction())) {
|
||||
boolean connected = intent.getBooleanExtra(JPushInterface.EXTRA_CONNECTION_CHANGE, false);
|
||||
Log.e(TAG, "[MyReceiver]" + intent.getAction() + " connected state change to " + connected);
|
||||
} else {
|
||||
Log.e(TAG, "[MyReceiver] Unhandled intent - " + intent.getAction());
|
||||
}
|
||||
}
|
||||
|
||||
public void settingLock(String s) {
|
||||
if (TextUtils.isEmpty(s)) {
|
||||
|
||||
@@ -130,6 +130,8 @@ public class StepService extends Service {
|
||||
public void onClose(int code, String reason, boolean remote) {
|
||||
super.onClose(code, reason, remote);
|
||||
Log.i("JWebSocketClientService", "websocket连接关闭");
|
||||
client = null;
|
||||
initSocketClient();
|
||||
mHandler.postDelayed(heartBeatRunnable, HEART_BEAT_RATE);//开启心跳检测
|
||||
|
||||
}
|
||||
@@ -138,6 +140,8 @@ public class StepService extends Service {
|
||||
public void onError(Exception ex) {
|
||||
super.onError(ex);
|
||||
Log.i("JWebSocketClientService", "websocket连接错误");
|
||||
client = null;
|
||||
initSocketClient();
|
||||
mHandler.postDelayed(heartBeatRunnable, HEART_BEAT_RATE);//开启心跳检测
|
||||
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginLeft="@dimen/dp_150"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginRight="@dimen/dp_150"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -73,8 +73,7 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
>
|
||||
android:layout_height="@dimen/dp_20">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -87,6 +86,7 @@
|
||||
android:text="设备SN"
|
||||
android:textColor="#000000"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_devsn"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -106,8 +106,7 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
>
|
||||
android:layout_height="@dimen/dp_20">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -120,6 +119,7 @@
|
||||
android:text="MAC地址"
|
||||
android:textColor="#000000"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_devmac"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -140,8 +140,7 @@
|
||||
<RelativeLayout
|
||||
android:id="@+id/checkupdate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
>
|
||||
android:layout_height="@dimen/dp_20">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -154,6 +153,7 @@
|
||||
android:text="版本"
|
||||
android:textColor="#000000"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/version"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -176,7 +176,8 @@
|
||||
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"
|
||||
@@ -210,7 +211,7 @@
|
||||
android:id="@+id/layout_number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
>
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -223,6 +224,7 @@
|
||||
android:text="学号"
|
||||
android:textColor="#000000"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_number"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -244,7 +246,7 @@
|
||||
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"
|
||||
@@ -257,6 +259,7 @@
|
||||
android:text="姓名"
|
||||
android:textColor="#000000"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -275,9 +278,8 @@
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -176,6 +176,7 @@
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/layout_class"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
@@ -211,6 +212,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/layout_number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
@@ -246,6 +248,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/layout_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
|
||||
Reference in New Issue
Block a user