|

( m! w3 @, B! ~- v8 f3 m首先,SDK项目需要引用sdk的类库,位置在 安装目录\xcontrol.core.dll 如 C:\Program Files\南宁侠客网络科技有限公司\侠客手机群控引擎\xcontrol.core.dll. x; z3 k8 I- l+ U- t- P
: \# N2 p7 H9 G2 Y/ [; m8 j. S( c" G
可用方法如下:" x' w% L: H8 M/ s
- public void ShowLogConsole([string title = 插件调试日志])
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 显示日志控制台
6 [' X2 X& Q* ^; g
5 b4 ]; l9 R. V/ G d- public string Click(int x, int y)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 点击
- 参数:
- x: x坐标
- y: y坐标
- 返回结果:
. U1 o" j5 j7 ?4 h% L0 l1 X3 Z% @6 j ! c, V5 w4 L9 I: V3 S# K
- public abstract string Name()
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 模块名称
- 返回结果:
8 z/ S6 S) V% w, E3 m. o( b! ?1 y9 U , B3 V$ i0 w/ O" ~$ h6 [; n! z
- public abstract string Description()
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 模块描述
- 返回结果:+ ?/ Q9 }0 y: Q% r+ }3 g( \
5 Y6 R) Y% [. f; I% S2 J$ @ q. o p
- public abstract void RunScript()
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 模块执行过程
- 返回结果:
. P1 b# `) |' @9 j" I' n 2 z7 F: S, [% R8 b/ \
- public string Drag(int startx, int starty, int endx, int endy)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 拖动
- 参数:
- startx: 起始x坐标
- starty: 起始y坐标
- endx: 结束x坐标
- endy: 结束y坐标
- 返回结果:
! ~6 m: o( r p8 e
* U8 ]2 Y7 s; U- public string FindAndCLickAndClearObj(string text, [int index = 0])
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 查找并点击并清空(精确匹配模式)
- 参数:
- text: 资源id或类名或特征字符
- index: 索引,表示作用于匹配的第几个结果
- 返回结果:2 O$ b" s& e0 E9 J. E
6 ^. l: f/ M4 w! K; N1 x* e2 l& @
- public string FindAndCLickAndClearObjByRegex(string regex, [int index = 0])
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 查找并点击并清空(正则模式)
- 参数:
- regex: 资源id或类名或特征字符(支持正则表达式)
- index: 索引,表示作用于匹配的第几个结果
- 返回结果:
7 R# _. {2 v- K; r; G: }8 w s |2 O% l) e6 b8 L+ b
- public string FindAndCLickObj(string text, [int index = 0])
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 查找并点击元素(精确匹配模式)
- 参数:
- text: 资源id或类名或特征字符
- index: 索引,表示作用于匹配的第几个结果
- 返回结果:
( a) y. m2 T% Q5 K. r8 m9 T( q, L ) R. x& p: B8 g9 [4 @# g7 h
- public string FindAndCLickObjByRegex(string regex, [int index = 0])
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 查找并点击元素(基于正则表达式)
- 参数:
- regex: 资源id或类名或特征字符(支持正则表达式)
- index: 索引,表示作用于匹配的第几个结果
- 返回结果:
! h0 h" L! _- d% o$ {, W" o, O
% d, i$ ?( e3 R; S' `1 J& [ p- public string FindAndInutText(string name, string text, [int index = 0])
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 查找并赋值(一般用于文本框)
- 参数:
- name: 资源id或类名或特征字符(支持正则表达式)
- text: 输入的文本
- index: 索引,表示作用于匹配的第几个结果
- 返回结果:
, {: C2 L$ A, x4 K6 P ) C( c, V9 M' C* w+ m( l$ T
- public string FindObj(string text)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 精确匹配查找元素
- 参数:
- text: 资源id或类名或特征字符
- 返回结果:7 a& K. ~( [% R( x1 n% ~
" x- g+ u& c0 L3 n u, z0 g* m
- public string FindObjByRegex(string regex)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 基于正则查找元素
- 参数:
- regex: 资源id或类名或特征字符(支持正则表达式)
- 返回结果:! v; `/ J: w% f3 `5 b0 `/ B1 K
) }7 o e; w4 g- g' X) r5 e- ^; ?- public string GetLoction()
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 读取手机的GPS坐标
- 返回结果:
3 j; S) a8 a' ?2 E) y1 d : V; |5 e" Y7 p2 e
- public System.Collections.Generic.List<string> GetUiTexts(string regex)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 获取元素文本
- 参数:
- regex: 资源id或类名或特征字符(支持正则表达式)
- 返回结果:
* v* a+ ~4 U& u' `2 Q3 x- l 4 C" S# \9 v. C% v( l
- public void InputText(string text)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 通过输入法输入文本
- 参数:
- text: 要输入的内容: x1 c4 P' ~( s+ n9 _0 N! i" Z
+ x+ s3 _: l8 e- public void OpenUserChat(string userid)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 打开用户对话界面
- 参数:
- userid: 微信id,可以是真实id也可以是加密id,或者群id、公众号id$ }$ j& b! S+ U% m" ]3 a
# P2 w5 S7 q6 e1 @" U
- public string PressKeyCode(int keycode)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 发送按键
- 参数:
- keycode: 按键代码(可参考安卓keyevent)
- 返回结果:4 t; e; D3 t2 m- | K$ |
* C; X$ t" C0 h/ ~% y- public string RunAdb(string adbcmd)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 在手机上执行执行ADB命令
- 参数:
- adbcmd: adb命令
- 返回结果:
/ J$ T' u% @* \* R5 B( ~ , X. [; h! l3 H
- public string SendIntent(System.Collections.Generic.Dictionary<string, string> dic)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 发送Intnet
- 参数:
- dic: key value形式的intnet值
- 返回结果:
4 |$ N3 l' e/ T7 C# K * R8 y/ f" z. m2 g
- public void SetAirPlane(bool ison)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 设置飞行模式
- 参数:
- ison: 是否开启飞行模式
! y% G# b( x$ k. l6 @
' F( I! P$ g" u% q4 b* p% m- public void SetImei(string imei)
- AndroidControlSDK.AndroidScript 的成员
- o! C& J8 x* A) |" p+ A% k
/ O- e9 ?) D4 P* `6 f- public void SetLoction(string loction)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 设置手机的GPS坐标
- 参数:
- loction:
6 S1 O4 Y& f7 p8 X6 u
3 ?4 T7 @2 A& q" Q Y- public void SetMacAddress(string macaddress)
- AndroidControlSDK.AndroidScript 的成员0 r! k0 X; {# G! z1 T
' S$ \# r# l/ W' O" m
- public void SetSid(string sid)
- AndroidControlSDK.AndroidScript 的成员9 j$ Y; @/ r' U2 W, x5 p
, y/ l' C! G$ G2 x9 g8 J* P5 l# {* B- public void SetSim(string sim)
- AndroidControlSDK.AndroidScript 的成员 B8 x6 n+ I* [4 p1 T8 ?
+ ^" b& A7 e% H' _8 D4 t9 `/ [6 _
- public void ShowStatus(string status)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 显示脚本状态
- 参数:
- status: 状态+ h7 [/ [1 H* T0 s# U9 Y2 ~
8 f% n2 |( s) t4 }) b- public void ShowStatus(string status, System.Windows.Media.Color color)
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 显示脚本状态
- 参数:
- status: 状态
- color: 文字颜色
) }' E. u, d* F% d. j2 x0 ]$ H1 ^# I
X9 t' s, P3 r3 u! t1 [5 X- public void StartWeixin()
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 进入微信
9 J! H7 g! i4 m$ ], I, q d - \) d( ]. Q3 |# ^1 z, z: e( S9 ~
- public void YaoYiXia()
- AndroidControlSDK.AndroidScript 的成员
- 摘要:
- 摇一摇$ u8 {3 t. t" `2 c& s' t
关闭wifi可使用 RunAdb("su -c svc wifi disable");,同理,开启wifi可使用RunAdb("su -c svc wifi enable");,想要插件执行adb命令建议先把手机连接到电脑上,然后使用adb shell进入环境,再测试相应的adb命令,群控执行RunAdb就是在adb shell环境下执行的, [8 \2 J2 Z9 b* `+ T( u7 L3 ^' ~
/ y* J* U3 k, L& l* P% \8 A. X |
|