Jump to content
XPEnology Community

Advanced Media Extension will not activate dsm7.1-42661


phone guy

Recommended Posts

18 часов назад, wangsiji сказал:

 

How to get AME3.0 to work: Install AME package, and run the following python script to get latest codec!

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}”)

 

After codec is installed, you have to replace `synocodectool` to an empty bin returning 0. Execute the following shell script as root:

 

cd /var/packages/CodecPack/target/bin
mv synocodectool synocodectool.bak
echo "#!/bin/sh" > synocodectool
chmod 755 synocodectool

 

Enjoy! Please test and feedback!

I have DSM 7.1.1-42962 Update 2 on  DS3615xs.

After run script i have error:

"root@core:/var/packages/CodecPack/target/bin# python /volume1/localhost/ame.py
Patching
MD5 mismatch"

Link to comment
Share on other sites

Most of us have already installed ADM and tried to get the codec working in the normal method before we found this thread.  That is why we get the MD5 mismatch when trying the script...

For me the fix was to uninstall ADM, reinstall ADM and then run the script, without opening ADM first this time ;). 

Working perfectly for me now. After patching, I open it and it shows the codec installed.  Testing shows it to be working too.

 

Thank you Wangsiji !!!!

Edited by dominatorstang
bad wording
Link to comment
Share on other sites

7 часов назад, dominatorstang сказал:

Most of us have already installed ADM and tried to get the codec working in the normal method before we found this thread.  That is why we get the MD5 mismatch when trying the script...

For me the fix was to uninstall ADM, reinstall ADM and then run the script, without opening ADM first this time ;). 

Working perfectly for me now. After patching, I open it and it shows the codec installed.  Testing shows it to be working too.

 

Thank you Wangsiji !!!!

YES YES YES!!! Thank you !!!

Link to comment
Share on other sites

On 12/8/2022 at 9:29 PM, wangsiji said:

 

How to get AME3.0 to work: Install AME package, and run the following python script to get latest codec!

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}”)

 

After codec is installed, you have to replace `synocodectool` to an empty bin returning 0. Execute the following shell script as root:

 

cd /var/packages/CodecPack/target/bin
mv synocodectool synocodectool.bak
echo "#!/bin/sh" > synocodectool
chmod 755 synocodectool

 

Enjoy! Please test and feedback!

 

SyntaxError: EOL while scanning string literal

Why?

Link to comment
Share on other sites

12 hours ago, dominatorstang said:

Most of us have already installed ADM and tried to get the codec working in the normal method before we found this thread.  That is why we get the MD5 mismatch when trying the script...

For me the fix was to uninstall ADM, reinstall ADM and then run the script, without opening ADM first this time ;). 

Working perfectly for me now. After patching, I open it and it shows the codec installed.  Testing shows it to be working too.

 

Thank you Wangsiji !!!!

 

hello what is the script to run?

Link to comment
Share on other sites

2 hours ago, john2214 said:

 

SyntaxError: EOL while scanning string literal

Why?

 

Try this one i got the same error, quote sign at the end was wrong one i think.  @wangsiji thank you so much it's working ^^

 

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("Patch is unsuccessful, retcode = {ret}")

 

Edited by Johanzorz
  • Like 1
Link to comment
Share on other sites

Il y a 4 heures, ti9errr a dit :

DSM 7.1-42661 Update 1

1. ssh as admin user

2. Uninstall AME - /var/packages/CodecPack/target/usr/lib/ folder is empty

3. Install AME - file populated in folder

4. sudo python ame.py

 

Patching
MD5 mismatch

 

Same thing... I even did a reboot after uninstalling AME.

Link to comment
Share on other sites

1 hour ago, Johanzorz said:

 

Try this one i got the same error, quote sign at the end was wrong one i think.  @wangsiji thank you so much it's working ^^

 

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("Patch is unsuccessful, retcode = {ret}")

 

It's working! thx!

My nas: 918+ 7.1.1 AME 3.0

Link to comment
Share on other sites

Hi

Followed the instructions , dont have errors when trying to play hevc file now , but I get black screen , and after few minutes "connection expired". All is ok with H264 files.

What can I do / check please ?

 

AME 3.0.1-2004

HEVC 1.0.0-00001

DSM 7.1.1-42962 Update 2

DS920+

fake SN as I dont have real one

Link to comment
Share on other sites

5 hours ago, ti9errr said:

After checking, I found that this file is almost the same as my file, so the patch script still applies.

 

Please try this updated script:

 

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() not in ['fcc1084f4eadcf5855e6e8494fb79e23', '923fd0d58e79b7dc0f6c377547545930']:
        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}")

 

 

  • Like 1
Link to comment
Share on other sites

il y a 18 minutes, wangsiji a dit :

After checking, I found that this file is almost the same as my file, so the patch script still applies.

 

Please try this updated script:

 

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() not in ['fcc1084f4eadcf5855e6e8494fb79e23', '923fd0d58e79b7dc0f6c377547545930']:
        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}")

 

 

There's some progession, but I got this:

 

Patching
Checking whether patch is successful...
Patch is unsuccessful, retcode = 256

 

Link to comment
Share on other sites

1. Re-copy the script and paste it in visual code just incase.

2. Upload to home folder

3. ssh in to synology

4. sudo python ame.py

5. return code 256

6. ran synoame-bin-check-license - no return msg - think it is ok now?

7. ran synoame-bin-auto-install-needed-codec - no return msg

Edited by ti9errr
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...