|
@ -15,17 +15,19 @@ import android.os.AsyncTask;
|
15
|
15
|
import android.os.Build;
|
16
|
16
|
import android.widget.Toast;
|
17
|
17
|
|
18
|
|
import com.ai.ipu.basic.string.StringUtils;
|
|
18
|
import com.ai.ipu.basic.net.http.HttpTool;
|
|
19
|
import com.ai.ipu.basic.string.StringUtil;
|
|
20
|
import com.ai.ipu.basic.thread.IpuThread;
|
19
|
21
|
import com.ai.ipu.bluetooth.activity.ShareByBluetoothActivity;
|
20
|
22
|
import com.ai.ipu.bluetooth.listener.OnOpenBluetoothListener;
|
21
|
23
|
import com.ai.ipu.bluetooth.util.BluetoothTool;
|
|
24
|
import com.ai.ipu.mobile.app.ApkUtil;
|
|
25
|
import com.ai.ipu.mobile.app.AppInfoUtil;
|
22
|
26
|
import com.ailk.common.data.IData;
|
23
|
27
|
import com.ailk.common.data.impl.DataMap;
|
24
|
28
|
import com.litesuits.http.LiteHttpClient;
|
25
|
29
|
import com.litesuits.http.request.Request;
|
26
|
30
|
import com.litesuits.http.response.Response;
|
27
|
|
import com.wade.mobile.app.MobileAppInfo;
|
28
|
|
import com.wade.mobile.common.MobileThread;
|
29
|
31
|
import com.wade.mobile.common.sms.listener.OnSmsReceiveListener;
|
30
|
32
|
import com.wade.mobile.common.sms.util.SmsTool;
|
31
|
33
|
import com.wade.mobile.frame.IWadeMobile;
|
|
@ -40,7 +42,6 @@ import com.wade.mobile.util.FileUtil;
|
40
|
42
|
import com.wade.mobile.util.FuncConstant;
|
41
|
43
|
import com.wade.mobile.util.Messages;
|
42
|
44
|
import com.wade.mobile.util.Utility;
|
43
|
|
import com.wade.mobile.util.http.HttpTool;
|
44
|
45
|
import com.wade.mobile.util.http.UnirestUtil;
|
45
|
46
|
|
46
|
47
|
public class MobileNetWork extends Plugin {
|
|
@ -61,7 +62,7 @@ public class MobileNetWork extends Plugin {
|
61
|
62
|
HashSet<String> telSet = null;
|
62
|
63
|
if(!isNull(telString)){
|
63
|
64
|
telSet = new HashSet<String>();
|
64
|
|
if(StringUtils.isJSONArray(telString)) {
|
|
65
|
if(StringUtil.isJSONArray(telString)) {
|
65
|
66
|
JSONArray teles = new JSONArray(telString);
|
66
|
67
|
for(int i=0; i <teles.length() ; i++){
|
67
|
68
|
telSet.add(teles.getString(i));
|
|
@ -200,7 +201,7 @@ public class MobileNetWork extends Plugin {
|
200
|
201
|
Map<String, String> postData = new HashMap<String, String>();
|
201
|
202
|
postData.put(Constant.Server.ACTION, dataAction);
|
202
|
203
|
if (ServerDataConfig.isEncrypt(dataAction)) {
|
203
|
|
MobileSecurity.init(context);
|
|
204
|
MobileSecurity.init();
|
204
|
205
|
/* 参数加密处理 */
|
205
|
206
|
String key = MobileSecurity.getDesKey();
|
206
|
207
|
postData.put(Constant.Server.KEY, key);
|
|
@ -235,7 +236,7 @@ public class MobileNetWork extends Plugin {
|
235
|
236
|
public void storageDataByThread(final String dataAction, final IData param,
|
236
|
237
|
final boolean isEncrypt, long waitoutTime) throws Exception {
|
237
|
238
|
waitoutTime = (waitoutTime < 3 || waitoutTime > 10) ? 5 : waitoutTime;// 修正waitoutTime,确保在一定范围
|
238
|
|
new MobileThread(dataAction, waitoutTime) {
|
|
239
|
new IpuThread(dataAction, waitoutTime) {
|
239
|
240
|
@Override
|
240
|
241
|
protected void execute() throws Exception {
|
241
|
242
|
String result = requestBizData(dataAction, param);
|
|
@ -258,7 +259,7 @@ public class MobileNetWork extends Plugin {
|
258
|
259
|
return;
|
259
|
260
|
}
|
260
|
261
|
|
261
|
|
if (Build.VERSION.SDK_INT < MobileAppInfo.Android_4_1_2) {
|
|
262
|
if (Build.VERSION.SDK_INT < AppInfoUtil.Android_4_1_2) {
|
262
|
263
|
try {
|
263
|
264
|
Intent intent = new Intent(context, ShareByBluetoothActivity.class);
|
264
|
265
|
context.startActivity(intent);
|
|
@ -268,15 +269,15 @@ public class MobileNetWork extends Plugin {
|
268
|
269
|
}
|
269
|
270
|
} else {
|
270
|
271
|
final BluetoothTool bluetoothTools = new BluetoothTool(context);
|
271
|
|
final MobileAppInfo mobileAppInfo = MobileAppInfo.getInstance(context);
|
|
272
|
// final AppInfoUtil mobileAppInfo = AppInfoUtil.getInstance(context);
|
272
|
273
|
if (bluetoothTools.isEnabled()) {
|
273
|
|
bluetoothTools.sendFile(mobileAppInfo.getApk());
|
|
274
|
bluetoothTools.sendFile(ApkUtil.getCurrApk());
|
274
|
275
|
} else {
|
275
|
276
|
bluetoothTools.openBluetooth(new OnOpenBluetoothListener() {
|
276
|
277
|
public void OnOpened(BluetoothAdapter adapter) {
|
277
|
278
|
// 开始查找设备。
|
278
|
279
|
try {
|
279
|
|
bluetoothTools.sendFile(mobileAppInfo.getApk());
|
|
280
|
bluetoothTools.sendFile(ApkUtil.getCurrApk());
|
280
|
281
|
} catch (Exception e) {
|
281
|
282
|
e.printStackTrace();
|
282
|
283
|
}
|