-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Origin is discontinued, needs an update to support new Ea App #44
Comments
Same problem here. Can't login as Origin is no longer supported. |
same problem |
Any solution? |
I guess no one gives a shit. |
I have the same issue, it won't accept my login credentials even though they're correct. Will this ever be fixed? EA/Origin is the only launcher that can't sync, so my library will never be complete.. |
Same problem I am having... There doesn't seem to be support for the extended security code authorization which the EA app uses. |
I'm guessing whoever developed this extension is no longer supporting it. I just noticed the date this thread was started. it's been over 3/4 of a year and nothing. Sad! |
If anyone knows how to use the new login url in plugin.py it might work. I dont have a clue how to do it probably.
|
I tried it but I can't make it work either |
I'd suggest either looking at how Playnite deals with the API, or use the method described here to pull the data out of the local database. Unfortunately, the latter method requires a bit of effort to decrypt it. |
Here's my attempt at it : https://github.com/BellezaEmporium/galaxy-integration-ead |
How do I try this out? What do I need to do? |
Simply copy and paste the code to Users\ your username \AppData\Local\GOG.com\Galaxy\plugins\installed\origin_7f53219b-4e2b-4591-9f4f-dfc5f4ba9eb0 |
To be clear, you click the green Code button, choose Download ZIP, extract the file, then copy the contents of the "src" folder over an existing install of the Origin plugin, and overwrite the duplicate files.
So, it's a start. I'm able to login again now, but after [trying to start a game] the EA app opens I eventually get "You don't have access - This title may have been downloaded to your device by another user who owns the game. Log in to a different account or restart the app to try again" on two games I tried. I'm able to open them just fine from within the app. If I'm not mistaken, |
I'll check the issue tomorrow. Will compare with the titles I have. |
Thank you, Nutzzz! I would not have figured that out on my own. I initially tried to copy the entire contents of the zip file into the directory. That obviously didn't work. :P |
On first checkings, it is still Origin.OFR.50.xxxxxxx being used. However, all the links that were used on the Origin variant are different on EA Desktop. ex : PID, Entitlements etc etc... are now on https://service-aggregation-layer.juno.ea.com/graphql What's useful with GraphQL is that you can ask for any data you want, as long as your JSON query is correct and can be manipulated by the server to retrieve results. Some others however are different : The main issue seems to be on the "origin2://" hyperlinks. While it uses the same kind of ID, I don't think it works. Let me do further checks. EDIT : lutris/lutris#4996 seems to point out the issue you're mentioning @Nutzzz. I'll have to ask directly through EA's new GraphQL in order to get the correct gameID for launching. |
Ah, sorry, my assumption was incorrect. (The launcher I was working on uses the .exe files instead of the protocol to launch a game, but when moving from the Origin platform to EA, I had to rely on the Software ID rather than the Offer ID to get the file location; I guessed incorrectly that a similar change in the protocol launch method was necessary.) |
No worries. It's a few more steps in order to make it work properly I suppose. One suggested using the EA API, though I only seem to find the correct IDs on the "_Installer" folders of already installed games. While it should normally be seen from the API, I can't seem to put my hand on it. The different GraphQL queries i've catched make no such mention. |
The link you provided seems to indicate that you should get a ContentID in the .json response. |
Maybe if I manually ask for it. Let me give it a try. |
I only get Origin.OFR results. However, DLCs and other results seem to work. Had the "Battlefront upgrade DLC" pop up when I tried launching stuff. |
Hm, I don't really have any experience with the API, but FWIW it looks like you can take the OFR and make a request to https://api1.origin.com/ecommerce2/public/Origin.OFR.50.xxxxxxx/en_US and from there you can pull out "publishing" > "publishingAttributes" > "contentId" |
Either financeId or projectNumber seems to be quite accurate. or, indeed, contentId | "194908" |
In the case of https://api1.origin.com/ecommerce2/consolidatedentitlements/ <- projectId seems to be quite close. |
OK, i've found it. I think i've corrected the main issue. EDIT : OK, problem is solved :) |
@Nutzzz please try latest commit and tell me if it works. I've ditched the OfferID to ContentID. Tests were successful on my side. If it works for you then I suppose the plugin is fully fixed :) |
I had the same as Nutzzz with the error saying that its not installed on my account. So the installed ones and the noninstalled ones. But the ones that I have installed just start when I press the button. Do you know what's going on? |
I must say I stumbled upon this issue too... though I do not know how that's triggered out in Galaxy. I'll need to do further checking, as it might be manifest-related or Windows stuff. |
EDIT2 : I guess I'll have no choice but to ship this decryption system separately from Galaxy. Sounds like there's a bit of an issue there. You'll have to decrypt your IS file, and then the rest will be done. |
Here's the decryption program. It will create the necessary decrypted IS JSON file. In order for Galaxy to work with it afterwards, you'll need to add the decrypted JSON file in the EA Desktop folder. (in case you're always opening Python as admin, you may modify this code in order to do so). There's one thing I haven't found out is the PNP device for Mac users. import subprocess
import platform
import os
if platform.system() == "Darwin":
import psutil
from hashlib import sha1, sha3_256
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
# changes in overall functioning (as of its release) constraints us to use a decryption method in order to check which game's installed
# inputs the filepath of the manifest file
# outputs the decrypted JSON file
filepath = input("Enter the filepath of the manifest file: ")
iv = "allUsersGenericIdIS".encode('ascii')
iv_hash = sha3_256(iv).digest()
if platform.system() == "Windows":
query_baseboard = subprocess.check_output('wmic baseboard get Manufacturer,SerialNumber /format:list', shell=True)
if query_baseboard:
data = {}
for line in query_baseboard.decode('utf-8').split('\n'):
if '=' in line:
key, value = line.split('=', 1)
data[key] = value.rstrip('\r')
baseboard_manufacturer = data.get('Manufacturer')
baseboard_serial_number = data.get('SerialNumber')
query_bios = subprocess.check_output('wmic bios get Manufacturer,SerialNumber /format:list')
if query_bios:
data = {}
for line in query_bios.decode('utf-8').split('\n'):
if '=' in line:
key, value = line.split('=', 1)
data[key] = value.rstrip('\r')
bios_manufacturer, bios_serial_number = data.get('Manufacturer'), data.get('SerialNumber')
query_logicaldisk = subprocess.check_output('wmic logicaldisk where "Caption=\'C:\'" get VolumeSerialNumber /format:list')
if query_logicaldisk:
data = {}
for line in query_logicaldisk.decode('utf-8').split('\n'):
if '=' in line:
key, value = line.split('=', 1)
data[key] = value.rstrip('\r')
volume_serial_number = data.get('VolumeSerialNumber')
query_videocontroller = subprocess.check_output('wmic path win32_videocontroller where "VideoProcessor like \'Intel%\' or VideoProcessor like \'AMD%\'" get PNPDeviceID /format:list')
if query_videocontroller:
data = {}
for line in query_videocontroller.decode('utf-8').split('\n'):
if '=' in line:
key, value = line.split('=', 1)
data[key] = value.rstrip('\r')
video_controller_pnp_device_id = data.get('PNPDeviceID').replace("&", "&")
query_cpu = subprocess.check_output('wmic cpu get Manufacturer,ProcessorId /format:list')
if query_cpu:
data = {}
for line in query_cpu.decode('utf-8').split('\n'):
if '=' in line:
key, value = line.split('=', 1)
data[key] = value.rstrip('\r')
processor_manufacturer, processor_id = data.get('Manufacturer'), data.get('ProcessorId')
query_cpu_name = subprocess.check_output('wmic cpu get Name /format:list')
if query_cpu_name:
data = {}
for line in query_cpu_name.decode('utf-8').split('\n'):
if '=' in line:
key, value = line.split('=', 1)
data[key] = value.rstrip('\r')
processor_name = data.get('Name')
# sha1 string
hw_info = baseboard_manufacturer + ";" + baseboard_serial_number + ";" + bios_manufacturer + ";" + bios_serial_number + ";" + volume_serial_number + ";" + video_controller_pnp_device_id + ";" + processor_manufacturer + ";" + processor_id + ";" + processor_name + ";"
print("Got hardware info: %s", hw_info)
# Calculate SHA1 Hash of hardware string
hw_info_bytes = hw_info.encode('ascii')
hw_hash = sha1(hw_info_bytes).digest()
print("Got hardware hash: %s", hw_hash.hex())
hash_str = 'allUsersGenericIdIS' + hw_hash.hex().lower()
# Calculate SHA3 256 Hash of full string
hash_bytes = hash_str.encode('ascii')
key_hash = sha3_256(hash_bytes).digest()
print("Got key hash: %s", key_hash.hex())
cipher = Cipher(algorithms.AES(key_hash), modes.CBC(iv_hash[0:16]))
# Create a decryptor object
decryptor = cipher.decryptor()
# Open input and output files
with open(filepath, 'rb') as infile, open("IS.json", 'wb') as outfile:
# Read the first 64 bytes and discard them
infile.read(64)
block_size = 16
while True:
# Read a block from the input file
block = infile.read(block_size)
if not block:
break # Reached end of file
# Decrypt the block and write to the output file
decrypted_block = decryptor.update(block)
outfile.write(decrypted_block)
print("IS decrypted successfully. Move the file to the EA Desktop folder. Enjoy using Galaxy!")
elif platform.system() == "Darwin":
# Retrieve system information
baseboard_manufacturer = ''
baseboard_serial_number = ''
bios_manufacturer = ''
bios_serial_number = ''
volume_serial_number = ''
processor_manufacturer = ''
processor_id = ''
processor_name = ''
# Baseboard information
baseboard_manufacturer = subprocess.check_output(["system_profiler", "SPHardwareDataType"])
baseboard_manufacturer = baseboard_manufacturer.decode('utf-8').split(':')[-1].strip()
# BIOS information (Mac doesn't have BIOS in the traditional sense)
bios_manufacturer = "Apple"
bios_serial_number = subprocess.check_output(["system_profiler", "SPHardwareDataType"])
bios_serial_number = bios_serial_number.decode('utf-8').split(':')[-1].strip()
# Disk information
volume_serial_number = subprocess.check_output(["system_profiler", "SPStorageDataType"])
volume_serial_number = volume_serial_number.decode('utf-8').split('Serial Number (system):')[-1].strip()
# Video controller information
# to be determined
# Processor information
processor_info = subprocess.check_output(["sysctl", "-n", "machdep.cpu.brand_string"])
processor_info = processor_info.decode('utf-8').strip()
processor_manufacturer = "Intel" # Assuming Mac uses Intel processors
processor_name = processor_info
# sha1 string
hw_info = baseboard_manufacturer + ";" + baseboard_serial_number + ";" + bios_manufacturer + ";" + bios_serial_number + ";" + volume_serial_number + ";" + video_controller_pnp_device_id + ";" + processor_manufacturer + ";" + processor_id + ";" + processor_name + ';'
# Calculate SHA1 Hash of hardware string
hw_info_bytes = hw_info.encode('ascii')
hw_hash = sha1(hw_info_bytes).digest()
hash_str = 'allUsersGenericIdIS' + hw_hash.hex().lower()
print("Got hardware info: %s", hw_info)
# Calculate SHA3 256 Hash of full string
hash_bytes = hash_str.encode('ascii')
key_hash = sha3_256(hash_bytes).digest()
print("Got key hash: %s", key_hash.hex())
cipher = Cipher(algorithms.AES(key_hash), modes.CBC(iv_hash[0:16]))
# Create a decryptor object
decryptor = cipher.decryptor()
# Open input and output files
with open(filepath, 'rb') as infile, open("IS.json", 'wb') as outfile:
# Read the first 64 bytes and discard them
infile.read(64)
block_size = 16
while True:
# Read a block from the input file
block = infile.read(block_size)
if not block:
break # Reached end of file
# Decrypt the block and write to the output file
decrypted_block = decryptor.update(block)
outfile.write(decrypted_block)
print("IS decrypted successfully. Move the file to the EA Desktop folder. Enjoy using Galaxy!")
elif platform.system() == "Linux":
# Retrieve system information
baseboard_manufacturer = ''
baseboard_serial_number = ''
bios_manufacturer = ''
bios_serial_number = ''
volume_serial_number = ''
video_controller_pnp_device_id = ''
processor_manufacturer = ''
processor_id = ''
processor_name = ''
# Baseboard information
with open('/sys/class/dmi/id/board_vendor', 'r') as f:
baseboard_manufacturer = f.read().strip()
with open('/sys/class/dmi/id/board_serial', 'r') as f:
baseboard_serial_number = f.read().strip()
# BIOS information
with open('/sys/class/dmi/id/bios_vendor', 'r') as f:
bios_manufacturer = f.read().strip()
with open('/sys/class/dmi/id/bios_version', 'r') as f:
bios_serial_number = f.read().strip()
# Disk information (assuming the root partition is mounted at /)
partition = psutil.disk_partitions(all=False)[0]
volume_serial_number = psutil.disk_usage(partition.mountpoint).serial
# Video controller information (you may need to adjust this)
for device in psutil.pids():
try:
cmdline = psutil.Process(device).cmdline()
if "Xorg" in cmdline or "xorg" in cmdline:
# Extract video controller information from Xorg process
# TEST THIS
video_controller_pnp_device_id = cmdline[cmdline.index("Xorg") + 1]
pass
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
pass
# Processor information
processor_info = os.popen("lscpu").read()
lines = processor_info.split('\n')
for line in lines:
if "Vendor ID:" in line:
processor_manufacturer = line.split(':')[1].strip()
elif "Model name:" in line:
processor_name = line.split(':')[1].strip()
# sha1 string
hw_info = baseboard_manufacturer + ";" + baseboard_serial_number + ";" + bios_manufacturer + ";" + bios_serial_number + ";" + volume_serial_number + ";" + video_controller_pnp_device_id + ";" + processor_manufacturer + ";" + processor_id + ";" + processor_name + ';'
# Calculate SHA1 Hash of hardware string
hw_info_bytes = hw_info.encode('ascii')
hw_hash = sha1(hw_info_bytes).digest()
hash_str = 'allUsersGenericIdIS' + hw_hash.hex().lower()
print("Got hardware info: %s", hw_info)
# Calculate SHA3 256 Hash of full string
hash_bytes = hash_str.encode('ascii')
key_hash = sha3_256(hash_bytes).digest()
print("Got key hash: %s", key_hash.hex())
cipher = Cipher(algorithms.AES(key_hash), modes.CBC(iv_hash[0:16]))
# Create a decryptor object
decryptor = cipher.decryptor()
# Open input and output files
with open(filepath, 'rb') as infile, open("IS.json", 'wb') as outfile:
# Read the first 64 bytes and discard them
infile.read(64)
block_size = 16
while True:
# Read a block from the input file
block = infile.read(block_size)
if not block:
break # Reached end of file
# Decrypt the block and write to the output file
decrypted_block = decryptor.update(block)
outfile.write(decrypted_block)
print("IS decrypted successfully. Move the file to the EA Desktop folder. Enjoy using Galaxy!")
else:
# Unsupported platform
pass |
Now, about the .eacrc. It seems the encoding is different from the original Origin map.crc files, so i'll need to check how can I do it. |
Hm, I feel like getting the install size is fairly low priority. |
Hi @BellezaEmporium Could you post your latest? |
Nice to see you've managed your path through. I'll try, and post my version. Been working on the .eacrc file support. |
This is going to be a long ride... |
I think this one is solved by doing "pip install pypiwin32" in your global (not venv) environment. |
I already do have this package up in my programs. It's because it strictly searchs for a package named "pywintypes". It exists in the win32/lib folder, but then goes by a series of other errors... |
Hm, I got past that one somehow without a pywintypes package specifically. Is pywin32 in your venv "pip list"? EDIT: No, I lied. I am stuck on that one still... |
Yes, I've even did the pywin32_postinstall.py file (as Admin) |
I've added my version of the code. |
@BellezaEmporium : I had a little time to do some experiments. I was able to get pywintypes module to import, but it seems like we can't get at the win32api .dlls from the GOG context, so we're stuck with calling wmic. I fixed an issue with NVIDIA adapters in a PR to your dev branch. I also submitted a draft PR that creates the decrypted IS file by calling python as admin. As explained in the PR, this will require some thought to do a proper implementation, but it's a start. |
hey guys could you upload the latest version you have thats stable to the repo? |
I wouldn't say any of it is quite ready for primetime, stick with PR #47 here or with the "main" branch of @BellezaEmporium 's fork (if I'm not mistaken, they're pretty much the same, after he branched "dev" and rolled back). We've made some progress in dev, and we've been discussing the progress there in one of my out-of-date PRs. However, it's not really ready for testing yet. |
What he just said. We could pull out the dev branch onto main but there's some functionalities that are still WIP that we need to work on. |
@BellezaEmporium @Nutzzz I'm the guy who worked on fixing the Steam Plugin and also a member of GOG Nebula. I can't really guarentee a lot of time to help with your plugin attempts, but I'd like to reach out anyway and see what your progress is and if you're stuck on anything i can help with. I saw a fork mentioned on the steam page but it looks like you've already incorporated the same changes in yours, so that's not particularly helpful :( That said, i'm intimately (albeit reluctantly) familiar with how Galaxy Plugins work, so if you want to pick my brain, let me know. I can do some testing when needed as well. One of the devs at Nebula runs Mac, so if you need builds for MacOS, i can see if that is an option moving forward as well. |
@ABaumher : I'm not very familiar with Python (not that it's particularly hard), let alone Galaxy plugins, but I've had some experience with analyzing the various game launcher databases/manifests, including EA's, so I was able to help out with a few tasks. After we got the IS file decryption working I spent a lot of time figuring out a way to get admin rights to a guaranteed Python environment--the one that comes with Galaxy--but now that I did so, I'm unclear why that was necessary since I can read the encrypted IS file just fine in a C# program [without admin rights]. In any case, now that we have a decrypted .json file, I figured the parsing would be fairly easy to implement based on the prior art, but @BellezaEmporium hasn't made any public check-ins, and I haven't investigated further. |
I had little time to check again, been busy on personal stuff. What we need basically now is :
|
Fyi, file size is optional. Afaik the documentation says you can just use 0 if you don't have it. It's nice to have for things like install size but if it's not easily available don't bother. You actually can enable or disable features in the plugin simply by adding or removing the related functions to the plugin.py file, so if things like achievements or chat won't work you can pull those out. Can you give me a bit of context on the .IS file? I'm realizing this is not something i can just look at on my phone and understand; I'll need to look at it on my gaming pc when i have time. From what I've read so far the old plugin code would parse manifest files, but an earlier comment said they're now encrypted. |
The IS file is an encrypted JSON file made by EA in order to retrace the owned games inside your computer. When you install or own a new game, the IS file is rewritten, adding tons of data related to it, such as the SoftwareID. the base slug, some installation checks and so on. Everything is written there, from base games to downloadable content. This excellent wiki article from erri120 resumes how the encryption works and, by working with @Nutzzz we've managed to port the decryption system to Python. |
The plugin architecture has a An aside, I'm not sure the folks at nebula would be overly happy requiring admin, but I'd prioritize getting it working before worrying about that. I'm sure people would much prefer the plugin works and be willing to hit "allow this program" |
The UAC is because the IS file is inside a protected folder inside EA Desktop's files. Copying or reading it is protected by user control. Might be different in another OS, but that's what I'm confronted with Windows. Nebula's Steam plugin was a great aid in multiple use-cases. I'll continue checking the plugin in case certain ideas you've had can be applied inside the EAD plugin. |
I was afraid of that. Usually they're write protected but you can read them just fine, then either dump the contents to a temp file or just do it in memory. I'm curious since there's a way to do it without uac in c#, if there's a way to do it in python a well. Might be a difference in how python opens the file; maybe one of the 6 million python packages has a workaround, but again, not worth looking into until everything else is working |
Not sure if you are using mypy or another linter but i generated type hints for the galaxy api at https://github.com/ABaumher/Galaxy-Integration-API-Python-Typing |
Thanks! It worked! |
A few updates here : -> I've implemented IS file caching (onto temp folder) and reading it is now OK. Plugin works perfectly as-is right now on dev branch, but I want to be extra sure before shipping everything into the master branch. |
Once i'm done with the few final aspects of the project, i'm strongly considering to create an "one-click" installation system like certain plugins already do, and join forces with the GOG-Nebula community. (with their authorization, I accept that my project becomes a GOG-Nebula official integration) |
After reconsideration I might need to fully rewrite the integration to support the new Juno API, as EA announced their EA Desktop app as a replacement for Origin in macOS, with the intent to migrate all users into EA Desktop soon. I believe the Origin API as we know it will disappear in favour of the new Juno API. Everything will be in GraphQL, which simplifies things a bit, but i'm afraid that the SHA256 used in the end of each request (and mandatory) changes over time. |
https://www.ea.com/ea-app
The text was updated successfully, but these errors were encountered: