自开发自动拉群微信云控系统,一键全自动拉群

微信自动拉群云控系统源码,全自动一键拉群。自动统计新加的好友,自动将所有新加好友一键拉群。服务器端下发群二维码,手机端一键拉群。全自动大批量,同时拉群。

 在系统的开发实现过程中,除了服务器端推送指令到手机端,手机端使用uiautomator自动化执行外,还有业务逻辑的代码。业务逻辑主要用来实现各种各样的统计功能。

      1.服务器推送主要用到的是第三方的推送服务,源代码如下:

//多推接口案例
public function pushMessageToList($idsArr,$cmd)
{
putenv("gexin_pushList_needDetails=true");
putenv("gexin_pushList_needAsync=true");
$igt = new \IGeTui(HOST, APPKEY, MASTERSECRET);
//消息模版:
// 1.TransmissionTemplate:透传功能模板
// 2.LinkTemplate:通知打开链接功能模板
// 3.NotificationTemplate:通知透传功能模板
// 4.NotyPopLoadTemplate:通知弹框下载功能模板
// var_dump("ssssssssssss");
//$template = IGtNotyPopLoadTemplateDemo();
//$template = IGtLinkTemplateDemo();
//$template = IGtNotificationTemplateDemo();
$template = $this->IGtTransmissionTemplateDemo($cmd);
//个推信息体
$message = new \IGtListMessage();
$message->set_isOffline(true);//是否离线
$message->set_offlineExpireTime(3600 12 1000);//离线时间
$message->set_data($template);//设置推送消息类型
// $message->set_PushNetWorkType(1); //设置是否根据WIFI推送消息,1为wifi推送,0为不限制推送
// $contentId = $igt->getContentId($message);
$contentId = $igt->getContentId($message,"toList任务别名功能"); //根据TaskId设置组名,支持下划线,中文,英文,数字
foreach ($idsArr as $k=>$v) {
$target = new \IGtTarget();
$target->set_appId(APPID);
$target->set_clientId($v);
// $target1->set_alias(Alias);
$targetList[$k] = $target;
}
//接收方1
$rep = $igt->pushMessageToList($contentId, $targetList);
return $rep;
// var_dump($rep);
// echo ("<br><br>");

}

 2.在自动化执行方面使用的是uiautomator,源代码如下:

String groupId = cmd.split(":")[1];
    int count = Integer.parseInt(cmd.split(":")[2]);
    String testStr = "0";
    String[] prefixStr = testStr.split(":");
    int realCount = count;
    SystemLog.d("扫描二维码阶段");
    sUiAutomatorManager.clickUiByRsid("com.tencent.mm:id/c9f");
    sUiAutomatorManager.clickUiByDescription("更多功能按钮");
    sUiAutomatorManager.clickUiByText("扫一扫");
    sUiAutomatorManager.clickUiByDescription("更多");
    sUiAutomatorManager.clickUiByText("从相册选取二维码");
    sUiAutomatorManager.clickUiByRsid("com.tencent.mm:id/i8");
    sUiAutomatorManager.clickUiByDesStartsWith("图片 1");
    //sUiAutomatorManager.clickUiByText("加入该群聊");
    UiObject uiBux = sUiAutomatorManager.findByInstanceAndClassName(0, "com.tencent.tbs.core.webkit.WebView");
    sUiAutomatorManager.clickCenterof(uiBux);
    /**
     sUiAutomatorManager.clickUiByText("确定");
     sUiAutomatorManager.clickUiByText("com.tencent.mm:id/d0h");
     sUiAutomatorManager.clickUiByText("通讯录");
     sUiAutomatorManager.clickUiByInstanceAndClassName(0,"android.view.View");
     sUiAutomatorManager.clickUiByText("发消息");
     sUiAutomatorManager.clickUiByDescription("图片");
     sUiAutomatorManager.longPressByInstanceAndClassName(0,"com.tencent.mm.ui.mogic.WxViewPager");
     sUiAutomatorManager.clickUiByText("识别图中二维码");
     **/
    sUiAutomatorManager.clickUiByText("微信");
    sUiAutomatorManager.clickUiByText("000");
    sUiAutomatorManager.clickUiByDescription("聊天信息");
    UiObject uiObject = sUiAutomatorManager.findByTextStartWith("聊天信息");

    int groupNum = sUiAutomatorManager.getNumberFromUiObject(uiObject);

其中在实现过程中,统计功能的代码逻辑是相对复杂一些,首先要看到统计新加入的所有的好友有哪些,然后直接拉这些好友入群。具体详细代码,我们下次再来展示。需要源码和技术交流加威信:16620839974

猜你喜欢

转载自blog.51cto.com/13912425/2155664