示例#1
0
文件: foot.py 项目: Andy10101/poot
def finMath(deviceId, phoneProuct):
    ui = device.getUiAnazaed(deviceId)
    if phoneProuct == config.PHONE_M571C:
        #获取宜聚二字
        device.returnHome(deviceId, beforeTime=10, infor='回到桌面')
        device.startApp(
            deviceId,
            'com.meizu.filemanager/com.meizu.flyme.filemanager.activity.FileManagerActivity'
        )
        device.pushFile(deviceId, config.text_yiju, config.pushFileLocition)
        if ui.waitOpenByText('APushFile', 3, 1, infor='等待打开'):
            ui.tapByText('APushFile')
            ui.tapByText('atemp')
            ui.tapByText('HTML 查看程序')
            if ui.waitOpenByText('选择打开方式', 3, 1, infor='等待打开') == False:
                return
            device.swipe(deviceId, 100, 400, 100, 400, 2000, beforeTime=1)
            ui.tapById('com.android.webview:id/select_action_menu_select_all')
            ui.tapById('com.android.webview:id/select_action_menu_copy')
            device.returnHome(deviceId, beforeTime=1, infor='回到桌面')
            device.startApp(deviceId,
                            'com.buak.Link2SD/com.buak.Link2SD.Link2SD',
                            beforeTime=1,
                            infor='打开linksd')
            if ui.waitOpenByPackage('com.kingroot.kinguser',
                                    3,
                                    1,
                                    infor='是否出现弹窗'):
                ui.tapById('com.kingroot.kinguser:id/button_right')
            if ui.waitOpenByText('更新内容', 3, 1, infor='是否出现更新内容弹窗'):
                ui.tapByText('确定')
            if ui.waitOpenByText('Link2SD', 10, 1, infor='是否出现') == False:
                return
            ui.tapById('com.buak.Link2SD:id/menu_more', infor='点击【更多】')
            ui.tapByText('搜索', infor='点击【搜索】')
            #为了输入一个【宜聚】
            ui.tapByText('搜索程序', infor='点击搜索程序', beforeTime=1)
            device.tapXY(deviceId, 189, 349, beforeTime=1, infor='点击粘贴')
            #结束
            if ui.waitOpenById('com.buak.Link2SD:id/app_icon',
                               3,
                               1,
                               infor='等待'):
                ui.tapById('com.buak.Link2SD:id/app_icon')
            else:
                return
            if ui.waitOpenById('com.buak.Link2SD:id/appdetails_menu_actions',
                               3,
                               1,
                               infor='等待'):
                ui.tapById('com.buak.Link2SD:id/appdetails_menu_actions')
            else:
                return
            ui.tapByText('转换成系统应用', beforeTime=1)
            ui.tapByText('确定', beforeTime=1)
            device.reboot(deviceId, beforeTime=10)
示例#2
0
文件: foot.py 项目: Andy10101/poot
def downconfig(deviceId):
    device.pushFile(deviceId,
                    os.getcwd() + r"\config.properties",
                    "/mnt/sdcard/com.clqf.app.master",
                    infor='推送文件',
                    beforeTime=2)
    device.reboot(deviceId, infor='重启')
    #退出

    pass
示例#3
0
文件: foot.py 项目: Andy10101/poot
def xpCheck(deviceId, phoneProuct):
    ui = device.getUiAnazaed(deviceId)
    device.returnHome(deviceId, infor='回到桌面')
    if phoneProuct == config.PHONE_COOLPAD:  #酷派
        device.pushFile(deviceId,
                        config.new_xp_coolpad,
                        config.pushFileLocition,
                        infor='推送酷派框架到手机')
        device.installApkFromPath(deviceId,
                                  config.new_xp_coolpad,
                                  infor='安装酷派框架')
    else:
        device.pushFile(deviceId,
                        config.new_xp,
                        config.pushFileLocition,
                        infor='推送框架到手机')
        device.installApkFromPath(deviceId, config.new_xp, infor='安装框架')
    pass
