Skip to content

Commit 3a89de5

Browse files
committed
feat:脚本更新,适配微信6.6.7
1 parent 3f7ec48 commit 3a89de5

File tree

7 files changed

+223
-175
lines changed

7 files changed

+223
-175
lines changed

app/src/main/java/com/coderpig/wechathelper/Constant.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ class Constant {
99
companion object {
1010
val GROUP_NAME ="group_name"
1111
val ADD_FRIENDS ="add_friends"
12+
val UPDATE_GROUP_PEOPLE ="update_group_people"
1213
val FRIEND_LIST = "friend_list"
1314
val FRIEND_SQUARE ="friend_square"
1415
val RED_PACKET ="red_packet"
16+
val MEMBER_LIST = "member_list"
1517
}
1618
}

app/src/main/java/com/coderpig/wechathelper/ControlActivity.kt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ import android.content.Intent
44
import android.os.Bundle
55
import android.provider.Settings
66
import android.support.v7.app.AppCompatActivity
7+
import android.util.Log
78
import com.orhanobut.hawk.Hawk
89
import kotlinx.android.synthetic.main.activity_control.*
910

11+
1012
/**
1113
* 描述:辅助服务控制页
1214
*
1315
* @author CoderPig on 2018/04/12 10:50.
1416
*/
1517
class ControlActivity : AppCompatActivity() {
18+
1619
override fun onCreate(savedInstanceState: Bundle?) {
1720
super.onCreate(savedInstanceState)
1821
setContentView(R.layout.activity_control)
@@ -24,6 +27,15 @@ class ControlActivity : AppCompatActivity() {
2427
cb_add_friends.isChecked = Hawk.get(Constant.ADD_FRIENDS,false)
2528
cb_friends_square.isChecked = Hawk.get(Constant.FRIEND_SQUARE,false)
2629
cb_catch_red_packet.isChecked = Hawk.get(Constant.RED_PACKET,false)
30+
val members = Hawk.get(Constant.MEMBER_LIST, mutableListOf<String>())
31+
if(members.size > 0) {
32+
val sb = StringBuilder()
33+
for (member in members) {
34+
sb.append(member).append("\n")
35+
}
36+
ed_friends.setText(sb.toString())
37+
}
38+
2739
btn_sure.setOnClickListener({
2840
Hawk.put(Constant.GROUP_NAME, ed_group_name.text.toString())
2941
shortToast("群聊名称已保存!")
@@ -33,6 +45,24 @@ class ControlActivity : AppCompatActivity() {
3345
shortToast("群聊名称已清除!")
3446
ed_group_name.setText("")
3547
})
48+
49+
btn_write.setOnClickListener({
50+
val memberList = (ed_friends.text.toString()).split("\n").filter{it.trim() != ""}
51+
Hawk.put(Constant.MEMBER_LIST, memberList)
52+
Log.e("Test",memberList.toString())
53+
shortToast("数据写入成功!")
54+
})
55+
56+
btn_reset.setOnClickListener({
57+
Hawk.put(Constant.MEMBER_LIST, mutableListOf<String>())
58+
ed_friends.setText("")
59+
shortToast("数据重置成功!")
60+
})
61+
62+
btn_open_wechat.setOnClickListener {
63+
val intent = packageManager.getLaunchIntentForPackage("com.tencent.mm")
64+
startActivity(intent)
65+
}
3666
btn_open_accessbility.setOnClickListener({
3767
startActivity(Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS))
3868
})

0 commit comments

Comments
 (0)