1. 服务器/VPS/主机用户Telegram电报群: https://t.me/openos
    黑群晖 Synology Telegram电报群: https://t.me/nasfan
    排除公告

黑群解决AME问题

本帖由 leixu2023-07-29 发布。版面名称:群晖 Synology DSM

  1. leixu

    leixu New Member

    注册:
    2021-10-15
    帖子:
    21
    将以下代码保存为py文件。例如:AME.py
    用python运行
    python /volume/download/AME.py 改成自己对应的目录
    在计划任务中添加计划运行也可以

    DSM7.1
    代码:
    import hashlib
    import os
    
    r = ['669066909066906690', 'B801000000', '30']
    s = [(0x1F28, 0), (0x48F5, 1), (0x4921, 1), (0x4953, 1), (0x4975, 1), (0x9AC8, 2)]
    
    prefix = '/var/packages/CodecPack/target/usr'
    so = prefix + '/lib/libsynoame-license.so'
    
    print("Patching")
    with open(so, 'r+b') as fh:
        full = fh.read()
        if hashlib.md5(full).digest().hex() != 'fcc1084f4eadcf5855e6e8494fb79e23':
            print("MD5 mismatch")
            exit(1)
        for x in s:
            fh.seek(x[0] + 0x8000, 0)
            fh.write(bytes.fromhex(r[x[1]]))
    
    lic = '/usr/syno/etc/license/data/ame/offline_license.json'
    os.makedirs(os.path.dirname(lic), exist_ok=True)
    with open(lic, 'w') as licf:
        licf.write('[{"appType": 14, "appName": "ame", "follow": ["device"], "server_time": 1666000000, "registered_at": 1651000000, "expireTime": 0, "status": "valid", "firstActTime": 1651000001, "extension_gid": null, "licenseCode": "0", "duration": 1576800000, "attribute": {"codec": "hevc", "type": "free"}, "licenseContent": 1}, {"appType": 14, "appName": "ame", "follow": ["device"], "server_time": 1666000000, "registered_at": 1651000000, "expireTime": 0, "status": "valid", "firstActTime": 1651000001, "extension_gid": null, "licenseCode": "0", "duration": 1576800000, "attribute": {"codec": "aac", "type": "free"}, "licenseContent": 1}]')
    
    
    print("Checking whether patch is successful...")
    ret = os.system(prefix + "/bin/synoame-bin-check-license")
    if ret == 0:
        print("Successful, updating codecs...")
        os.system(prefix + "/bin/synoame-bin-auto-install-needed-codec")
        print("Done")
    else:
        print(f"Patch is unsuccessful, retcode = {ret}")
    DSM7.2
    代码:
    import hashlib
    import os
    
    r = ['669066909066906690', 'B801000000', '30']
    s = [(0x3718, 0), (0x60A5, 1), (0x60D1, 1), (0x6111, 1), (0x6137, 1), (0xB5F0, 2)]
    
    prefix = '/var/packages/CodecPack/target/usr'
    so = prefix + '/lib/libsynoame-license.so'
    
    print("Patching")
    with open(so, 'r+b') as fh:
       full = fh.read()
       if hashlib.md5(full).digest().hex() != '09e3adeafe85b353c9427d93ef0185e9':
           print("MD5 mismatch")
           exit(1)
       for x in s:
           fh.seek(x[0] + 0x8000, 0)
           fh.write(bytes.fromhex(r[x[1]]))
    
    lic = '/usr/syno/etc/license/data/ame/offline_license.json'
    os.makedirs(os.path.dirname(lic), exist_ok=True)
    with open(lic, 'w') as licf:
       licf.write('[{"attribute": {"codec": "hevc", "type": "free"}, "status": "valid", "extension_gid": null, "expireTime": 0, "appName": "ame", "follow": ["device"], "duration": 1576800000, "appType": 14, "licenseContent": 1, "registered_at": 1649315995, "server_time": 1685421618, "firstActTime": 1649315995, "licenseCode": "0"}, {"attribute": {"codec": "aac", "type": "free"}, "status": "valid", "extension_gid": null, "expireTime": 0, "appName": "ame", "follow": ["device"], "duration": 1576800000, "appType": 14, "licenseContent": 1, "registered_at": 1649315995, "server_time": 1685421618, "firstActTime": 1649315995, "licenseCode": "0"}]')
    
    
    print("Checking whether patch is successful...")
    ret = os.system(prefix + "/bin/synoame-bin-check-license")
    if ret == 0:
       print("Successful, updating codecs...")
       os.system(prefix + "/bin/synoame-bin-auto-install-needed-codec")
       print("Done")
    else:
       print(f"Patch is unsuccessful, retcode = {ret}")
     
  2. sumwah

    sumwah Member

    注册:
    2020-04-18
    帖子:
    142
    谢谢,一个解码问题,一个备份问题都可以白飘,那洗不洗白都没所谓了。
     
  3. carlchan

    carlchan Member

    注册:
    2017-07-04
    帖子:
    51
    谢谢
     
  4. pengum

    pengum New Member

    注册:
    2018-02-08
    帖子:
    4
    請問S大是指, 序號使用引導自己內建的, 也不用登陸就能啟用AME套件?
     
  5. dlutwang

    dlutwang Member

    注册:
    2019-10-22
    帖子:
    57
     
  6. pengum

    pengum New Member

    注册:
    2018-02-08
    帖子:
    4
    謝謝回復, 感恩
     
  7. mazi

    mazi New Member

    注册:
    2023-08-27
    帖子:
    2
    请问,计划任务是每次开机都要运行吗?
     
  8. qianyuanaini

    qianyuanaini Member

    注册:
    2021-12-19
    帖子:
    85
    感谢,连半洗白都不用了
     
  9. hengshan505

    hengshan505 New Member

    注册:
    2023-09-01
    帖子:
    3
    这个牛逼啊
    支持一下
     
  10. xieqinb

    xieqinb New Member

    注册:
    2021-02-25
    帖子:
    20
    大家都成功了么,我试了一下怎么好像无效呀
     
    已获得 pilipala 的点赞。