示例#4
0
文件: foot.py 项目: Andy10101/poot
def update(deviceId):
    try:
        ui = device.getUiAnazaed(deviceId)
        phone = device.getPhoneProduct(deviceId)
        device.returnHome(deviceId, infor='回到桌面')
        device.mkDir(deviceId, config.pushFileLocition)
        if device.pushFile(deviceId,
                           config.plugins,
                           '/mnt/sdcard/',
                           infor='推送plugins文件夹'):
            print(deviceId + ':推送成功')
        else:
            print(deviceId + ':推送失败')
            # 推送所有需要安装的软件
        device.pushFile(deviceId,
                        config.new_chatproxy,
                        config.pushFileLocition,
                        infor='推送插件到手机')
        device.pushFile(deviceId,
                        config.new_app,
                        config.pushFileLocition,
                        infor='推送app')
        # 推送代码段结束
        device.installApkFromPath(deviceId,
                                  config.new_chatproxy,
                                  infor='安装chatproxy')
        device.installApkFromPath(deviceId, config.new_app, infor='安装app')
        device.returnHome(deviceId, infor='回到桌面')
        setChat(deviceId, phone)
        if ui.waitOpenById('de.robv.android.xposed.installer:id/checkbox',
                           3,
                           1,
                           infor='等待模块界面打开'):
            device.reboot(deviceId, beforeTime=5, infor='5秒后自动重启')
        pass
    except BaseException as e:
        print(e)
    finally:
        print('结束')
示例#5
0
文件: foot.py 项目: Andy10101/poot
def installWechatAndApp(deviceId):
    device.mkDir(deviceId, "/mnt/sdcard/0001", infor='建立存储文件夹')
    device.pushFile(deviceId,
                    config.new_wechat,
                    "/mnt/sdcard/0001",
                    infor='推送微信')
    device.pushFile(deviceId,
                    config.new_app,
                    "/mnt/sdcard/0001",
                    infor="推送App")
    device.pushFile(deviceId, config.new_xp, "/mnt/sdcard/0001", infor="推送寻")
    device.pushFile(deviceId,
                    config.new_xp_coolpad,
                    "/mnt/sdcard/0001",
                    infor="推送xp")
    device.pushFile(deviceId,
                    config.new_Link2SD,
                    "/mnt/sdcard/0001",
                    infor="推送2d")
    device.pushFile(deviceId,
                    config.new_assisetScreen,
                    "/mnt/sdcard/0001",
                    infor="常量助手")
