Skip to content

Commit

Permalink
feat:脚本更新,适配微信6.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
coder-pig committed Aug 4, 2018
1 parent 3f7ec48 commit 3a89de5
Show file tree
Hide file tree
Showing 7 changed files with 223 additions and 175 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/com/coderpig/wechathelper/Constant.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ class Constant {
companion object {
val GROUP_NAME ="group_name"
val ADD_FRIENDS ="add_friends"
val UPDATE_GROUP_PEOPLE ="update_group_people"
val FRIEND_LIST = "friend_list"
val FRIEND_SQUARE ="friend_square"
val RED_PACKET ="red_packet"
val MEMBER_LIST = "member_list"
}
}
30 changes: 30 additions & 0 deletions app/src/main/java/com/coderpig/wechathelper/ControlActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ import android.content.Intent
import android.os.Bundle
import android.provider.Settings
import android.support.v7.app.AppCompatActivity
import android.util.Log
import com.orhanobut.hawk.Hawk
import kotlinx.android.synthetic.main.activity_control.*


/**
* 描述:辅助服务控制页
*
* @author CoderPig on 2018/04/12 10:50.
*/
class ControlActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_control)
Expand All @@ -24,6 +27,15 @@ class ControlActivity : AppCompatActivity() {
cb_add_friends.isChecked = Hawk.get(Constant.ADD_FRIENDS,false)
cb_friends_square.isChecked = Hawk.get(Constant.FRIEND_SQUARE,false)
cb_catch_red_packet.isChecked = Hawk.get(Constant.RED_PACKET,false)
val members = Hawk.get(Constant.MEMBER_LIST, mutableListOf<String>())
if(members.size > 0) {
val sb = StringBuilder()
for (member in members) {
sb.append(member).append("\n")
}
ed_friends.setText(sb.toString())
}

btn_sure.setOnClickListener({
Hawk.put(Constant.GROUP_NAME, ed_group_name.text.toString())
shortToast("群聊名称已保存!")
Expand All @@ -33,6 +45,24 @@ class ControlActivity : AppCompatActivity() {
shortToast("群聊名称已清除!")
ed_group_name.setText("")
})

btn_write.setOnClickListener({
val memberList = (ed_friends.text.toString()).split("\n").filter{it.trim() != ""}
Hawk.put(Constant.MEMBER_LIST, memberList)
Log.e("Test",memberList.toString())
shortToast("数据写入成功!")
})

btn_reset.setOnClickListener({
Hawk.put(Constant.MEMBER_LIST, mutableListOf<String>())
ed_friends.setText("")
shortToast("数据重置成功!")
})

btn_open_wechat.setOnClickListener {
val intent = packageManager.getLaunchIntentForPackage("com.tencent.mm")
startActivity(intent)
}
btn_open_accessbility.setOnClickListener({
startActivity(Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS))
})
Expand Down
Loading

0 comments on commit 3a89de5

Please sign in to comment.