分享你的福利
www.fankuiba.com

[Mac 版本]Teamviewer 换 ID 教程 搬运 GitHUB( 附python源代码)

目前刚换了黑苹果系统, 之前在 win上面远程工具一直用的teamviewer,换 ID 也比较方便,一键换 ID

Mac 系统没那么方便,而且要天天换 ID, 不过总能比不能用强.如果你发现更好用的方法,请回复交流

源代码和文件放到最后

1) 本人实测 TV13,   另外 死杰马克丁版本用不了  一定要用官方的
2) 死杰马克丁法务全家 男性 jjboom

始教程:
1.打开 Mac终端

2.输入 命令  sudo su 点回车 然后输入 Mac 的开机密码 继续点回车

3.输入 python 空格(别忘了空格),然后 直接把 py 文件拖到终端里面(或者输入文件所在路径)点回车

4.连续按回车,什么意思?不用管 直接回车,然后关掉你的 tv 重新打开

[Asm] #!/usr/bin/env python #coding:utf-8import sysimport osimport globimport platformimport reimport randomimport stringprint(”’——————————–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/Helpers/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 Truedef 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: ” + RANDOMPLATFORMprint “PlatformSerial: ” + RANDOMSERIALprint(”’ID changed sucessfully.!!! Restart computer before using TeamViewer !!!!”’)
链接:https://pan.baidu.com/s/1jPXzjorbinUKoo7kCP084A  密码:72g1
Github 项目原地址:
https://gist.github.com/zhovner/b1d72f3465c46e7b58a4ea42d625c3e8