示例#6
0
文件: foot.py 项目: Andy10101/poot
def startRoot(deviceId, phoneProuct):

    ui = device.getUiAnazaed(deviceId)
    device.returnHome(deviceId, infor='回到桌面')
    device.mkDir(deviceId, config.pushFileLocition)
    if phoneProuct == config.PHONE_XIAOMI_4A:
        print('无需设置')
        return
    flag = False
    if device.checkAppIfInstall(deviceId,
                                'com.kingroot.kinguser',
                                infor='检查kingroot是否存在') == False:
        flag = True
        print('kinroot未安装,进行安装操作')
        if device.installApkFromPath(deviceId,
                                     config.new_kingroot,
                                     infor='安装Kingroot'):
            print('kingroot安装完成')
        else:
            print('kingroot安装失败,尝试再次安装')
    device.killApp(deviceId, 'com.kingroot.kinguser', infor='强制关闭kingroot')
    device.pushFile(deviceId,
                    config.new_kingroot,
                    config.pushFileLocition,
                    infor='推送kINGroot到手机')
    if device.checkAppIfInstall(deviceId,
                                'com.kingroot.kinguser',
                                infor='检查kingroot是否存在') == False:
        flag = True
        print('kinroot未安装,进行第二次安装操作')
        if device.installApkFromPath(deviceId,
                                     config.new_kingroot,
                                     infor='安装Kingroot'):
            print('kingroot安装完成')
        else:
            print(deviceId + ':第二次kingroot安装失败,如有需要,请手动安装或【重启手机】后再次尝试执行此脚本')
            return
    device.startApp(deviceId,
                    'com.kingroot.kinguser/.activitys.SliderMainActivity',
                    infor='打开kingroot',
                    beforeTime=2,
                    endTime=1)
    if flag:
        if phoneProuct == config.PHONE_ZTE_BV0701:  #如果是中兴小鲜
            device.swipe(deviceId,
                         535,
                         1500,
                         535,
                         150,
                         infor='向上滑动',
                         beforeTime=1)
            device.swipe(deviceId,
                         535,
                         1500,
                         535,
                         150,
                         infor='向上滑动',
                         beforeTime=1)
            device.tapXY(deviceId, 561, 1707, infor='点击立即开启', beforeTime=1)
        if phoneProuct == config.PHONE_M571C:  #如果是魅族
            device.swipe(deviceId,
                         577,
                         1780,
                         577,
                         355,
                         150,
                         infor='向上滑动',
                         beforeTime=1)
            device.swipe(deviceId,
                         577,
                         1780,
                         577,
                         355,
                         150,
                         infor='向上滑动',
                         beforeTime=1)
            device.swipe(deviceId,
                         577,
                         1780,
                         577,
                         355,
                         150,
                         infor='向上滑动',
                         beforeTime=1)
            device.tapXY(deviceId, 607, 1686, infor='点击立即开启', beforeTime=1)
        if ui.waitOpenByText('化繁为简', 2, 1, infor='是否出现化繁为简字样?'):
            ui.swipeFromIdToId('com.kingroot.kinguser:id/guide_arrow',
                               'com.kingroot.kinguser:id/guide_title',
                               time=200,
                               infor='向上滑动')
            ui.swipeFromIdToId('com.kingroot.kinguser:id/guide_arrow',
                               'com.kingroot.kinguser:id/guide_title',
                               time=200,
                               infor='向上滑动')
            if ui.waitOpenByText('立即开启', 2, 1, infor='立即开启是否可见') == False:
                return
            ui.tapByText('立即开启', infor='点击立即开启')
    if ui.waitOpenByText('化繁为简', 2, 1, infor='是否出现化繁为简字样?'):
        ui.swipeFromIdToId('com.kingroot.kinguser:id/guide_arrow',
                           'com.kingroot.kinguser:id/guide_title',
                           time=200,
                           infor='向上滑动')
        ui.swipeFromIdToId('com.kingroot.kinguser:id/guide_arrow',
                           'com.kingroot.kinguser:id/guide_title',
                           time=200,
                           infor='向上滑动')
        if ui.waitOpenByText('立即开启', 2, 1, infor='立即开启是否可见') == False:
            return
        ui.tapByText('立即开启', infor='点击立即开启')
    if ui.waitOpenByText('KingRoot', 2, 1, infor='等待【KingRoot】字样可见') == False:
        return
    if ui.waitOpenByText('立即修复', 2, 1, infor='是否出现立即修复'):
        ui.tapByText('立即修复', infor='点击立即修复')
    if ui.waitOpenByText('立即处理', 100, 2, infor='立即处理是否出现') == False:
        print('kingroot主界面打开失败')
    #检查是否有root授权
    if ui.waitOpenById('com.kingroot.kinguser:id/left_button_device',
                       2,
                       1,
                       infor='是否出现菜单按钮'):
        ui.tapById('com.kingroot.kinguser:id/left_button_device',
                   infor='点击菜单按钮')
        if ui.waitOpenByText('已成功获取Root权限', 2, 1,
                             infor='是否出现已成功获取Root权限字样') == False:
            if ui.waitOpenByText('重试', 3, 1, infor='是否出现重试?'):
                raise BaseException('获取ROOT失败,请手动获取后再继续执行。')
            if ui.waitOpenByText('立即修复', 5, 1, infor='是否出现立即修复'):
                ui.tapByText('立即修复', infor='点击立即修复')
                if ui.waitOpenByText('立即处理', 100, 2,
                                     infor='立即处理是否出现') == False:
                    print('权限修复失败,手动处理')
                    return
        ui.tapById('com.kingroot.kinguser:id/left_iv', infor='点击返回')
    #检查root授权结束

    ui.tapById('com.kingroot.kinguser:id/right_iv', 1, infor='点击右上角菜单')
    if phoneProuct == config.PHONE_COOLPAD:
        device.tapXY(deviceId, 558, 228, infor='酷派,使用坐标点击【通用设置】')
    else:
        ui.tapByText('通用设置', infor='点击【通用设置】')
    if ui.ifCheckedById('com.kingroot.kinguser:id/checkbox',
                        infor='检查root授权是否开启'):
        print('root授权已开启')
    else:
        ui.tapById('com.kingroot.kinguser:id/checkbox', 1, infor='打开root授权')
    if ui.ifCheckedById('com.kingroot.kinguser:id/checkbox',
                        2,
                        infor='检查【智能授权】是否开启'):
        print('智能授权已开启')
    else:
        ui.tapById('com.kingroot.kinguser:id/checkbox', 2, infor='开启【智能授权】')
    ui.tapByText('授权弹窗', infor='点击【授权弹窗】')
    ui.tapById('com.kingroot.kinguser:id/radio_button',
               infor='设置授权时间10s',
               beforeTime=2)
    ui.tapById('com.kingroot.kinguser:id/radio_button',
               5,
               infor='设置授权【允许】',
               beforeTime=2)
    ui.tapById('com.kingroot.kinguser:id/left_iv', infor='点击【返回】按钮')
    if ui.waitOpenByText('高级权限管理', 1, 1, infor='等待高级权限管理字样可见') == False:
        ui.tapById('com.kingroot.kinguser:id/left_iv', infor='点击【返回】按钮')
    if ui.waitOpenByText('高级权限管理', 2, 1, infor='等待高级权限管理字样可见') == False:
        return
    ui.tapByText('高级权限管理', infor='点击高级权限管理')
    ui.tapByText('静默安装监控', infor='点击静默安装监控')
    if ui.waitOpenByText('立即开启', infor='检查是否有立即开启字样'):
        return
    ui.tapById('com.kingroot.kinguser:id/right_iv', infor='点击右上角菜单')
    ui.tapByText('停用监控', infor='点击停用监控')
    ui.tapByText('确定', infor='点击确定', beforeTime=2)
    ui.tapById('com.kingroot.kinguser:id/left_iv', infor='点击【返回】按钮')
    device.returnHome(deviceId, infor='回到桌面', beforeTime=1)
