-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain5.lua
More file actions
187 lines (183 loc) · 4.92 KB
/
main5.lua
File metadata and controls
187 lines (183 loc) · 4.92 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
require "import"
import "android.app.*"
import "android.os.*"
import "android.widget.*"
import "android.view.*"
import "android.graphics.drawable.ColorDrawable"
import "android.text.SpannableString"
import "android.text.style.ForegroundColorSpan"
import "android.text.Spannable"
import "mods.andlua"
import "mods.SnackerBar"
import "com.tencent.connect.*"
import "com.tencent.connect.common.*"
import "com.tencent.tauth.*"
AppId = "101488083"
ztt()
main10 = {
LinearLayout,
layout_height = "fill",
orientation = "vertical",
layout_width = "fill",
{
RelativeLayout,
layout_height = "fill",
backgroundColor = AndLuaB1,
layout_width = "-1",
{
ImageView,
layout_height = "55dp",
layout_width = "55dp",
id = "baw",
layout_centerInParent = "true",
src = "res/qqdl.png",
},
{
TextView,
textSize = "15sp",
layout_marginTop = "5dp",
layout_below = "baw",
text = getLS("L_QQ_login"),
layout_centerHorizontal = "true",
textColor = TitleColor1,
},
},
};
activity.setContentView(loadlayout(main10))
ztt()
ztl()
lj = ...
btl = {
LinearLayout,
layout_width = "fill",
elevation = "1dp",
layout_height = "55dp",
orientation = "horizontal",
{
LinearLayout,
layout_width = "55dp",
gravity = "center",
id = "Sideslip",
layout_height = "55dp",
layout_marginLeft = "-15dp",
{
ImageView,
layout_height = "25dp",
colorFilter = tonumber(bjzt()),
layout_width = "28dp",
src = "res/off.png",
},
},
{
LinearLayout,
layout_height = "fill",
layout_weight = "1",
orientation = "horizontal",
{
TextView,
layout_gravity = "center",
textSize = "18sp",
text = getLS("L_The_login"),
textColor = tonumber(bjzt()),
id = "bt",
singleLine = true,
},
},
};
activity.ActionBar.setDisplayShowCustomEnabled(true)
activity.ActionBar.setCustomView(loadlayout(btl))
activity.ActionBar.setBackgroundDrawable(ColorDrawable(AndLuaB1))
activity.ActionBar.setElevation(6)
bw(Sideslip, 0x5FFFFFFF)
Sideslip.onClick = function()
activity.finish()
end
bw(baw, 0xFFDDDDDD)
mTencent = Tencent.createInstance(AppId, this)
mIUiListener = IUiListener({
onComplete = function(p1)
if (null == p1) then
SnackerBar.build()
:msg(getLS("L_Login_failed"))
:actionText(getLS("L_OK"))
:action(function()
end)
:show()
return
end
jsonResponse = p1;
if (null ~= jsonResponse and jsonResponse.length() == 0) then
SnackerBar.build()
:msg(getLS("L_Login_failed"))
:actionText(getLS("L_OK"))
:action(function()
end)
:show()
return;
end
a = jsonResponse.toString()
sid3 = a:match('%"openid":"(.-)%","')
Http.post("https://ly250.cn/andlua/admin.php", "openid=" .. sid3 .. "&sid=" .. sid(), function(a1, b, c, d)
sid2 = b:match('%["ret"] = "(.-)%";')
if sid2 == "0" then
activity.newActivity("main6", { sid3 })
elseif sid2 == "1" then
Http.post("https://ly250.cn/andlua/admin.php", "openid=" .. sid3 .. "&sid=" .. sid(), function(a1, b, c, d)
sid2 = b:match('%["ret"] = "(.-)%";')
if sid2 == "0" then
activity.newActivity("main6", { sid3 })
elseif sid2 == "1" then
SnackerBar.build()
:msg(getLS("L_You_submit"))
:actionText(getLS("L_OK"))
:action(function()
end)
:show()
elseif sid2 == "true" then
u6 = activity.getLuaDir() .. "/res/set6.LY"
io.open(u6, "w"):write("true"):close()
activity.result({ "", "", "注销" })
elseif sid2 == "false" then
SnackerBar.build()
:msg(getLS("L_Login_failed"))
:actionText(getLS("L_OK"))
:action(function()
end)
:show()
else
end
end)
elseif sid2 == "true" then
u6 = activity.getLuaDir() .. "/res/set6.LY"
io.open(u6, "w"):write("true"):close()
activity.result({ "", "", "注销" })
elseif sid2 == "false" then
SnackerBar.build()
:msg(getLS("L_Login_failed"))
:actionText(getLS("L_OK"))
:action(function()
end)
:show()
else
end
end)
end
})
function onActivityResult(requestCode, resultCode, data)
if requestCode == Constants.REQUEST_LOGIN or requestCode == Constants.REQUEST_APPBAR then
Tencent.onActivityResultData(requestCode, resultCode, data, mIUiListener);
end
end
baw.onClick = function()
SnackerBar.build()
:msg(getLS("L_Is_to_raise_QQ_login"))
:actionText(getLS("L_OK"))
:action(function()
end)
:show()
mTencent.login(this, "all", mIUiListener, true)
end
function onResult(name, ...)
a, b, c = ...
activity.result({ a, b, c })
end