ysfchn / samfetch Goto Github PK
View Code? Open in Web Editor NEWA web API to download Samsung firmware easily without headers, authorization or anything that you don't want.
License: GNU Affero General Public License v3.0
A web API to download Samsung firmware easily without headers, authorization or anything that you don't want.
License: GNU Affero General Public License v3.0
Hi,
You are doing a great job <3
Can you please add resume support for the file
Can you please add file size support?
Giving error while deploying
Requested runtime (python-3.7.6) is not available for this stack (heroku-20).
I can successufully get details about firmware for my model and region by using:
/DBT/SM-R895F/list
But when trying to fetch details about the latest firmware I get a server error:
/DBT/SM-R895F/latest
{"description":"Internal Server Error","status":500,"message":"The server encountered an internal error and cannot complete your request."}
Downloading does not work aswell:
/DBT/SM-R895F/latest/download
Even when trying to access the firmware using the correct path (got it from my browsing history) i still get Server error 500.
So I guess something changed on Samsungs backend?
Path: /EUX/SM-F926B
Server Environment:
Client Environment:
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.7/site-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.7/site-packages/fastapi/applications.py", line 208, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.7/site-packages/starlette/applications.py", line 112, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.7/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc
File "/usr/local/lib/python3.7/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.7/site-packages/starlette/middleware/cors.py", line 84, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.7/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc
File "/usr/local/lib/python3.7/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.7/site-packages/starlette/routing.py", line 656, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.7/site-packages/starlette/routing.py", line 259, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.7/site-packages/starlette/routing.py", line 64, in app
await response(scope, receive, send)
File "/usr/local/lib/python3.7/site-packages/starlette/responses.py", line 227, in __call__
await wrap(partial(self.listen_for_disconnect, receive))
File "/usr/local/lib/python3.7/site-packages/anyio/_backends/_asyncio.py", line 567, in __aexit__
raise exceptions[0]
File "/usr/local/lib/python3.7/site-packages/anyio/_backends/_asyncio.py", line 604, in _run_wrapped_task
await coro
File "/usr/local/lib/python3.7/site-packages/starlette/responses.py", line 223, in wrap
await func()
File "/usr/local/lib/python3.7/site-packages/starlette/responses.py", line 217, in stream_response
await send({"type": "http.response.body", "body": b"", "more_body": False})
File "/usr/local/lib/python3.7/site-packages/starlette/exceptions.py", line 68, in sender
await send(message)
File "/usr/local/lib/python3.7/site-packages/starlette/middleware/errors.py", line 156, in _send
await send(message)
File "/usr/local/lib/python3.7/site-packages/uvicorn/protocols/http/h11_impl.py", line 477, in send
output = self.conn.send(event)
File "/usr/local/lib/python3.7/site-packages/h11/_connection.py", line 468, in send
data_list = self.send_with_data_passthrough(event)
File "/usr/local/lib/python3.7/site-packages/h11/_connection.py", line 501, in send_with_data_passthrough
writer(event, data_list.append)
File "/usr/local/lib/python3.7/site-packages/h11/_writers.py", line 60, in __call__
self.send_eom(event.headers, write)
File "/usr/local/lib/python3.7/site-packages/h11/_writers.py", line 83, in send_eom
raise LocalProtocolError("Too little data for declared Content-Length")
h11._util.LocalProtocolError: Too little data for declared Content-Length
INFO: 192.168.96.1:32934 - "GET /EUX/SM-F926B HTTP/1.1" 200 OK
Not sure if I'm missing something but it seems like the /api/binary
endpoint returns the same response body regardless of the params sent with the request.
Request:
/api/binary?region=XAA&model=SM-G986U1&firmware=G986U1UEU1DUB7%2FG986U1OYM1DUB7%2FG986U1UEU1DUB7%2FG986U1UEU1DUB7
Response:
{
"display_name": "SSP",
"size": 5991219840,
"filename": "SM-G986U1_1_20210416234737_q8wahqy67m_fac.zip.enc4",
"path": "/neofus/910/",
"version": "R (Android 11)",
"encrypt_version": 4,
"size_readable": "5.58 GB",
"decrypt_key": "60813b9c940b3e286de84bff7baaf403"
}
The 20210416
date of the firmware is what tipped me off because I'm trying to download a firmware from 2-28. So I also tried a couple of other firmwares (all pulled from the /api/list
endpoint) and they all returned the same response as above. I'm guessing it's just returning info for the latest firmware every time but I'm not sure.
As SamFetch directly streams the file to the browser, I can't unpad the bytes of the last chunk of the file because Iterator
and/or Generator
doesn't allow me to know which chunk is the last, but it is normal, because SamFetch doesn't know when the file will finish downloading.
So it appends unnecessary bytes to the end of the file. And 7Zip (or etc) may return this warning. (not an error) when opening the archive.
There are some data after the end of the payload data.
But looks like it is not a critical issue because such programs like 7Zip can handle that as payload data is already stable/safe and file contents are decrypted as expected.
Anyways, if you get any errors while opening the archive because of the above error, use something like 7Zip.
Because of that hash values of the firmware archive also are different than shown on the Kies servers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.