示例#7
0
文件: foot.py 项目: Andy10101/poot
def installAllPluags(deviceId, phoneProuct):
    ui = device.getUiAnazaed(deviceId)
    device.returnHome(deviceId, infor='回到桌面')
    if device.pushFile(deviceId,
                       config.plugins,
                       '/mnt/sdcard/',
                       infor='推送plugins文件夹'):
        print(deviceId + ':推送成功')
    else:
        print(deviceId+':推送失败')\
    #推送所有需要安装的软件

    device.pushFile(deviceId,
                    config.new_chatproxy,
                    config.pushFileLocition,
                    infor='推送插件到手机')
    device.pushFile(deviceId,
                    config.new_app,
                    config.pushFileLocition,
                    infor='推送APP到手机')
    #推送代码段结束
    device.installApkFromPath(deviceId,
                              config.new_chatproxy,
                              infor='安装chatproxy')

    device.installApkFromPath(deviceId, config.new_app, infor='安装有客到APP')

    print(deviceId + ':安装其他软件')
    for key, value in config.otherKeys:
        print(deviceId + ':正在安装' + key + ":" + value)
        device.pushFile(deviceId, value, config.pushFileLocition)
        device.installApkFromPath(deviceId, value)
    print(deviceId + ':其他软件安装结束')
    if phoneProuct == config.PHONE_M571C:  # 魅族
        device.pushFile(deviceId,
                        config.new_Link2SD,
                        config.pushFileLocition,
                        infor='推送LINK2SD到手机')
        device.pushFile(deviceId,
                        config.new_assisetScreen,
                        config.pushFileLocition,
                        infor='推送亮屏助手到手机')
        device.installApkFromPath(deviceId,
                                  config.new_Link2SD,
                                  infor='安装Link2SD')
        device.installApkFromPath(deviceId,
                                  config.new_assisetScreen,
                                  infor='安装屏幕助手')
    device.pushFile(deviceId,
                    config.new_wechat,
                    config.pushFileLocition,
                    infor='推送微信到手机')
    device.installApkFromPath(deviceId, config.new_wechat, infor='更新微信')
    device.returnHome(deviceId, infor='回到桌面')