-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathPreferenceUtil.java
More file actions
426 lines (324 loc) · 14.1 KB
/
Copy pathPreferenceUtil.java
File metadata and controls
426 lines (324 loc) · 14.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
package preference;
import com.javaer.javaer.Main;
import java.util.Random;
import de.robv.android.xposed.XSharedPreferences;
/**
* Created by Administrator on 2018/3/6.
*/
public class PreferenceUtil {
private static XSharedPreferences instance = null;
private static XSharedPreferences WXinstance = null;
public static boolean noForbid = true;//未禁止 = 真
public static String je_kp = "";
private static XSharedPreferences getInstance(){
if (instance == null){
instance = new XSharedPreferences(Main.MM_PKG, Main.Javaer_PKG);
instance.makeWorldReadable();
}else {
instance.reload();
}
return instance;
}
private static XSharedPreferences getWXInstance(){
if (WXinstance == null){
WXinstance = new XSharedPreferences(Main.MM_PKG, Main.MM_PKG+"_preference");
WXinstance.makeWorldReadable();
}else {
WXinstance.reload();
}
return WXinstance;
}
public static String selfWXID(){//获取自己wxid
return getWXInstance().getString("login_weixin_username", "");
}
public static String selfWECHAT(){//微信号
return getWXInstance().getString("login_user_name","");
}
public static String selfQQ(){//绑定的QQ
return getWXInstance().getString("last_login_bind_qq", "");
}
public static String selfMAIL(){//绑定的邮箱
return getWXInstance().getString("last_login_bind_email", "");
}
public static String selfPHONE(){//绑定的手机号
return getWXInstance().getString("last_login_bind_mobile", "");
}
public static boolean isChatManage(){//群聊管理
return getInstance().getBoolean("chat_manage", false);
}
//----
public static boolean isEnableEditableForwardSns(){//可编辑式转发朋友圈
return getInstance().getBoolean("editable_forward_sns_timeline", false);
}
public static boolean isEnableForward(){//转发
return getInstance().getBoolean("chat_forward_to_chat", false);
}
public static boolean isEnableRecordAutoForward(){//记录自动转发
return getInstance().getBoolean("message_record_auto_forward", false);
}
public static boolean isEnableQuickForwardSns(){//快速转发朋友圈
return getInstance().getBoolean("quick_forward_sns_timeline", false);
}
//----
public static String getRecordAutoForwardUser(){//获取最近的User
return getInstance().getString("record_auto_forward_user", "");
}
public static long getRecordStartTime(){//获取开始时间
return getInstance().getLong("record_auto_forward_start_time", 0);
}
public static long getRecordEndTime(){//获取结束时间
return getInstance().getLong("record_auto_forward_end_time", 0);
}
//----
public static boolean isSendManageOrder(){//发送管理员指令
return getInstance().getBoolean("send_manage_order", false);
}
public static boolean isAvoidBeAT(){//阻止[有人@我]提示
return getInstance().getBoolean("avoid_be_at", false);
}
public static boolean isForbid(){//踢出私自添加群成员者
return getInstance().getBoolean("forbid_add_private", false);
}
//----
public static boolean isEnableRobot(){//图灵机器人
return getInstance().getBoolean("v_tuling_robot", false);
}
public static String getTulingKey(){//读取图灵key
return getInstance().getString("tuling_robot_key", "");
}
public static boolean isRobotDelayReply(){//开启机器人延迟回复
return getInstance().getBoolean("robot_reply_delay", false);
}
public static int getRobotDelayTime(){//设置机器人延迟时间
return Integer.parseInt(getInstance().getString("time_robot_reply_delay", "2"));
}
public static boolean isEnableRobotReplyTroop(){//是否允许机器人回复群聊
return getInstance().getBoolean("enable_robot_reply_troop", false);
}
public static boolean isAutoReply(){//自动回复
return getInstance().getBoolean("v_auto_reply", false);
}
public static boolean isEnableReplyTroop(){//允许回复群聊
return getInstance().getBoolean("enable_auto_reply_troop", true);
}
public static boolean isEnableAutoReplyDelay(){//是否延迟
return getInstance().getBoolean("is_reply_delay", false);
}
public static int getReplyDelay(){//设置回复延迟
return Integer.parseInt(getInstance().getString("time_reply_delay", "3"));
}
public static boolean isReplySignature(){//是否回复签名
return getInstance().getBoolean("auto_reply_signature", false);
}
public static String getReplySignature(){//读取签名
return getInstance().getString("reply_signature", "[本消息是自动回复]");
}
//----
public static boolean isMutiAccept(){//手动批量接受好友
return getInstance().getBoolean("muti_accept", false);
}
public static boolean isAutoAccept(){//自动接受好友请求开关
return getInstance().getBoolean("auto_accept", false);
}
public static boolean isReplyAfterAccept(){//接受好友后自动回复
return getInstance().getBoolean("reply_after_accept", false);
}
public static String replyText(){//回复文字
return getInstance().getString("reply_text", "");
}
public static boolean isDelayAccept(){//回复延迟
return getInstance().getBoolean("reply_delay", false);
}
public static int delayAcceptTime(){//延迟时间
return Integer.parseInt(getInstance().getString("reply_delay_time", "2"));
}
public static boolean isOneClick(){//运动点赞开关
return getInstance().getBoolean("one_click", false);
}
//----
public static boolean isAutoConfirmLogin(){//电脑登录自动确认
return getInstance().getBoolean("auto_confirm_login", false);
}
public static boolean isShowWxid(){//显示微信ID
return getInstance().getBoolean("show_wxid", false);
}
public static boolean isCustomSplash(){//启动图
return getInstance().getBoolean("custom_splash", false);
}
public static boolean isCustomRing(){//铃声开关
return getInstance().getBoolean("custom_ringtone", false);
}
public static boolean isCustomArea(){//自定义地区
return getInstance().getBoolean("custom_area", false);
}
public static String customText(){//地区文字
return getInstance().getString("area_text", "");
}
public static boolean isCustomEmoji(){//表情上限
return getInstance().getBoolean("custom_emoji_num", false);
}
public static String customEmojiSize(){//上限数量
return getInstance().getString("emoji_max", "300");
}
public static boolean isControlRandom(){//自定义骰子
return getInstance().getBoolean("control_random", false);
}
public static int randomMode(){//9002-->单发, 9001-->连发
return getInstance().getInt("random_mode", 9002);
}
public static int randomMode0(){//猜拳随机模式9002-->单发, 9001-->连发
return getInstance().getInt("random_mode_0", 9002);
}
public static String multiSend(){//骰子连发模式
return getInstance().getString("multi_send", "1");
}
public static String multiSend0(){//猜拳连发模式
return getInstance().getString("multi_send_0", "1");
}
public static int randomResult1(){//猜拳
return Integer.parseInt(getInstance().getString("random_result_0", "0"));
}
public static int randomResult2(){//骰子
return Integer.parseInt(getInstance().getString("random_result_1", "0"));
}
public static boolean isFakeVoiceLength(){//开启语音误报
return getInstance().getBoolean("is_fake_voice_length", false);
}
public static long fakeVoiceLength(){//故意误报时长
String s = getInstance().getString("fake_voice_length", "1");
return Integer.parseInt(s) * 1000;
}
public static boolean isFakeLocation(){//开启虚拟定位
return getInstance().getBoolean("is_fake_location", false);
}
public static double latitude(){//返回纬度
String lan = getInstance().getString("fake_location", "39.90469,116.40717").replace(",", ",");
return Double.parseDouble(lan.split(",")[0]);
}
public static double longitude(){//返回纬度
String lon = getInstance().getString("fake_location", "39.90469,116.40717").replace(",", ",");
return Double.parseDouble(lon.split(",")[1]);
}
public static boolean isSnsInfoRevoke(){//朋友圈动态撤回开关
return getInstance().getBoolean("sns_info_revoke", false);
}
public static boolean isSnsMomentRevoke(){//朋友圈评论撤回
return getInstance().getBoolean("sns_moment_revoke", false);
}
//----
public static boolean isTextToVoice(){//文本消息转语音开关
return getInstance().getBoolean("text_to_voice", false);
}
public static boolean isPlaySender(){//播报发送人
return getInstance().getBoolean("play_sender", false);
}
//----
public static boolean isLuckyMoney(){//抢红包开关
return getInstance().getBoolean("lucky_money", false);
}
public static boolean noSelfLucky(){//不抢自己发的
return getInstance().getBoolean("no_self", false);
}
public static boolean noPrivateLucky(){//不抢私聊
return getInstance().getBoolean("no_private", false);
}
public static boolean noContainLucky(){//不抢包含关键词
return getInstance().getBoolean("no_contain", false);
}
public static String noContainWords(){//关键词
return getInstance().getString("no_contain_text", "");
}
public static boolean autoTransfer(){//自动接收转账开关
return getInstance().getBoolean("auto_transfer", false);
}
public static boolean isTransferReply(){//收到转账自动回复
return getInstance().getBoolean("transfer_reply", false);
}
public static String transferReplyWords(){//设置收到转账回复语
return getInstance().getString("transfer_words", "[收到]");
}
public static boolean isPlayTransferDetail(){//播报收账详情
return getInstance().getBoolean("play_transfer_detail", false);
}
public static boolean isPlayTransferSender(){//播报发送人
return getInstance().getBoolean("play_transfer_sender", false);
}
public static boolean isTransferDelay(){//随机延迟
return getInstance().getBoolean("transfer_delay", false);
}
public static int transferRandomDelay(){//延迟时间
String delay = getInstance().getString("transfer_random_delay", "");
if (delay.equals(""))
return 0;
String[] dly = delay.split("-");
int i = new Random().nextInt(Integer.parseInt(dly[1]) - Integer.parseInt(dly[0]) + 1) + Integer.parseInt(dly[0]);
return i;
}
public static String sayHelloText(){//打招呼用语
return getInstance().getString("say_hello_text", "你好");
}
public static int sayHelloDelay(){//延迟
return Integer.parseInt(getInstance().getString("say_hello_delay", "15"));
}
public static int sayHelloMaxNum(){//限制最大数
return Integer.parseInt(getInstance().getString("max_num", "15"));
}
public static boolean isAddRadarFriend(){//添加雷达好友
return getInstance().getBoolean("add_radar_friend", false);
}
public static boolean isAddChatroomFriend(){//添加群成员为好友
return getInstance().getBoolean("add_chatroom_friend", false);
}
public static boolean isAddNearbyFriend(){//添加附近人
return getInstance().getBoolean("add_nearby_friend", false);
}
public static boolean isLabelNewFriend(){//按日期标签新加好友
return getInstance().getBoolean("label_for_new_friends", false);
}
public static boolean isQuickRead(){//快捷已读
return getInstance().getBoolean("quick_read", false);
}
public static boolean isQuickUnRead(){//快捷未读
return getInstance().getBoolean("quick_unread", true);
}
public static boolean isQuickClearConversation(){//清空聊天
return getInstance().getBoolean("quick_clear_conversation", false);
}
public static int searchMode(){//搜索僵尸粉模式0-->发消息,1-->建群
return getInstance().getInt("search_mode", 1);
}
public static boolean isSearchingDead(){//是否在搜索僵尸粉---数据库插入时判断
return getInstance().getBoolean("is_searching_dead", false);
}
public static boolean searchDeadFans(){//搜索僵尸粉
return getInstance().getBoolean("search_dead_fans", false);
}
public static String searchChatroom(){//搜索僵尸粉使用的chatroom
return getInstance().getString("search_dead_chatroom", "");
}
public static String searchDeadText(){//发送僵尸粉文字
return getInstance().getString("search_dead_text", "Hi");
}
public static int searchDeadDelay(){//延时
return Integer.parseInt(getInstance().getString("search_dead_delay", "5"));
}
public static boolean autoDeleteFans(){//自动删除找到的僵尸粉
return getInstance().getBoolean("auto_delete_fans", false);
}
public static String deadFans(){//僵尸粉列表
return getInstance().getString("dead_fans", "");
}
//
public static boolean isBlockSnsAD(){//屏蔽朋友圈广告
return getInstance().getBoolean("block_sns_ad", false);
}
public static boolean isSnsAutoLike(){//自动点赞
return getInstance().getBoolean("sns_auto_like", false);
}
public static boolean isSnsAutoComment(){//自动评论
return getInstance().getBoolean("sns_auto_comment", false);
}
public static String snsAutoCommentText(){
return getInstance().getString("sns_auto_comment_text", "朋友圈自动评论");
}
}