赞
踩
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
|
#!/usr/bin/python
# lrdcq
# usage python wxapkg_unpack.py filename, unpack at filename.unpack
import
sys,os
import
struct
class
WxapkgFile:
nameLen
=
0
name
=
""
offset
=
0
size
=
0
with
open
(sys.argv[
1
],
"rb"
) as f:
root
=
os.path.dirname(os.path.realpath(f.name))
name
=
os.path.basename(f.name)
#read header
firstMark
=
struct.unpack(
'B'
, f.read(
1
))[
0
]
print
'first header mark = '
+
str
(firstMark)
info1
=
struct.unpack(
'>L'
, f.read(
4
))[
0
]
print
'info1 = '
+
str
(info1)
indexInfoLength
=
struct.unpack(
'>L'
, f.read(
4
))[
0
]
print
'indexInfoLength = '
+
str
(indexInfoLength)
bodyInfoLength
=
struct.unpack(
'>L'
, f.read(
4
))[
0
]
print
'bodyInfoLength = '
+
str
(bodyInfoLength)
lastMark
=
struct.unpack(
'B'
, f.read(
1
))[
0
]
print
'last header mark = '
+
str
(lastMark)
if
firstMark !
=
190
or
lastMark !
=
237
:
print
'its not a wxapkg file!!!!!'
exit()
fileCount
=
struct.unpack(
'>L'
, f.read(
4
))[
0
]
print
'fileCount = '
+
str
(fileCount)
#read index
fileList
=
[]
for
i
in
range
(fileCount):
data
=
WxapkgFile()
data.nameLen
=
struct.unpack(
'>L'
, f.read(
4
))[
0
]
data.name
=
f.read(data.nameLen)
data.offset
=
struct.unpack(
'>L'
, f.read(
4
))[
0
]
data.size
=
struct.unpack(
'>L'
, f.read(
4
))[
0
]
print
'readFile = '
+
data.name
+
' at Offset = '
+
str
(data.offset)
fileList.append(data)
#save files
for
d
in
fileList:
d.name
=
'/'
+
name
+
'.unpack'
+
d.name
path
=
root
+
os.path.dirname(d.name)
if
not
os.path.exists(path):
os.makedirs(path)
w
=
open
(root
+
d.name,
'w'
)
f.seek(d.offset)
w.write(f.read(d.size))
w.close()
print
'writeFile = '
+
root
+
d.name
f.close()
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
//h.class
if
(paramString.dOS ==
null
) {
paramString.dOS = (paramString.RA() +
"page-frame.html"
);
}
paramString.loadUrl(paramString.dOS);
//l.class
final
String RA()
{
if
(
this
.dOR ==
null
) {
this
.dOR = (
"https://servicewechat.com/"
+
this
.dzg +
"/"
+ com.tencent.mm.plugin.appbrand.a.mr(
this
.dzg).dDB.dBs +
"/"
);
}
return
this
.dOR;
}
|
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
|
this
.dWV =
new
AppBrandJSInterface(
this
);
if
(com.tencent.smtt.sdk.aa.fM(com.tencent.mm.sdk.platformtools.aa.getContext()))
{
this
.dzh =
new
i(com.tencent.mm.sdk.platformtools.aa.getContext(),
this
.dWV,
"WeixinJSCore"
);
g.iuh.a(434L, 2L, 1L,
false
);
v.i(
"MicroMsg.AppBrandService"
,
"Using X5 Javascript Engine"
);
g.iuh.a(434L, 0L, 1L,
false
);
OJ();
paramContext = com.tencent.mm.plugin.appbrand.appcache.b.aq(
this
.dzg,
"WAService.js"
);
g.iuh.a(370L, 5L, 1L,
false
);
if
(!be.kS(paramContext)) {
break
label258;
}
v.e(
"MicroMsg.AppBrandService"
,
"get Null Or Nil service js"
);
g.iuh.a(370L, 6L, 1L,
false
);
}
for
(;;)
{
paramContext = com.tencent.mm.plugin.appbrand.appcache.b.aq(
this
.dzg,
"app-service.js"
);
g.iuh.a(370L, 9L, 1L,
false
);
if
(!be.kS(paramContext)) {
break
label281;
}
v.e(
"MicroMsg.AppBrandService"
,
"get Null Or Nil app-service js"
);
g.iuh.a(370L, 10L, 1L,
false
);
return
;
this
.dzh =
new
h(com.tencent.mm.sdk.platformtools.aa.getContext(),
this
.dWV,
"WeixinJSCore"
);
g.iuh.a(434L, 1L, 1L,
false
);
v.i(
"MicroMsg.AppBrandService"
,
"Using WebView Based Javascript Engine"
);
break
;
label258:
com.tencent.mm.plugin.appbrand.k.c.a(
this
.mContext,
this
.dzh, paramContext,
new
c.a()
{
public
final
void
OK()
{
v.e(
"MicroMsg.AppBrandService"
,
"service inject library js fail"
);
g.iuh.a(370L, 6L, 1L,
false
);
com.tencent.mm.plugin.appbrand.report.a.S(f.
this
.dzg,
24
);
}
public
final
void
onSuccess()
{
f.
this
.dzh.evaluateJavascript(
"wx.version"
,
new
u() {});
g.iuh.a(370L, 7L, 1L,
false
);
}
});
}
|
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
|
_inputKey:
function
(e) {
var
t = e.target.value;
if
(
this
._value = t,
this
._checkPlaceholderStyle(t),
this
.bindinput) {
var
n = {
id:
this
.$$.id,
dataset:
this
.dataset,
offsetTop:
this
.$$.offsetTop,
offsetLeft:
this
.$$.offsetLeft
};
WeixinJSBridge.publish(
"SPECIAL_PAGE_EVENT"
, {
eventName:
this
.bindinput,
data: {
ext: {
setKeyboardValue: !0
},
data: {
type:
"input"
,
timestamp: Date.now(),
detail: {
value: e.target.value,
cursor:
this
.$.input.selectionStart
},
target: n,
currentTarget: n,
touches: []
},
eventName:
this
.bindinput
}
})
}
return
! 1
},
|
其中有意思的是这些native实现的view出现在了文档scroll-view的tips中:“请勿在 scroll-view 中使用 textarea、map、canvas、video 组件”。想想确实可以理解,如果是在web第一层塞入的native控件,可以很方便的让native控件和网页一起滚动;而scroll-view显然只是个html的div实现的,native很难监听到div里面的滚动,当然也没发让这些native的控件一起滚,因此就gg了。
来源:http://lrdcq.com/me/read.php/66.htm
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。