René's URL Explorer Experiment


Title: ota中有tar.gz压缩包升级方式,请问这个压缩包是如何制作的 · Issue #2 · QuecPython/QFrame · GitHub

Open Graph Title: ota中有tar.gz压缩包升级方式,请问这个压缩包是如何制作的 · Issue #2 · QuecPython/QFrame

X Title: ota中有tar.gz压缩包升级方式,请问这个压缩包是如何制作的 · Issue #2 · QuecPython/QFrame

Description: class FileDecode(object): def __init__(self, zip_file, parent_dir="/fota/usr/"): self.data = b'' self.fp = open(zip_file, "rb") self.fileData = None self.parent_dir = parent_dir self.update_file_list = [] def get_update_files(self): retu...

Open Graph Description: class FileDecode(object): def __init__(self, zip_file, parent_dir="/fota/usr/"): self.data = b'' self.fp = open(zip_file, "rb") self.fileData = None self.parent_dir = parent_dir self.update_file_li...

X Description: class FileDecode(object): def __init__(self, zip_file, parent_dir="/fota/usr/"): self.data = b'' self.fp = open(zip_file, "rb") self.fileData = None self.parent_dir = pa...

Opengraph URL: https://github.com/QuecPython/QFrame/issues/2

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ota中有tar.gz压缩包升级方式,请问这个压缩包是如何制作的","articleBody":"```\nclass FileDecode(object):\n\n    def __init__(self, zip_file, parent_dir=\"/fota/usr/\"):\n        self.data = b''\n        self.fp = open(zip_file, \"rb\")\n        self.fileData = None\n        self.parent_dir = parent_dir\n        self.update_file_list = []\n\n    def get_update_files(self):\n        return self.update_file_list\n\n    def unzip(self):\n        \"\"\"缓存到内存中\"\"\"\n        self.fp.seek(10)\n        self.fileData = uzlib.DecompIO(self.fp, -15, 1)\n\n    @classmethod\n    def _ascii_trip(cls, data):\n        return data.decode('ascii').rstrip('\\0')\n\n    @classmethod\n    def file_size(cls, data):\n        \"\"\"获取真实size数据\"\"\"\n        size = cls._ascii_trip(data)\n        if not len(size):\n            return 0\n        return int(size, 8)\n\n    @classmethod\n    def get_file_name(cls, file_name):\n        \"\"\"获取文件名称\"\"\"\n        return cls._ascii_trip(file_name)\n\n    def get_data(self):\n        return self.fileData.read(0x200)\n\n    def unpack(self):\n        try:\n            folder_list = set()\n            self.data = self.get_data()\n            while True:\n                if not self.data:\n                    break\n                size = self.file_size(self.data[124:135])\n                file_name = self.get_file_name(self.data[:100])\n                full_file_name = self.parent_dir + file_name\n\n                if not size:\n                    if len(full_file_name):\n                        ql_fs.mkdirs(full_file_name)\n                        if full_file_name not in folder_list and full_file_name != self.parent_dir:\n                            folder_list.add(full_file_name)\n                    else:\n                        return\n                    self.data = self.get_data()\n                else:\n                    self.data = self.get_data()\n                    update_file = open(full_file_name, \"wb+\")\n                    total_size = size\n                    while True:\n                        size -= 0x200\n                        if size \u003c= 0:\n                            update_file.write(self.data[:size + 512])\n                            break\n                        else:\n                            update_file.write(self.data)\n                        self.data = self.get_data()\n                    self.data = self.get_data()\n                    update_file.close()\n                    self.update_file_list.append({\"file_name\": file_name, \"size\": total_size})\n        except Exception as e:\n            self.fp.close()\n            return False\n        else:\n            self.fp.close()\n            return True\n\n\nclass AppFota(object):\n\n    def __init__(self):\n        self.fota = BaseAppFota.new()\n\n    def set_update_flag(self):\n        \"\"\"设置升级标志(当且仅当升级文件下载成功后,且设置了升级标志,重启后才会触发升级,否则不升级。)\"\"\"\n        self.fota.set_update_flag()\n\n    def download(self, url, file_name):\n        \"\"\"下载单一升级文件\n\n        @url: 待下载文件的url,类型为str。\n        @file_name: 本地待升级文件的绝对路径,类型str。\n        \"\"\"\n        if self.fota.download(url, file_name) == 0:\n            return True\n        return False\n\n    def bulk_download(self, info):\n        \"\"\"批量下载升级文件\n\n        @info: 批量下载列表,列表的元素均为包含了url和file_name的字典,类型为list\n        \"\"\"\n        return self.fota.bulk_download(info)\n\n    @staticmethod\n    def __download_file_from_server(url, path):\n        response = request.get(url)\n        if response.status_code not in (200, 206):\n            return False\n        with open(path, 'wb') as f:\n            for c in response.content:\n                f.write(c)\n\n    @staticmethod\n    def __decode_file_to_updater_dir(path, updater_dir):\n        fd = FileDecode(path, parent_dir=updater_dir)\n        ql_fs.mkdirs(updater_dir)\n        fd.unzip()\n        if fd.unpack():\n            for file in fd.update_file_list:\n                update_download_stat('', '/usr/' + file['file_name'], file['size'])\n            return True\n        else:\n            return False\n\n    def download_tar(self, url, path=\"/usr/temp.tar.gz\"):\n        \"\"\"通过压缩文件下载升级。\"\"\"\n        self.__download_file_from_server(url, path)\n        if self.__decode_file_to_updater_dir(\n            path,\n            self.fota.app_fota_pkg_mount.fota_dir + '/usr/.updater/usr/'\n        ):\n            uos.remove(path)\n            return True\n        else:\n            return False\n```\n\n这个解压缩函数,对应的压缩包是如何制作的","author":{"url":"https://github.com/Connor-WangK","@type":"Person","name":"Connor-WangK"},"datePublished":"2025-04-09T03:28:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2/QFrame/issues/2"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:04116bb3-2ef6-e494-d0c5-28773ce2b43d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBF74:1D772C:216B378:2C1FE9D:696B1071
html-safe-nonce1fac33c4197a05df16fa6f323c0682ff7c6e9715c33873e0be2a82e81fbdaa39
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjc0OjFENzcyQzoyMTZCMzc4OjJDMUZFOUQ6Njk2QjEwNzEiLCJ2aXNpdG9yX2lkIjoiMjQ3MTA5MzQxMDk5OTI0Mjg2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac5297d094e2e5fa8f8a45edc1f247e6869e0ff73b0cb1816cfbd507958924f40b
hovercard-subject-tagissue:2981432685
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/QuecPython/QFrame/2/issue_layout
twitter:imagehttps://opengraph.githubassets.com/110dfeaa6a2fcf3bd76cc5e345432a84ed460c3d9fa11e220567105e15485cc1/QuecPython/QFrame/issues/2
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/110dfeaa6a2fcf3bd76cc5e345432a84ed460c3d9fa11e220567105e15485cc1/QuecPython/QFrame/issues/2
og:image:altclass FileDecode(object): def __init__(self, zip_file, parent_dir="/fota/usr/"): self.data = b'' self.fp = open(zip_file, "rb") self.fileData = None self.parent_dir = parent_dir self.update_file_li...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameConnor-WangK
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
go-importgithub.com/QuecPython/QFrame git https://github.com/QuecPython/QFrame.git
octolytics-dimension-user_id76984362
octolytics-dimension-user_loginQuecPython
octolytics-dimension-repository_id725970472
octolytics-dimension-repository_nwoQuecPython/QFrame
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id725970472
octolytics-dimension-repository_network_root_nwoQuecPython/QFrame
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/QuecPython/QFrame/issues/2#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FQuecPython%2FQFrame%2Fissues%2F2
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FQuecPython%2FQFrame%2Fissues%2F2
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=QuecPython%2FQFrame
Reloadhttps://github.com/QuecPython/QFrame/issues/2
Reloadhttps://github.com/QuecPython/QFrame/issues/2
Reloadhttps://github.com/QuecPython/QFrame/issues/2
QuecPython https://github.com/QuecPython
QFramehttps://github.com/QuecPython/QFrame
Notifications https://github.com/login?return_to=%2FQuecPython%2FQFrame
Fork 3 https://github.com/login?return_to=%2FQuecPython%2FQFrame
Star 13 https://github.com/login?return_to=%2FQuecPython%2FQFrame
Code https://github.com/QuecPython/QFrame
Issues 1 https://github.com/QuecPython/QFrame/issues
Pull requests 1 https://github.com/QuecPython/QFrame/pulls
Actions https://github.com/QuecPython/QFrame/actions
Projects 0 https://github.com/QuecPython/QFrame/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/QuecPython/QFrame/security
Please reload this pagehttps://github.com/QuecPython/QFrame/issues/2
Insights https://github.com/QuecPython/QFrame/pulse
Code https://github.com/QuecPython/QFrame
Issues https://github.com/QuecPython/QFrame/issues
Pull requests https://github.com/QuecPython/QFrame/pulls
Actions https://github.com/QuecPython/QFrame/actions
Projects https://github.com/QuecPython/QFrame/projects
Security https://github.com/QuecPython/QFrame/security
Insights https://github.com/QuecPython/QFrame/pulse
New issuehttps://github.com/login?return_to=https://github.com/QuecPython/QFrame/issues/2
New issuehttps://github.com/login?return_to=https://github.com/QuecPython/QFrame/issues/2
ota中有tar.gz压缩包升级方式,请问这个压缩包是如何制作的https://github.com/QuecPython/QFrame/issues/2#top
https://github.com/Connor-WangK
https://github.com/Connor-WangK
Connor-WangKhttps://github.com/Connor-WangK
on Apr 9, 2025https://github.com/QuecPython/QFrame/issues/2#issue-2981432685
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.