Mac系统 teamview去除账号限制改ID

简介: teamview去除账号限制改ID

1. 创建一个python文件把下方代码放进去,然后运行命令亲测有效,一定要用下面的代码,有的15版本之前的文件位置做了更换,有的代码会报错


sudo python2.7 TeamViewer-id-changer.py  


#!/usr/bin/env python #coding:utf-8import sys
import os
import glob
import platform
import re
import random
import string
print('''--------------------------------TeamViewer ID Changer for MAC OS--------------------------------''')
if platform.system() !='Darwin':
    print('This script can be run only on MAC OS.')
    sys.exit();
if os.geteuid() !=0:
    print('This script must be run form root.')
    sys.exit();
if os.environ.has_key('SUDO_USER'):
    USERNAME = os.environ['SUDO_USER']
if USERNAME =='root':
       print('Can not find user name. Run this script via sudo from regular user')
       sys.exit();
else:
    print('Can not find user name. Run this script via sudo from regular user')
    sys.exit();
HOMEDIRLIB ='/Users/'+ USERNAME  +'/library/preferences/'GLOBALLIB  ='/library/preferences/'CONFIGS = []
# Find config filesdef listdir_fullpath(d):
    return [os.path.join(d, f) for f in os.listdir(d)]
for file in listdir_fullpath(HOMEDIRLIB):
if'teamviewer'.lower() in file.lower():
        CONFIGS.append(file)
if not CONFIGS:
    print ('''There is no TemViewer configs found.Maybe you have deleted it manualy or never run TeamViewer after installation.Nothing to delete.''')
# Delete config fileselse:
    print("Configs found:\n")
for file in CONFIGS:
        print file
    print('''This files will be DELETED permanently.All TeamViewer settings will be lost''')
    raw_input("Press Enter to continue or CTR+C to abort...")
for file in CONFIGS:
        try:
            os.remove(file)
        except:
            print("Cannot delete config files. Permission denied?")
            sys.exit();
    print("Done.")
# Find binaryesTMBINARYES = [
'/Applications/TeamViewer.app/Contents/MacOS/TeamViewer',
'/Applications/TeamViewer.app/Contents/MacOS/TeamViewer_Service',
'/Applications/TeamViewer.app/Contents/MacOS/TeamViewer_Desktop',
]
for file in TMBINARYES:
if os.path.exists(file):
        pass
else:
        print("File not found: "+ file)
        print ("Install TeamViewer correctly")
        sys.exit();
# Patch filesdef idpatch(fpath,platf,serial):
    file = open(fpath, 'r+b')
    binary = file.read()
    PlatformPattern ="IOPlatformExpert.{6}"    SerialPattern ="IOPlatformSerialNumber%s%s%sUUID"    binary = re.sub(PlatformPattern, platf, binary)
    binary = re.sub(SerialPattern % (chr(0), "[0-9a-zA-Z]{8,8}", chr(0)), SerialPattern%(chr(0), serial, chr(0)), binary)
    file = open(fpath,'wb').write(binary)
    return True
def random_generator(size=8, chars=string.ascii_uppercase + string.digits):
    return ''.join(random.choice(chars) for _ in range(size))
RANDOMSERIAL = random_generator()
RANDOMPLATFORM ="IOPlatformExpert"+ random_generator(6)
for file in TMBINARYES:
        try:
            idpatch(file,RANDOMPLATFORM,RANDOMSERIAL)
        except:
            print "Error: can not patch file "+ file
            print "Wrong version?"            sys.exit();
print "PlatformDevice: "+ RANDOMPLATFORM
print "PlatformSerial: "+ RANDOMSERIAL
print('''ID changed sucessfully.!!! Restart computer before using TeamViewer !!!!''')
相关文章
|
2月前
|
编解码 项目管理 开发工具
探寻最受欢迎的 Mac 系统开源免费软件
探寻最受欢迎的 Mac 系统开源免费软件
|
7月前
|
Java Linux Shell
Gradle下载和配置教程:Windows、Mac和Linux系统安装指南
Gradle下载和配置教程:Windows、Mac和Linux系统安装指南
499 0
|
7月前
|
Java Linux Apache
Maven下载和配置教程:Windows、Mac和Linux系统安装指南
Maven下载和配置教程:Windows、Mac和Linux系统安装指南
327 0
|
7月前
|
关系型数据库 数据库 PostgreSQL
使用 Docker 在 Windows、Mac 和 Linux 系统轻松部署 PostgreSQL 数据库
使用 Docker 在 Windows、Mac 和 Linux 系统轻松部署 PostgreSQL 数据库
192 1
|
5月前
|
iOS开发 MacOS
MAC OS更新系统后IDEA中的SVN报错无法使用
MAC OS更新系统后IDEA中的SVN报错无法使用
|
3天前
|
编解码 Oracle iOS开发
VirtualBox虚拟机安装Mac OS X Lion系统详解
VirtualBox虚拟机安装Mac OS X Lion系统详解
|
19天前
|
计算机视觉 C++
Mac系统下vscode调试opencv环境搭建
Mac系统下vscode调试opencv环境搭建
21 1
|
26天前
Mac系统R语言升级后无法加载包报错 package or namespace load failed in dyn.load
Mac系统R语言升级后无法加载包报错 package or namespace load failed in dyn.load
|
2月前
|
人工智能 Rust 运维
这一款 Mac 系统终端工具,已经用的爱不释手了!
这一款 Mac 系统终端工具,已经用的爱不释手了!
|
2月前
|
机器学习/深度学习 iOS开发 MacOS
MAC系统机器学习环境配置常见问题
MAC系统机器学习环境配置常见问题