Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
zhengli
/
wechat_click
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d5909b40
authored
Mar 29, 2018
by
jeffrey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
恢复下老版本的启动方式
parent
8193d56a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
342 additions
and
76 deletions
+342
-76
app/src/main/AndroidManifest.xml
+0
-1
app/src/main/java/com/xf/weixinclick/MainActivity.java
+86
-10
app/src/main/java/com/xf/weixinclick/NewService.java
+68
-60
app/src/main/java/com/xf/weixinclick/bean/EnableResult.java
+154
-0
app/src/main/java/com/xf/weixinclick/http/ClientApi.java
+2
-0
app/src/main/java/com/xf/weixinclick/http/HttpClientApi.java
+16
-0
app/src/main/java/com/xf/weixinclick/receiver/MyMessageReceiver.java
+2
-2
app/src/main/res/layout/activity_main.xml
+14
-3
No files found.
app/src/main/AndroidManifest.xml
View file @
d5909b40
...
@@ -66,7 +66,6 @@
...
@@ -66,7 +66,6 @@
android:name=
".NewService"
android:name=
".NewService"
android:enabled=
"true"
android:enabled=
"true"
android:exported=
"true"
android:exported=
"true"
android:process=
":remote"
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:permission=
"android.permission.BIND_ACCESSIBILITY_SERVICE"
>
android:permission=
"android.permission.BIND_ACCESSIBILITY_SERVICE"
>
<intent-filter>
<intent-filter>
...
...
app/src/main/java/com/xf/weixinclick/MainActivity.java
View file @
d5909b40
...
@@ -17,9 +17,13 @@ import android.view.View;
...
@@ -17,9 +17,13 @@ import android.view.View;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.alibaba.sdk.android.push.CloudPushService
;
import
com.alibaba.sdk.android.push.noonesdk.PushServiceFactory
;
import
com.alibaba.sdk.android.push.noonesdk.PushServiceFactory
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.google.gson.reflect.TypeToken
;
import
com.xf.weixinclick.bean.DelayBean
;
import
com.xf.weixinclick.bean.DelayBean
;
import
com.xf.weixinclick.bean.EnableResult
;
import
com.xf.weixinclick.bean.ResponseBase
;
import
com.xf.weixinclick.bean.msg.ReceiverMsg
;
import
com.xf.weixinclick.bean.msg.ReceiverMsg
;
import
com.xf.weixinclick.http.HttpClientApi
;
import
com.xf.weixinclick.http.HttpClientApi
;
import
com.xf.weixinclick.http.HttpSubscriber
;
import
com.xf.weixinclick.http.HttpSubscriber
;
...
@@ -28,6 +32,7 @@ import com.xf.weixinclick.utils.SP;
...
@@ -28,6 +32,7 @@ import com.xf.weixinclick.utils.SP;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.EventBus
;
import
java.lang.reflect.Type
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Locale
;
import
java.util.Locale
;
...
@@ -54,6 +59,11 @@ public class MainActivity extends BaseActivity {
...
@@ -54,6 +59,11 @@ public class MainActivity extends BaseActivity {
@BindView
(
R
.
id
.
tv_version_name
)
@BindView
(
R
.
id
.
tv_version_name
)
TextView
tv_version_name
;
TextView
tv_version_name
;
@BindView
(
R
.
id
.
tv_enable_listener
)
TextView
tv_enable_listener
;
@Override
@Override
int
getContentView
()
{
int
getContentView
()
{
return
R
.
layout
.
activity_main
;
return
R
.
layout
.
activity_main
;
...
@@ -119,14 +129,14 @@ public class MainActivity extends BaseActivity {
...
@@ -119,14 +129,14 @@ public class MainActivity extends BaseActivity {
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
// WeChatStatus.receiverMsg();
// WeChatStatus.receiverMsg();
//
Intent intent = new Intent();
Intent
intent
=
new
Intent
();
//
//// 报名该有activity
//// 报名该有activity
//
ComponentName cmp = new ComponentName("com.tencent.mm", "com.tencent.mm.ui.LauncherUI");
ComponentName
cmp
=
new
ComponentName
(
"com.tencent.mm"
,
"com.tencent.mm.ui.LauncherUI"
);
//
intent.setAction(Intent.ACTION_MAIN);
intent
.
setAction
(
Intent
.
ACTION_MAIN
);
//
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent
.
addCategory
(
Intent
.
CATEGORY_LAUNCHER
);
//
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
//
intent.setComponent(cmp);
intent
.
setComponent
(
cmp
);
//
startActivity(intent);
startActivity
(
intent
);
new
Thread
(
new
Runnable
()
{
new
Thread
(
new
Runnable
()
{
...
@@ -142,8 +152,8 @@ public class MainActivity extends BaseActivity {
...
@@ -142,8 +152,8 @@ public class MainActivity extends BaseActivity {
// msg.setQr_addr("https://weapp-dev.wangjia.com/qr.jpg?dd=1");
// msg.setQr_addr("https://weapp-dev.wangjia.com/qr.jpg?dd=1");
msg
.
setUnique_id
(
"1111111111111"
);
msg
.
setUnique_id
(
"1111111111111"
);
msg
.
setTime_config
(
new
Gson
().
fromJson
(
"{\"qrcode_timeout\":60,\"after_open_weixin_index_delay\":2000,\"after_open_weixin_file_helper_delay\":6000,\"after_paste_message_delay\":2000,\"after_send_message_delay\":2000,\"after_click_message_delay\":5000,\"long_press_qrcode_delay\":4000,\"after_click_decode_button_delay\":5000,\"after_click_confirm_button_delay\":3000}"
,
DelayBean
.
class
));
msg
.
setTime_config
(
new
Gson
().
fromJson
(
"{\"qrcode_timeout\":60,\"after_open_weixin_index_delay\":2000,\"after_open_weixin_file_helper_delay\":6000,\"after_paste_message_delay\":2000,\"after_send_message_delay\":2000,\"after_click_message_delay\":5000,\"long_press_qrcode_delay\":4000,\"after_click_decode_button_delay\":5000,\"after_click_confirm_button_delay\":3000}"
,
DelayBean
.
class
));
//
EventBus.getDefault().post(msg);
EventBus
.
getDefault
().
post
(
msg
);
startWorkService
(
MainActivity
.
this
,
msg
);
//
startWorkService(MainActivity.this,msg);
}
}
}).
start
();
}).
start
();
...
@@ -151,6 +161,72 @@ public class MainActivity extends BaseActivity {
...
@@ -151,6 +161,72 @@ public class MainActivity extends BaseActivity {
}
}
});
});
tv_enable_listener
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
// String device = (String) SP.getParam("divice", "");
// if (TextUtils.isEmpty(device)){
// NewService.showToast(MainActivity.this,"要先点击绑定设置id");
// return ;
// }
CloudPushService
pushService
=
PushServiceFactory
.
getCloudPushService
();
String
deviceId
=
pushService
.
getDeviceId
();
if
(
TextUtils
.
isEmpty
(
deviceId
)){
NewService
.
showToast
(
MainActivity
.
this
,
"推送注册失败 请重新打开App再试"
);
return
;
}
String
enable
=
(
String
)
SP
.
getParam
(
"enable"
,
"1"
);
int
enableCode
=
1
;
if
(
enable
.
equals
(
"1"
)){
enableCode
=
0
;
}
else
{
enableCode
=
1
;
}
showProgress
(
"请求中"
);
HttpClientApi
.
enableListener
(
deviceId
,
enableCode
,
new
HttpSubscriber
<
String
>()
{
@Override
public
void
onCompleted
()
{
dismissProgress
();
System
.
out
.
println
(
"res onCompleted"
);
}
@Override
public
void
onError
(
Throwable
e
)
{
super
.
onError
(
e
);
NewService
.
showToast
(
MainActivity
.
this
,
"请求失败 "
+
e
.
getMessage
());
}
@Override
public
void
onNext
(
String
responseBase
)
{
// SP.setParam("divice", d_name);
Log
.
d
(
"fei"
,
responseBase
);
Type
type
=
new
TypeToken
<
ResponseBase
<
EnableResult
>>(){}.
getType
();
ResponseBase
<
EnableResult
>
result
=
new
Gson
().
fromJson
(
responseBase
,
type
);
if
(
result
==
null
){
NewService
.
showToast
(
MainActivity
.
this
,
"失败:解析失败"
);
}
else
{
SP
.
setParam
(
"enable"
,
result
.
getData
().
getEnable
());
ensureListenerStatus
();
}
}
});
}
});
ensureListenerStatus
();
}
private
void
ensureListenerStatus
(){
String
enable
=
(
String
)
SP
.
getParam
(
"enable"
,
"1"
);
if
(
enable
.
equals
(
"1"
)){
tv_enable_listener
.
setText
(
"接收消息中\n 点击暂停"
);
}
else
{
tv_enable_listener
.
setText
(
"不收消息中\n 点击开启"
);
}
}
}
...
...
app/src/main/java/com/xf/weixinclick/NewService.java
View file @
d5909b40
...
@@ -25,6 +25,9 @@ import com.xf.weixinclick.http.HttpSubscriber;
...
@@ -25,6 +25,9 @@ import com.xf.weixinclick.http.HttpSubscriber;
import
com.xf.weixinclick.receiver.WeChatStatus
;
import
com.xf.weixinclick.receiver.WeChatStatus
;
import
com.xf.weixinclick.utils.NotificationUtils
;
import
com.xf.weixinclick.utils.NotificationUtils
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
import
java.io.DataOutputStream
;
import
java.io.DataOutputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
...
@@ -82,70 +85,74 @@ public class NewService extends AccessibilityService {
...
@@ -82,70 +85,74 @@ public class NewService extends AccessibilityService {
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
Log
.
d
(
"fei"
,
"onStartCommand start"
);
Log
.
d
(
"fei"
,
"onStartCommand start"
);
NotificationUtils
.
foreground
(
getApplicationContext
(),
this
);
//
NotificationUtils.foreground(getApplicationContext(),this);
//
//todo 当多任务过来的时候,没处理
//
//todo 当多任务过来的时候,没处理
if
(
intent
!=
null
&&
intent
.
getSerializableExtra
(
PARAMS_MSG
)
!=
null
){
//
if (intent != null && intent.getSerializableExtra(PARAMS_MSG) != null){
//先设置变量 然后唤起微信,微信唤起后会通知onAccessibilityEvent
//
//先设置变量 然后唤起微信,微信唤起后会通知onAccessibilityEvent
//然后一步步走流程
//
//然后一步步走流程
ReceiverMsg
msg
=
(
ReceiverMsg
)
intent
.
getSerializableExtra
(
PARAMS_MSG
);
//
ReceiverMsg msg = (ReceiverMsg) intent.getSerializableExtra(PARAMS_MSG);
taskMsg
=
msg
;
//
taskMsg = msg;
delayBean
=
msg
.
getTime_config
();
//
delayBean = msg.getTime_config();
step
=
0
;
//
step=0;
//
awakeWechat
(
getApplicationContext
());
//
awakeWechat(getApplicationContext());
}
//
}
//当service因为低内存被杀掉后,等内存足够时可以重启
//当service因为低内存被杀掉后,等内存足够时可以重启
return
START_STICKY
;
return
START_STICKY
;
}
}
//
@Subscribe
@Subscribe
//
public void receiverMsg(final ReceiverMsg msg) {
public
void
receiverMsg
(
final
ReceiverMsg
msg
)
{
//
Log.d("fei ", "receiverMsg");
Log
.
d
(
"fei "
,
"receiverMsg"
);
// if (!isHome(
)){
if
(!
findNodeByTexts
(
this
,
"微信"
,
"通讯录"
,
"发现"
,
"我"
)){
//
Log.d("fei ", "当前页不是首页");
Log
.
d
(
"fei "
,
"当前页不是首页"
);
//
showToast(getApplicationContext(),"当前页不是首页");
showToast
(
getApplicationContext
(),
"当前页不是首页"
);
//
turnBack(isFalse,2);
turnBack
(
isFalse
,
2
);
//
return;
return
;
//
}
}
//
//收到消息后 打开文件传输助手
//收到消息后 打开文件传输助手
//
Log.d("fei ", "点击文件传输助手");
Log
.
d
(
"fei "
,
"点击文件传输助手"
);
//
delayBean = msg.getTime_config();
delayBean
=
msg
.
getTime_config
();
//
if (delayBean == null){
if
(
delayBean
==
null
){
//
Log.d("fei ", "delayBean 是空");
Log
.
d
(
"fei "
,
"delayBean 是空"
);
//
}
}
//
// execShellCmd("input tap 220 200");
// execShellCmd("input tap 220 200");
//
//
//
// //发送触发的消息给service,难道微信没有触发?
//发送触发的消息给service,难道微信没有触发?
// delayDeal(delayBean.getAfter_open_weixin_file_helper_delay(), new IDelayMethord() {
delayDeal
(
delayBean
.
getAfter_open_weixin_file_helper_delay
(),
new
IDelayMethord
()
{
// @Override
@Override
// public void delayMethord() {
public
void
delayMethord
()
{
//
// clickDone = true;
clickDone
=
true
;
//// showToast(getApplicationContext(),"消息的 unique_id 是 " + msg.getUnique_id());
// showToast(getApplicationContext(),"消息的 unique_id 是 " + msg.getUnique_id());
//
// Log.d("fei ", "receiverMsg里面触发下页面消息 unique_id " + msg.getUnique_id());
Log
.
d
(
"fei "
,
"receiverMsg里面触发下页面消息 unique_id "
+
msg
.
getUnique_id
());
// WeChatStatus.receiverMsg();
WeChatStatus
.
receiverMsg
();
// Url = msg.getQr_addr();
String
Url
=
msg
.
getQr_addr
();
// Log.d("fei ", "receiverMsg里面触发下页面消息 Url " + Url);
Log
.
d
(
"fei "
,
"receiverMsg里面触发下页面消息 Url "
+
Url
);
// message_id = msg.getUnique_id();
String
message_id
=
msg
.
getUnique_id
();
// AccessibilityEvent accessibilityEvent = AccessibilityEvent.obtain(32);
taskMsg
=
msg
;
// accessibilityEvent.setClassName(WeChatUi);
AccessibilityEvent
accessibilityEvent
=
AccessibilityEvent
.
obtain
(
32
);
// onAccessibilityEvent(accessibilityEvent);
accessibilityEvent
.
setClassName
(
WeChatUi
);
// }
onAccessibilityEvent
(
accessibilityEvent
);
// });
}
//
});
//
// }
}
@Override
@Override
public
void
onAccessibilityEvent
(
AccessibilityEvent
event
)
{
public
void
onAccessibilityEvent
(
AccessibilityEvent
event
)
{
Log
.
d
(
"fei"
,
"NewService onAccessibilityEvent"
);
Log
.
d
(
"fei"
,
"NewService onAccessibilityEvent"
);
if
(!
EventBus
.
getDefault
().
isRegistered
(
this
)){
EventBus
.
getDefault
().
register
(
this
);
}
int
eventType
=
event
.
getEventType
();
int
eventType
=
event
.
getEventType
();
String
className
=
event
.
getClassName
().
toString
();
String
className
=
event
.
getClassName
().
toString
();
Log
.
d
(
TAG
,
"get event = "
+
eventType
+
" class "
+
className
+
" step "
+
step
);
Log
.
d
(
TAG
,
"get event = "
+
eventType
+
" class "
+
className
+
" step "
+
step
);
...
@@ -354,9 +361,9 @@ public class NewService extends AccessibilityService {
...
@@ -354,9 +361,9 @@ public class NewService extends AccessibilityService {
@Override
@Override
public
void
onInterrupt
()
{
public
void
onInterrupt
()
{
Log
.
d
(
"fei"
,
"NewService onInterrupt"
);
Log
.
d
(
"fei"
,
"NewService onInterrupt"
);
//
if (EventBus.getDefault().isRegistered(this)) {
if
(
EventBus
.
getDefault
().
isRegistered
(
this
))
{
//
EventBus.getDefault().unregister(this);
EventBus
.
getDefault
().
unregister
(
this
);
//
}
}
}
}
...
@@ -597,7 +604,8 @@ public class NewService extends AccessibilityService {
...
@@ -597,7 +604,8 @@ public class NewService extends AccessibilityService {
WeChatStatus
.
finishAll
();
WeChatStatus
.
finishAll
();
clickDone
=
false
;
clickDone
=
false
;
upResult
(
code
);
upResult
(
code
,
taskMsg
.
getUnique_id
());
resetAll
();
}
}
/**
/**
...
@@ -605,10 +613,10 @@ public class NewService extends AccessibilityService {
...
@@ -605,10 +613,10 @@ public class NewService extends AccessibilityService {
*
*
* @param code
* @param code
*/
*/
private
void
upResult
(
final
int
code
)
{
private
void
upResult
(
final
int
code
,
final
String
id
)
{
HttpClientApi
.
devicesScan
(
PushServiceFactory
.
getCloudPushService
().
getDeviceId
(),
HttpClientApi
.
devicesScan
(
PushServiceFactory
.
getCloudPushService
().
getDeviceId
(),
code
,
code
,
taskMsg
.
getUnique_id
()
,
id
,
new
HttpSubscriber
<
String
>()
{
new
HttpSubscriber
<
String
>()
{
@Override
@Override
public
void
onCompleted
()
{
public
void
onCompleted
()
{
...
@@ -617,7 +625,7 @@ public class NewService extends AccessibilityService {
...
@@ -617,7 +625,7 @@ public class NewService extends AccessibilityService {
@Override
@Override
public
void
onNext
(
String
responseBase
)
{
public
void
onNext
(
String
responseBase
)
{
showToast
(
getApplicationContext
(),
String
.
format
(
"code %d message_id %s 上报结果 %s"
,
code
,
taskMsg
.
getUnique_id
()
,
responseBase
));
showToast
(
getApplicationContext
(),
String
.
format
(
"code %d message_id %s 上报结果 %s"
,
code
,
id
,
responseBase
));
}
}
});
});
}
}
...
...
app/src/main/java/com/xf/weixinclick/bean/EnableResult.java
0 → 100644
View file @
d5909b40
package
com
.
xf
.
weixinclick
.
bean
;
/**
* 创建日期:2018/3/29 on 10:26
* 描述:
* 作者:Li
*/
public
class
EnableResult
{
/**
* id : 3
* name : a030
* code : a3eb1a52cdf6421fbd15ca8f647e70f4
* x : 0
* y : 0
* status : 1
* enable : 0
* battery : 100
* synced_at : 2018-03-29 10:22:42
* created_at : 2018-03-21 09:36:00
* updated_at : 2018-03-29 10:22:42
* deleted_at : null
* statusText : 正常
* batteryText : 100%
*/
private
int
id
;
private
String
name
;
private
String
code
;
private
int
x
;
private
int
y
;
private
int
status
;
private
String
enable
;
private
int
battery
;
private
String
synced_at
;
private
String
created_at
;
private
String
updated_at
;
private
Object
deleted_at
;
private
String
statusText
;
private
String
batteryText
;
public
int
getId
()
{
return
id
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
int
getX
()
{
return
x
;
}
public
void
setX
(
int
x
)
{
this
.
x
=
x
;
}
public
int
getY
()
{
return
y
;
}
public
void
setY
(
int
y
)
{
this
.
y
=
y
;
}
public
int
getStatus
()
{
return
status
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
public
String
getEnable
()
{
return
enable
;
}
public
void
setEnable
(
String
enable
)
{
this
.
enable
=
enable
;
}
public
int
getBattery
()
{
return
battery
;
}
public
void
setBattery
(
int
battery
)
{
this
.
battery
=
battery
;
}
public
String
getSynced_at
()
{
return
synced_at
;
}
public
void
setSynced_at
(
String
synced_at
)
{
this
.
synced_at
=
synced_at
;
}
public
String
getCreated_at
()
{
return
created_at
;
}
public
void
setCreated_at
(
String
created_at
)
{
this
.
created_at
=
created_at
;
}
public
String
getUpdated_at
()
{
return
updated_at
;
}
public
void
setUpdated_at
(
String
updated_at
)
{
this
.
updated_at
=
updated_at
;
}
public
Object
getDeleted_at
()
{
return
deleted_at
;
}
public
void
setDeleted_at
(
Object
deleted_at
)
{
this
.
deleted_at
=
deleted_at
;
}
public
String
getStatusText
()
{
return
statusText
;
}
public
void
setStatusText
(
String
statusText
)
{
this
.
statusText
=
statusText
;
}
public
String
getBatteryText
()
{
return
batteryText
;
}
public
void
setBatteryText
(
String
batteryText
)
{
this
.
batteryText
=
batteryText
;
}
}
app/src/main/java/com/xf/weixinclick/http/ClientApi.java
View file @
d5909b40
...
@@ -19,4 +19,6 @@ public interface ClientApi{
...
@@ -19,4 +19,6 @@ public interface ClientApi{
Observable
<
String
>
devices
(
@Body
Map
<
String
,
String
>
params
);
Observable
<
String
>
devices
(
@Body
Map
<
String
,
String
>
params
);
@POST
(
"devices/scan"
)
@POST
(
"devices/scan"
)
Observable
<
String
>
devicesScan
(
@Body
Map
<
String
,
String
>
params
);
Observable
<
String
>
devicesScan
(
@Body
Map
<
String
,
String
>
params
);
@POST
(
"devices/enable"
)
Observable
<
String
>
devicesEnable
(
@Body
Map
<
String
,
String
>
params
);
}
}
app/src/main/java/com/xf/weixinclick/http/HttpClientApi.java
View file @
d5909b40
...
@@ -158,6 +158,22 @@ public class HttpClientApi {
...
@@ -158,6 +158,22 @@ public class HttpClientApi {
});
});
}
}
/**
*
* @param device_code
* @param isEnable 0表示关闭设备,不接收请求 1表示接收任务
* @param subscriber
*/
public
static
void
enableListener
(
String
device_code
,
int
isEnable
,
Subscriber
subscriber
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"code"
,
device_code
);
map
.
put
(
"status"
,
isEnable
+
""
);
getInstance
().
devicesEnable
(
map
)
.
subscribeOn
(
io
)
.
observeOn
(
main
)
.
subscribe
(
subscriber
);
}
public
static
void
devicesScan
(
String
device_code
,
int
is_success
,
String
message_id
,
Subscriber
subscriber
)
{
public
static
void
devicesScan
(
String
device_code
,
int
is_success
,
String
message_id
,
Subscriber
subscriber
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"device_code"
,
device_code
);
map
.
put
(
"device_code"
,
device_code
);
...
...
app/src/main/java/com/xf/weixinclick/receiver/MyMessageReceiver.java
View file @
d5909b40
...
@@ -70,8 +70,8 @@ public class MyMessageReceiver extends MessageReceiver {
...
@@ -70,8 +70,8 @@ public class MyMessageReceiver extends MessageReceiver {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
NewService
.
showToast
(
context
,
String
.
format
(
"接收到消息,时间:%d秒前"
,
second
));
NewService
.
showToast
(
context
,
String
.
format
(
"接收到消息,时间:%d秒前"
,
second
));
//
EventBus.getDefault().post(msg);
EventBus
.
getDefault
().
post
(
msg
);
MainActivity
.
startWorkService
(
context
,
msg
);
//
MainActivity.startWorkService(context, msg);
}
else
{
}
else
{
NewService
.
showToast
(
context
,
String
.
format
(
"接收到消息,任务超时,时间:%d秒前"
,
second
));
NewService
.
showToast
(
context
,
String
.
format
(
"接收到消息,任务超时,时间:%d秒前"
,
second
));
}
}
...
...
app/src/main/res/layout/activity_main.xml
View file @
d5909b40
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<
android.support.design.widget.CoordinatorLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<LinearLayout
<LinearLayout
android:orientation=
"vertical"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
match_par
ent"
>
android:layout_height=
"
wrap_cont
ent"
>
<com.xf.weixinclick.customerview.CustomEditText
<com.xf.weixinclick.customerview.CustomEditText
android:id=
"@+id/cet_bind_user"
android:id=
"@+id/cet_bind_user"
...
@@ -49,6 +50,16 @@
...
@@ -49,6 +50,16 @@
android:background=
"#ff6600"
/>
android:background=
"#ff6600"
/>
<TextView
<TextView
android:id=
"@+id/tv_enable_listener"
android:gravity=
"center"
android:textSize=
"20sp"
tools:text=
"22222"
android:textColor=
"#fff"
android:layout_width=
"match_parent"
android:layout_height=
"100dp"
android:background=
"#fb3210"
/>
<TextView
android:id=
"@+id/tv_version_name"
android:id=
"@+id/tv_version_name"
android:layout_marginTop=
"@dimen/text_margin"
android:layout_marginTop=
"@dimen/text_margin"
android:layout_marginLeft=
"@dimen/text_margin"
android:layout_marginLeft=
"@dimen/text_margin"
...
@@ -57,4 +68,4 @@
...
@@ -57,4 +68,4 @@
tools:text=
"版本号"
/>
tools:text=
"版本号"
/>
</LinearLayout>
</LinearLayout>
</
android.support.design.widget.CoordinatorLayout
>
</
ScrollView
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment