[
  {
    "path": ".gitattributes",
    "content": "*.py text eol=lf\n*.sh text eol=lf\n*.exe binary\n*.apk binary\n*.so binary\n*.xml text eol=crlf\n*.bat text eol=crlf\n*.ps1 text eol=crlf\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: [yujincheng08]\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.yml",
    "content": "name: Bug report/反馈 Bug\ndescription: Report errors or unexpected behavior./反馈错误或异常行为。\nlabels: [bug]\ntitle: \"[Bug] Short description.\"\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for reporting issues of MagiskOnWSALocal!\n\n        To make it easier for us to help you please enter detailed information below.\n        \n        感谢给 MagiskOnWSALocal 汇报问题！\n        为了使我们更好地帮助你，请提供以下信息。\n        为了防止重复汇报，标题请务必使用英文。\n  - type: textarea\n    attributes:\n      label: Steps to reproduce/复现步骤\n      value: |\n        1. \n        2. \n        3. \n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Expected behaviour/预期行为\n      placeholder: Tell us what should happen/正常情况下应该发生什么\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Actual behaviour/实际行为\n      placeholder: Tell us what happens instead/实际上发生了什么\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: MagiskOnWSALocal commit full SHA/MagiskOnWSALocal 提交的完整哈希\n      description:  Don't use 'latest'. Copy and paste full commit SHA, otherwise your issue will be closed./不要填用“最新”。复制并粘贴完整 commit SHA，不然 issue 会被关闭。\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Linux distribution info/Linux 发行版信息\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: Windows version/Windows 版本\n      placeholder: 10.0.22000.978\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Build Parameters/构建参数\n      description: The script prints the build information each time you start a build. It looks like this, please copy and paste it./每次开始构建时脚本都会打印构建信息，它看起来是这样的，请复制并粘贴上来。\n      placeholder: |\n        COMMAND_LINE=--arch x64 --release-type retail --magisk-ver stable --gapps-brand MindTheGapps --gapps-variant pico  --root-sol magisk\n        INFO: Architecture: x64\n        INFO: Release Type: retail\n        INFO: Magisk Version: stable\n        INFO: GApps Brand: MindTheGapps\n        INFO: GApps Variant: pico\n        INFO: Root Solution: magisk\n        Build: RELEASE_TYPE=Retail\n    validations:\n      required: true\n  - type: checkboxes\n    id: latest\n    attributes:\n      label: Version requirement/版本要求\n      options:\n        - label: I am using latest commit of MagiskOnWSALocal/我正在使用最新 commit 的版本\n          required: true\n  - type: textarea\n    attributes:\n      label: Logs/日志\n      description: Please copy and paste the error or submit a screenshot. Without log, the issue will be closed. /请复制粘贴错误或提交截图。无日志提交会被关闭。\n      value: |\n        <details>\n        \n        [//]: <> (Don't modify above)\n        \n        ```\n        # Replace this line with the log / 将此行用日志替换\n        ```\n        [//]: <> (Don't modify below)\n        </details>\n    validations:\n      required: true\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\ncontact_links:\n  - name: Ask a question/提问\n    url: https://github.com/LSPosed/MagiskOnWSALocal/discussions/new?category=Q-A\n    about: Please ask and answer questions here./如果有任何疑问请在这里提问\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.yml",
    "content": "---\nname: Feature request/新特性请求\ndescription: Suggest an idea./提出建议\nlabels: [enhancement]\ntitle: \"[Feature Request] Short description.\"\nbody:\n  - type: textarea\n    attributes:\n      label: Is your feature request related to a problem?/你的请求是否与某个问题相关？\n      placeholder: A clear and concise description of what the problem is./请清晰准确表述该问题。\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Describe the solution you'd like/描述你想要的解决方案\n      placeholder: A clear and concise description of what you want to happen./请清晰准确描述新特性的预期行为\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Additional context/其他信息\n      placeholder: Add any other context or screenshots about the feature request here./其他关于新特性的信息或者截图\n    validations:\n      required: false"
  },
  {
    "path": ".github/pull_request_template.md",
    "content": "<!--\n  Please include a summary of the change and which issue is fixed.\n  Also make sure you've tested your code and also done a self-review of it.\n\n  DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.\n-->\n\nChecklist\n\n- [ ] Referenced all related issues in the PR body (e.g. \"Closes #xyz\")\n- [ ] Have tested the modifications\n"
  },
  {
    "path": ".github/workflows/issue_moderator.yml",
    "content": "name: Issue moderator\n\non:\n  issues:\n    types: [opened]\n  pull_request:\n    types: [opened, edited]\n\njobs:\n  autoclose:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Check issue\n        uses: tachiyomiorg/issue-moderator-action@v2\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          auto-close-rules: |\n            [\n              {\n                \"type\": \"title\",\n                \"regex\": \".*Short description.*\",\n                \"message\": \"You did not fill out the description in the title\"\n              }\n            ]\n          auto-close-ignore-label: do-not-autoclose\n      - name: Check PR\n        uses: sumally/github-check-tasklist-action@v1\n"
  },
  {
    "path": ".github/workflows/lock-closed-issues.yml",
    "content": "name: Lock closed issue\n\non: \n  issues:\n    types: [closed]\n\njobs:\n  lock:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: OSDKDev/lock-issues@v1\n      with:\n        repo-token: \"${{ secrets.GITHUB_TOKEN }}\"\n"
  },
  {
    "path": ".github/workflows/lock.yml",
    "content": "name: 'Lock Threads'\n\non:\n  issues:\n    types: [closed]\n  pull_request:\n    types: [closed]\n  workflow_dispatch:\n\npermissions:\n  issues: write\n  pull-requests: write\n\nconcurrency:\n  group: lock\n\njobs:\n  action:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: dessant/lock-threads@v4\n        with:\n          exclude-any-issue-labels: 'do-not-autoclose'\n          exclude-any-pr-labels: 'do-not-autoclose'\n          include-any-pr-labels: 'spam'\n"
  },
  {
    "path": ".github/workflows/ps2check.yml",
    "content": "name: PSScript checker\n\non:\n  push:\n    paths:\n      - '**.ps1'\n      - '.github/workflows/ps2check.yml'\n  pull_request:\n    paths:\n      - '**.ps1'\n      - '.github/workflows/ps2check.yml'\n  workflow_dispatch:\n\njobs:\n  shellcheck:\n    runs-on: windows-latest\n    steps:\n    - name : Checkout\n      uses: actions/checkout@v3\n\n    - name: Run PSScriptAnalyzer\n      uses: microsoft/psscriptanalyzer-action@v1.0\n      with:\n        path: .\\installer\n        recurse: true \n        includeDefaultRules: true \n        enableExit: true\n"
  },
  {
    "path": ".github/workflows/shellcheck.yml",
    "content": "name: Shell checker\n\non:\n  push:\n    paths:\n      - '**.sh'\n      - '.github/workflows/shellcheck.yml'\n  pull_request:\n    paths:\n      - '**.sh'\n      - '.github/workflows/shellcheck.yml'\n  workflow_dispatch:\n\njobs:\n  shellcheck:\n    runs-on: ubuntu-latest\n    steps:\n    - name : Checkout\n      uses: actions/checkout@v3\n\n    - name: Run ShellCheck\n      id: check\n      uses: ludeeus/action-shellcheck@master\n      with:\n       scandir: './scripts'\n"
  },
  {
    "path": ".gitignore",
    "content": "download\noutput\npython3-env\ntoken\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "docs/Custom-GApps.md",
    "content": "# How to install custom GApps\n\n1. Build WSA without gapps to let the script download needed files\n\n    `./build.sh --gapps-brand none`\n1.\n    - For OpenGApps\n\n        Place custom OpenGApps to `download` folder and rename to `OpenGApps-{arch}-{variant}.zip` (e.g. `OpenGApps-x64-pico.zip`)\n    - For MindTheGapps\n\n        Place custom MindTheGapps to `download` folder and rename to `MindTheGapps-{arch}.zip` (e.g. `MindTheGapps-x64.zip`)\n1. Build WSA offline\n\n    `./build.sh --offline --gapps-brand {brand} --gapps-variant {variant}`\n"
  },
  {
    "path": "docs/KernelSU.md",
    "content": "# Install KernelSU\n\n## Install Manager\n\n1. Download KernelSU Manager from [![Build Manager](https://github.com/tiann/KernelSU/actions/workflows/build-manager.yml/badge.svg?event=push)](https://github.com/tiann/KernelSU/actions/workflows/build-manager.yml?query=event%3Apush+is%3Acompleted+branch%3Amain) (Download the artifact named `manager`).\n\n1. Unzip the downloaded zip package and get the manager apk named `KernelSU_vx.x.x-xx-.....apk`.\n\n1. Use the command `adb install <apkname>.apk` to install the manager.\n\n## Install Kernel\n\n1. Download pre-build kernel from [![Build Kernel - WSA](https://github.com/tiann/KernelSU/actions/workflows/build-kernel-wsa.yml/badge.svg?event=push)](https://github.com/tiann/KernelSU/actions/workflows/build-kernel-wsa.yml?query=branch%3Amain+event%3Apush+is%3Acompleted) (Remember to download the same architecture).\n\n1. Unzip the downloaded zip package and get the kernel file named `bzImage`.\n\n1. Replace the kernel in the folder named `Tools` in the WSA directory with `bzImage`.\n\n1. Restart WSA and then enjoy.\n"
  },
  {
    "path": "docs/README.md",
    "content": "# Magisk on WSA (with Google Apps)\n\n:warning: Magisk on WSA will no longer be available after March 5, 2025. [Learn more](https://learn.microsoft.com/en-us/windows/android/wsa/).\n\n:warning: For fork developers: Please don't build using GitHub Actions, as GitHub will count your forked GitHub Actions usage against this upstream repository, which may cause this upstream repository gets disabled by GitHub staff like [MagiskOnWSA](https://github.com/LSPosed/MagiskOnWSA) because of numerous forks building GitHub Actions, and counting the forks' Action usage against this upstream repository.\n\n## Support for generating from these systems\n\n- Linux (x86_64 or arm64)\n\n  The following dependencies are required:\n\n  | DistrOS             |                            |            |                    |               |               |\n  |:-------------------:|----------------------------|------------|--------------------|---------------|---------------|\n  | Debian              | `python3 aria2 unzip sudo` | `whiptail` | `python3-venv`     | `python3-pip` | `p7zip-full`  |\n  | openSUSE Tumbleweed | Same as above              | `dialog`   | `python3-venvctrl` | Same as above | Same as above |\n  | Arch                | Same as Debian             | `libnewt`  |  Same as Debian    | `python-pip`  | `p7zip`       |\n\n  The python3 library `requests` is used.\n\n  Python version ≥ **3.7.2**.\n\n  - Recommended use\n\n    - Ubuntu (You can use [WSL2](https://apps.microsoft.com/store/search?publisher=Canonical%20Group%20Limited))\n\n      Ready to use right out of the box.\n\n    - Debian (You can use [WSL2](https://apps.microsoft.com/store/detail/debian/9MSVKQC78PK6))\n\n      Ready to use right out of the box.\n\n    - openSUSE Tumbleweed (You can use [WSL2](https://apps.microsoft.com/store/detail/opensuse-tumbleweed/9MSSK2ZXXN11))\n\n      Ready to use right out of the box.\n\n    `run.sh` will handle all dependencies automatically.\n\n    No need to type any commands.\n\n## Features\n\n- Integrate Magisk and GApps in a few clicks within minutes\n- Keep each build up to date\n- Support both ARM64 and x64\n- Support MindTheGapps\n- Remove Amazon Appstore\n- Fix VPN dialog not showing (use our [VpnDialogs app](https://github.com/LSPosed/VpnDialogs))\n- Add device administration feature\n- Unattended installation\n- Automatically activates developers mode in Windows 11\n- Update to the new version while preserving data with a one-click script\n- Merged all language packs\n\n## Text Guide\n\n1. Star (if you like).\n2. Clone the repo to local:\n\n   ```bash\n   git clone https://github.com/LSPosed/MagiskOnWSALocal.git --depth 1\n   ```\n\n3. Run `cd MagiskOnWSALocal`.\n4. Run `./scripts/run.sh`.\n5. Select the WSA version and its architecture (mostly x64).\n6. Select the version of Magisk.\n7. Choose which brand of GApps you want to install:\n   - MindTheGapps\n\n     There is no other variant we can choose.\n8. Select the root solution (none means no root).\n9. If you are running the script for the first time, it will take some time to complete. After the script completes, two new folders named `output` and `download` will be generated in the `MagiskOnWSALocal` folder. Go to the `output` folder. While running the `./run.sh` script in the step 3, if you selected `Yes` for `Do you want to compress the output?` then in `output` folder you will see a compressed file called `WSA-with-magisk-stable-MindTheGapps_2207.40000.8.0_x64_Release-Nightly`or else there will be folder with the `WSA-with-magisk-stable-MindTheGapps_2207.40000.8.0_x64_Release-Nightly`. If there is a folder open it and skip to step 10. NOTE: The name of compressed file or the folder generated in the `output` folder may be different for you. It will be dependent on the choices made when executing `./run.sh`.\n10. Extract the compressed file and open the folder created after the extraction of the file.\n11. Here look for file `Run.bat` and run it.\n    - If you previously have a MagiskOnWSA installation, it will automatically uninstall the previous one while **preserving all user data** and install the new one, so don't worry about your data.\n    - If you have an official WSA installation, you should uninstall it first. (In case you want to preserve your data, you can backup `%LOCALAPPDATA%\\Packages\\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\\LocalCache\\userdata.vhdx` before uninstallation and restore it after installation.)\n    - If the popup windows disappear **without asking administrative permission** and WSA is not installed successfully, you should manually run `Install.ps1` as Administrator:\n        1. Press `Win+x` and select `Windows Terminal (Admin)`.\n        2. Input `cd \"{X:\\path\\to\\your\\extracted\\folder}\"` and press `enter`, and remember to replace `{X:\\path\\to\\your\\extracted\\folder}` including the `{}`, for example `cd \"D:\\wsa\"`\n        3. Input `PowerShell.exe -ExecutionPolicy Bypass -File .\\Install.ps1` and press `Enter`.\n        4. The script will run and WSA will be installed.\n        5. If this workaround does not work, your PC is not supported for WSA.\n12. Magisk/Play Store will be launched. Enjoy by installing LSPosed-Zygisk with Zygisk enabled or Riru and LSPosed-Riru.\n\n---\n\n## FAQ\n\n<details open>\n\n- Can I delete the installed folder?\n\n  No.\n\n- How can I update WSA to a newer version?\n\n  1. Update build scripts:\n\n      ```bash\n      git pull\n      ```\n\n      For more usage of git, referred to <https://git-scm.com/book>\n\n  2. Rerun the script, replace the content of your previous installation and rerun `Install.ps1`. Don't worry, your data will be preserved.\n\n- How can I get the logcat from WSA?\n\n  `%LOCALAPPDATA%\\Packages\\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\\LocalState\\diagnostics\\logcat`\n\n- How can I update Magisk to a newer version?\n\n  Do the same as updating WSA.\n\n- How to pass Play Integrity (formerly known as SafetyNet)?\n\n  Like all the other emulators, no way.\n\n- Virtualization is not enabled?\n\n  `Install.ps1` helps you enable it if not enabled. After rebooting, rerun `Install.ps1` to install WSA. If it's still not working, you have to enable virtualization in BIOS. That's a long story so ask Google for help.\n\n- How to remount the system as read-write?\n\n  No way in WSA since it's mounted as read-only by Hyper-V. You can modify the system by making a Magisk module. Or directly modify the system.img. Ask Google for help.\n\n- I cannot `adb connect localhost:58526`, what to do?\n\n  Make sure developer mode is enabled. If the issue persists, check the IP address of WSA on the setting page and try `adb connect ip:5555`.\n\n- Why the Magisk online module is empty?\n\n  Magisk actively removes the online module repository. You can install the module locally or by `adb push module.zip /data/local/tmp` and `adb shell su -c magisk --install-module /data/local/tmp/module.zip`.\n\n- Can I use Magisk v23.0 stable or a lower version?\n\n  No. Magisk has bugs preventing itself from running on WSA. Magisk v24+ has fixed them. So you must use Magisk v24 or later.\n\n- How can I get rid of Magisk?\n\n  Choose `none` as the root solution.\n\n- How to install custom GApps?\n\n  [Tutorial](Custom-GApps.md)\n\n- Where can I download MindTheGapps?\n\n  You can download from here [MindTheGapps](https://androidfilehost.com/?w=files&flid=322935) ([mirror](http://downloads.codefi.re/jdcteam/javelinanddart/gapps)).\n\n  Note that there is no x86_64 pre-build, so you need to build it by yourself ([Repository](https://gitlab.com/MindTheGapps/vendor_gapps)).\n\n  Or you can download the built package for 12.1 and 13 for x86_64 from [this page](https://sourceforge.net/projects/wsa-mtg/files/x86_64/).\n\n- Is it possible to migrate data from a lower version like 2305 to a newer version?\n\n  This is certainly available, Microsoft's change of read-only partition from 2305's EROFS to read-only EXT4 only affects the read-only system partition.\n\n  It has no effect on the user data partition. Check the logs if there is a failure to boot.\n\n- How to install KernelSU?\n\n  [Tutorial](KernelSU.md)\n\n</details>\n\n---\n\n## Credits\n\n- [StoreLib](https://github.com/StoreDev/StoreLib): API for downloading WSA\n- [Magisk](https://github.com/topjohnwu/Magisk): The most famous root solution on Android\n- ~~[The Open GApps Project](https://opengapps.org): One of the most famous Google Apps packages solution~~\n- [WSA-Kernel-SU](https://github.com/LSPosed/WSA-Kernel-SU) and [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/): The kernel `su` for debugging Magisk Integration\n- ~~[WSAGAScript](https://github.com/ADeltaX/WSAGAScript): The first GApps integration script for WSA~~\n- ~~[erofs-utils](https://github.com/sekaiacg/erofs-utils): Pre-build `erofs-utils` with erofsfuse enabled~~\n\n_The repository is provided as a utility._\n\n_Android is a trademark of Google LLC. Windows is a trademark of Microsoft Corporation._\n"
  },
  {
    "path": "installer/Install.ps1",
    "content": "# This file is part of MagiskOnWSALocal.\r\n#\r\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\r\n# it under the terms of the GNU Affero General Public License as\r\n# published by the Free Software Foundation, either version 3 of the\r\n# License, or (at your option) any later version.\r\n#\r\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\r\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n# GNU Affero General Public License for more details.\r\n#\r\n# You should have received a copy of the GNU Affero General Public License\r\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\r\n#\r\n# Copyright (C) 2024 LSPosed Contributors\r\n#\r\n\r\n$Host.UI.RawUI.WindowTitle = \"Installing MagiskOnWSA....\"\r\nfunction Test-Administrator {\r\n    [OutputType([bool])]\r\n    param()\r\n    process {\r\n        [Security.Principal.WindowsPrincipal]$user = [Security.Principal.WindowsIdentity]::GetCurrent();\r\n        return $user.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator);\r\n    }\r\n}\r\n\r\nfunction Get-InstalledDependencyVersion {\r\n    param (\r\n        [string]$Name,\r\n        [string]$ProcessorArchitecture\r\n    )\r\n    PROCESS {\r\n        If ($null -Ne $ProcessorArchitecture) {\r\n            return Get-AppxPackage -Name $Name | ForEach-Object { if ($_.Architecture -Eq $ProcessorArchitecture) { $_ } } | Sort-Object -Property Version | Select-Object -ExpandProperty Version -Last 1;\r\n        }\r\n    }\r\n}\r\n\r\nFunction Test-CommandExist {\r\n    Param ($Command)\r\n    $OldPreference = $ErrorActionPreference\r\n    $ErrorActionPreference = 'stop'\r\n    try { if (Get-Command $Command) { RETURN $true } }\r\n    Catch { RETURN $false }\r\n    Finally { $ErrorActionPreference = $OldPreference }\r\n} #end function Test-CommandExist\r\n\r\nFunction Finish {\r\n    Clear-Host\r\n    Start-Process \"wsa://com.topjohnwu.magisk\"\r\n    Start-Process \"wsa://com.android.vending\"\r\n}\r\n\r\nIf (Test-CommandExist pwsh.exe) {\r\n    $pwsh = \"pwsh.exe\"\r\n}\r\nElse {\r\n    $pwsh = \"powershell.exe\"\r\n}\r\n\r\nIf (-Not (Test-Administrator)) {\r\n    Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force\r\n    $Proc = Start-Process -PassThru -Verb RunAs $pwsh -Args \"-ExecutionPolicy Bypass -Command Set-Location '$PSScriptRoot'; &'$PSCommandPath' EVAL\"\r\n    If ($null -Ne $Proc) {\r\n        $Proc.WaitForExit()\r\n    }\r\n    If ($null -Eq $Proc -Or $Proc.ExitCode -Ne 0) {\r\n        Write-Warning \"Failed to launch start as Administrator`r`nPress any key to exit\"\r\n        $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');\r\n    }\r\n    exit\r\n}\r\nElseIf (($args.Count -Eq 1) -And ($args[0] -Eq \"EVAL\")) {\r\n    Start-Process $pwsh -NoNewWindow -Args \"-ExecutionPolicy Bypass -Command Set-Location '$PSScriptRoot'; &'$PSCommandPath'\"\r\n    exit\r\n}\r\n\r\n$FileList = Get-Content -Path .\\filelist.txt\r\nIf (((Test-Path -Path $FileList) -Eq $false).Count) {\r\n    Write-Error \"Some files are missing in the folder. Please try to build again. Press any key to exit\"\r\n    $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')\r\n    exit 1\r\n}\r\n\r\nIf (((Test-Path -Path \"MakePri.ps1\") -And (Test-Path -Path \"makepri.exe\")) -Eq $true) {\r\n    $ProcMakePri = Start-Process $pwsh -PassThru -NoNewWindow -Args \"-ExecutionPolicy Bypass -File MakePri.ps1\" -WorkingDirectory $PSScriptRoot\r\n    $null = $ProcMakePri.Handle\r\n    $ProcMakePri.WaitForExit()\r\n    If ($ProcMakePri.ExitCode -Ne 0) {\r\n        Write-Warning \"Failed to merge resources, WSA Seetings will always be in English`r`nPress any key to continue\"\r\n        $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')\r\n    }\r\n    $Host.UI.RawUI.WindowTitle = \"Installing MagiskOnWSA....\"\r\n}\r\n\r\nreg add \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock\" /t REG_DWORD /f /v \"AllowDevelopmentWithoutDevLicense\" /d \"1\"\r\n\r\n# When using PowerShell which is installed with MSIX\r\n# Get-WindowsOptionalFeature and Enable-WindowsOptionalFeature will fail\r\n# See https://github.com/PowerShell/PowerShell/issues/13866\r\nif ($PSHOME.contains(\"8wekyb3d8bbwe\")) {\r\n    Import-Module DISM -UseWindowsPowerShell\r\n}\r\n\r\nIf ($(Get-WindowsOptionalFeature -Online -FeatureName 'VirtualMachinePlatform').State -Ne \"Enabled\") {\r\n    Enable-WindowsOptionalFeature -Online -NoRestart -FeatureName 'VirtualMachinePlatform'\r\n    Write-Warning \"Need restart to enable virtual machine platform`r`nPress y to restart or press any key to exit\"\r\n    $Key = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')\r\n    If (\"y\" -Eq $Key.Character) {\r\n        Restart-Computer -Confirm\r\n    }\r\n    Else {\r\n        exit 1\r\n    }\r\n}\r\n\r\n[xml]$Xml = Get-Content \".\\AppxManifest.xml\";\r\n$Name = $Xml.Package.Identity.Name;\r\nWrite-Output \"Installing $Name version: $($Xml.Package.Identity.Version)\"\r\n$ProcessorArchitecture = $Xml.Package.Identity.ProcessorArchitecture;\r\n$Dependencies = $Xml.Package.Dependencies.PackageDependency;\r\n$Dependencies | ForEach-Object {\r\n    $InstalledVersion = Get-InstalledDependencyVersion -Name $_.Name -ProcessorArchitecture $ProcessorArchitecture;\r\n    If ( $InstalledVersion -Lt $_.MinVersion ) {\r\n        If ($env:WT_SESSION) {\r\n            $env:WT_SESSION = $null\r\n            Write-Output \"Dependency should be installed but Windows Terminal is in use. Restarting to conhost.exe\"\r\n            Start-Process conhost.exe -Args \"powershell.exe -ExecutionPolicy Bypass -Command Set-Location '$PSScriptRoot'; &'$PSCommandPath'\"\r\n            exit 1\r\n        }\r\n        Write-Output \"Dependency package $($_.Name) $ProcessorArchitecture required minimum version: $($_.MinVersion). Installing....\"\r\n        Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Path \"$($_.Name)_$ProcessorArchitecture.appx\"\r\n    }\r\n    Else {\r\n        Write-Output \"Dependency package $($_.Name) $ProcessorArchitecture current version: $InstalledVersion. Nothing to do.\"\r\n    }\r\n}\r\n\r\n$Installed = $null\r\n$Installed = Get-AppxPackage -Name $Name\r\n\r\nIf (($null -Ne $Installed) -And (-Not ($Installed.IsDevelopmentMode))) {\r\n    Write-Warning \"There is already one installed WSA. Please uninstall it first.`r`nPress y to uninstall existing WSA or press any key to exit\"\r\n    $key = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')\r\n    If (\"y\" -Eq $key.Character) {\r\n        Clear-Host\r\n        Remove-AppxPackage -Package $Installed.PackageFullName\r\n    }\r\n    Else {\r\n        exit 1\r\n    }\r\n}\r\n\r\nIf (Test-CommandExist WsaClient) {\r\n    Write-Output \"Shutting down WSA....\"\r\n    Start-Process WsaClient -Wait -Args \"/shutdown\"\r\n}\r\nStop-Process -Name \"WsaClient\" -ErrorAction SilentlyContinue\r\nWrite-Output \"Installing MagiskOnWSA....\"\r\nAdd-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Register .\\AppxManifest.xml\r\nIf ($?) {\r\n    Finish\r\n}\r\nElseIf ($null -Ne $Installed) {\r\n    Write-Error \"Failed to update.`r`nPress any key to uninstall existing installation while preserving user data.`r`nTake in mind that this will remove the Android apps' icon from the start menu.`r`nIf you want to cancel, close this window now.\"\r\n    $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')\r\n    Clear-Host\r\n    Remove-AppxPackage -PreserveApplicationData -Package $Installed.PackageFullName\r\n    Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Register .\\AppxManifest.xml\r\n    If ($?) {\r\n        Finish\r\n    }\r\n}\r\nWrite-Output \"All Done!`r`nPress any key to exit\"\r\n$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')\r\n"
  },
  {
    "path": "installer/MakePri.ps1",
    "content": "# This file is part of MagiskOnWSALocal.\r\n#\r\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\r\n# it under the terms of the GNU Affero General Public License as\r\n# published by the Free Software Foundation, either version 3 of the\r\n# License, or (at your option) any later version.\r\n#\r\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\r\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n# GNU Affero General Public License for more details.\r\n#\r\n# You should have received a copy of the GNU Affero General Public License\r\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\r\n#\r\n# Copyright (C) 2023 LSPosed Contributors\r\n#\r\n\r\n$Host.UI.RawUI.WindowTitle = \"Merging resources....\"\r\nIf ((Test-Path -Path \"pri\") -Eq $true -And (Test-Path -Path \"xml\") -Eq $true) {\r\n    $AppxManifestFile = \".\\AppxManifest.xml\"\r\n    Copy-Item .\\resources.pri -Destination \".\\pri\\resources.pri\" | Out-Null\r\n    $ProcNew = Start-Process -PassThru makepri.exe -NoNewWindow -Args \"new /pr .\\pri /cf .\\xml\\priconfig.xml /of .\\resources.pri /mn $AppxManifestFile /o\"\r\n    $null = $ProcNew.Handle\r\n    $ProcNew.WaitForExit()\r\n    If ($ProcNew.ExitCode -Ne 0) {\r\n        Write-Warning \"Failed to merge resources from pris`r`nTrying to dump pris to priinfo....\"\r\n        New-Item -Path \".\" -Name \"priinfo\" -ItemType \"directory\"\r\n        Clear-Host\r\n        $i = 0\r\n        $PriItem = Get-Item \".\\pri\\*\" -Include \"*.pri\"\r\n        Write-Output \"Dumping resources....\"\r\n        $Processes = ForEach ($Item in $PriItem) {\r\n            Start-Process -PassThru -WindowStyle Hidden makepri.exe -Args \"dump /if $($Item | Resolve-Path -Relative) /o /es .\\pri\\resources.pri /of .\\priinfo\\$($Item.Name).xml /dt detailed\"\r\n            $i = $i + 1\r\n            $Completed = ($i / $PriItem.count) * 100\r\n            Write-Progress -Activity \"Dumping resources\" -Status \"Dumping $($Item.Name):\" -PercentComplete $Completed\r\n        }\r\n        $Processes | Wait-Process\r\n        Write-Progress -Activity \"Dumping resources\" -Status \"Ready\" -Completed\r\n        Clear-Host\r\n        Write-Output \"Creating pri from dumps....\"\r\n        $ProcNewFromDump = Start-Process -PassThru -NoNewWindow makepri.exe -Args \"new /pr .\\priinfo /cf .\\xml\\priconfig.xml /of .\\resources.pri /mn $AppxManifestFile /o\"\r\n        $null = $ProcNewFromDump.Handle\r\n        $ProcNewFromDump.WaitForExit()\r\n        Remove-Item 'priinfo' -Recurse\r\n        If ($ProcNewFromDump.ExitCode -Ne 0) {\r\n            Write-Error \"Failed to create resources from priinfos\"\r\n            exit 1\r\n        }\r\n    }\r\n\r\n    $ProjectXml = [xml](Get-Content $AppxManifestFile)\r\n    $ProjectResources = $ProjectXml.Package.Resources;\r\n    $(Get-Item .\\xml\\* -Exclude \"priconfig.xml\" -Include \"*.xml\") | ForEach-Object {\r\n        $($([xml](Get-Content $_)).Package.Resources.Resource) | ForEach-Object {\r\n            $ProjectResources.AppendChild($($ProjectXml.ImportNode($_, $true)))\r\n        }\r\n    }\r\n    $ProjectXml.Save($AppxManifestFile)\r\n    Remove-Item 'pri' -Recurse\r\n    Set-Content -Path \"filelist.txt\" -Value (Get-Content -Path \"filelist.txt\" | Select-String -Pattern '^pri$' -NotMatch)\r\n    Remove-Item 'xml' -Recurse\r\n    Set-Content -Path \"filelist.txt\" -Value (Get-Content -Path \"filelist.txt\" | Select-String -Pattern '^xml$' -NotMatch)\r\n    Remove-Item 'makepri.exe'\r\n    Set-Content -Path \"filelist.txt\" -Value (Get-Content -Path \"filelist.txt\" | Select-String -Pattern 'makepri.exe' -NotMatch)\r\n    Remove-Item $PSCommandPath -Force\r\n    Set-Content -Path \"filelist.txt\" -Value (Get-Content -Path \"filelist.txt\" | Select-String -Pattern 'MakePri.ps1' -NotMatch)\r\n    exit 0\r\n}\r\n"
  },
  {
    "path": "installer/Run.bat",
    "content": ":: This file is part of MagiskOnWSALocal.\r\n::\r\n:: MagiskOnWSALocal is free software: you can redistribute it and/or modify\r\n:: it under the terms of the GNU Affero General Public License as\r\n:: published by the Free Software Foundation, either version 3 of the\r\n:: License, or (at your option) any later version.\r\n::\r\n:: MagiskOnWSALocal is distributed in the hope that it will be useful,\r\n:: but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n:: GNU Affero General Public License for more details.\r\n::\r\n:: You should have received a copy of the GNU Affero General Public License\r\n:: along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\r\n::\r\n:: Copyright (C) 2023 LSPosed Contributors\r\n::\r\n\r\n@echo off\r\n%~d0\r\ncd \"%~dp0\"\r\nif not exist Install.ps1 (\r\n    echo \"Install.ps1\" is not found.\r\n    echo Press any key to exit\r\n    pause>nul\r\n    exit 1\r\n) else (\r\n    start powershell.exe -ExecutionPolicy Bypass -File .\\Install.ps1\r\n    exit\r\n)\r\n"
  },
  {
    "path": "scripts/build.sh",
    "content": "#!/bin/bash\n#\n# This file is part of MagiskOnWSALocal.\n#\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\n#\n# Copyright (C) 2024 LSPosed Contributors\n#\n\nif [ ! \"$BASH_VERSION\" ]; then\n    echo \"Please do not use sh to run this script, just execute it directly\" 1>&2\n    exit 1\nfi\nHOST_ARCH=$(uname -m)\nif [ \"$HOST_ARCH\" != \"x86_64\" ] && [ \"$HOST_ARCH\" != \"aarch64\" ]; then\n    echo \"Unsupported architectures: $HOST_ARCH\"\n    exit 1\nfi\ncd \"$(dirname \"$0\")\" || exit 1\n# export TMPDIR=$HOME/.cache/wsa\nif [ \"$TMPDIR\" ] && [ ! -d \"$TMPDIR\" ]; then\n    mkdir -p \"$TMPDIR\"\nfi\nWORK_DIR=$(mktemp -d -t wsa-build-XXXXXXXXXX_) || exit 1\n\nDOWNLOAD_DIR=../download\nDOWNLOAD_CONF_NAME=download.list\nPYTHON_VENV_DIR=\"$(dirname \"$PWD\")/python3-env\"\n\ndir_clean() {\n    rm -rf \"${WORK_DIR:?}\"\n    if [ \"$TMPDIR\" ] && [ -d \"$TMPDIR\" ]; then\n        echo \"Cleanup Temp Directory\"\n        rm -rf \"${TMPDIR:?}\"\n        unset TMPDIR\n    fi\n    rm -f \"${DOWNLOAD_DIR:?}/$DOWNLOAD_CONF_NAME\"\n    if [ \"$(python3 -c 'import sys ; print( 1 if sys.prefix != sys.base_prefix else 0 )')\" = \"1\" ]; then\n        echo \"deactivate python3 venv\"\n        deactivate\n    fi\n}\ntrap dir_clean EXIT\nOUTPUT_DIR=../output\nWSA_WORK_ENV=\"${WORK_DIR:?}/ENV\"\nif [ -f \"$WSA_WORK_ENV\" ]; then rm -f \"${WSA_WORK_ENV:?}\"; fi\ntouch \"$WSA_WORK_ENV\"\nexport WSA_WORK_ENV\nclean_download() {\n    if [ -d \"$DOWNLOAD_DIR\" ]; then\n        echo \"Cleanup Download Directory\"\n        if [ \"$CLEAN_DOWNLOAD_WSA\" ]; then\n            rm -f \"${WSA_ZIP_PATH:?}\"\n        fi\n        if [ \"$CLEAN_DOWNLOAD_MAGISK\" ]; then\n            rm -f \"${MAGISK_PATH:?}\"\n        fi\n        if [ \"$CLEAN_DOWNLOAD_GAPPS\" ]; then\n            rm -f \"${GAPPS_IMAGE_PATH:?}\"\n            rm -f \"${GAPPS_RC_PATH:?}\"\n        fi\n        if [ \"$CLEAN_DOWNLOAD_KERNELSU\" ]; then\n            rm -f \"${KERNELSU_PATH:?}\"\n            rm -f \"${KERNELSU_INFO:?}\"\n        fi\n    fi\n}\nabort() {\n    [ \"$1\" ] && echo -e \"ERROR: $1\"\n    echo \"Build: an error has occurred, exit\"\n    if [ -d \"$WORK_DIR\" ]; then\n        echo -e \"\\nCleanup Work Directory\"\n        dir_clean\n    fi\n    clean_download\n    exit 1\n}\ntrap abort INT TERM\n\ndefault() {\n    ARCH=x64\n    RELEASE_TYPE=retail\n    MAGISK_VER=stable\n    ROOT_SOL=magisk\n    COMPRESS_FORMAT=none\n}\n\nexit_with_message() {\n    echo \"ERROR: $1\"\n    usage\n    exit 1\n}\n\nARCH_MAP=(\n    \"x64\"\n    \"arm64\"\n)\n\nRELEASE_TYPE_MAP=(\n    \"retail\"\n    \"RP\"\n    \"WIS\"\n    \"WIF\"\n)\n\nMAGISK_VER_MAP=(\n    \"stable\"\n    \"beta\"\n    \"canary\"\n    \"debug\"\n    \"release\"\n)\n\nROOT_SOL_MAP=(\n    \"magisk\"\n    \"kernelsu\"\n    \"none\"\n)\n\nCOMPRESS_FORMAT_MAP=(\n    \"7z\"\n    \"zip\"\n    \"none\"\n)\n\nARR_TO_STR() {\n    local arr=(\"$@\")\n    local joined\n    printf -v joined \"%s, \" \"${arr[@]}\"\n    echo \"${joined%, }\"\n}\n\nusage() {\n    default\n    echo -e \"\nUsage:\n    --arch              Architecture of WSA.\n\n                        Possible values: $(ARR_TO_STR \"${ARCH_MAP[@]}\")\n                        Default: $ARCH\n\n    --release-type      Release type of WSA.\n                        RP means Release Preview, WIS means Insider Slow, WIF means Insider Fast.\n\n                        Possible values: $(ARR_TO_STR \"${RELEASE_TYPE_MAP[@]}\")\n                        Default: $RELEASE_TYPE\n\n    --magisk-ver        Magisk version.\n\n                        Possible values: $(ARR_TO_STR \"${MAGISK_VER_MAP[@]}\")\n                        Default: $MAGISK_VER\n\n    --root-sol          Root solution.\n                        \\\"none\\\" means no root.\n\n                        Possible values: $(ARR_TO_STR \"${ROOT_SOL_MAP[@]}\")\n                        Default: $ROOT_SOL\n\n    --compress-format   Compress format of output file.\n\n                        Possible values: $(ARR_TO_STR \"${COMPRESS_FORMAT_MAP[@]}\")\n                        Default: $COMPRESS_FORMAT\n\nAdditional Options:\n    --offline           Build WSA offline\n    --magisk-custom     Install custom Magisk\n    --skip-download-wsa Skip download WSA\n    --help              Show this help message and exit\n\nExample:\n    ./build.sh --release-type RP --magisk-ver beta\n    ./build.sh --arch arm64 --release-type WIF\n    ./build.sh --release-type WIS\n    ./build.sh --offline --magisk-custom\n    ./build.sh --release-type WIF --magisk-custom --magisk-ver release\n    \"\n}\n\nARGUMENT_LIST=(\n    \"compress-format:\"\n    \"arch:\"\n    \"release-type:\"\n    \"root-sol:\"\n    \"magisk-ver:\"\n    \"magisk-custom\"\n    \"install-gapps\"\n    \"remove-amazon\"\n    \"offline\"\n    \"skip-download-wsa\"\n    \"help\"\n    \"debug\"\n)\n\ndefault\n\nopts=$(\n    getopt \\\n        --longoptions \"$(printf \"%s,\" \"${ARGUMENT_LIST[@]}\")\" \\\n        --name \"$(basename \"$0\")\" \\\n        --options \"\" \\\n        -- \"$@\"\n) || exit_with_message \"Failed to parse options, please check your input\"\n\neval set --\"$opts\"\nwhile [[ $# -gt 0 ]]; do\n    case \"$1\" in\n        --compress-format)\n            COMPRESS_FORMAT=\"$2\"\n            shift 2\n            ;;\n        --arch)\n            ARCH=\"$2\"\n            shift 2\n            ;;\n        --release-type)\n            RELEASE_TYPE=\"$2\"\n            shift 2\n            ;;\n        --root-sol)\n            ROOT_SOL=\"$2\"\n            shift 2\n            ;;\n        --magisk-ver)\n            MAGISK_VER=\"$2\"\n            shift 2\n            ;;\n        --magisk-custom)\n            CUSTOM_MAGISK=1\n            shift\n            ;;\n        --install-gapps)\n            HAS_GAPPS=1\n            shift\n            ;;\n        --remove-amazon)\n            REMOVE_AMAZON=1\n            shift\n            ;;\n        --offline)\n            OFFLINE=1\n            shift\n            ;;\n        --skip-download-wsa)\n            SKIP_DOWN_WSA=1\n            shift\n            ;;\n        --help)\n            usage\n            exit 0\n            ;;\n        --debug)\n            DEBUG=1\n            shift\n            ;;\n        --)\n            shift\n            break\n            ;;\n    esac\ndone\n\ncheck_list() {\n    local input=$1\n    if [ -n \"$input\" ]; then\n        local name=$2\n        shift\n        local arr=(\"$@\")\n        local list_count=${#arr[@]}\n        for i in \"${arr[@]}\"; do\n            if [ \"$input\" == \"$i\" ]; then\n                echo \"INFO: $name: $input\"\n                break\n            fi\n            ((list_count--))\n            if ((\"$list_count\" <= 0)); then\n                exit_with_message \"Invalid $name: $input\"\n            fi\n        done\n    fi\n}\n\ncheck_list \"$ARCH\" \"Architecture\" \"${ARCH_MAP[@]}\"\ncheck_list \"$RELEASE_TYPE\" \"Release Type\" \"${RELEASE_TYPE_MAP[@]}\"\ncheck_list \"$MAGISK_VER\" \"Magisk Version\" \"${MAGISK_VER_MAP[@]}\"\ncheck_list \"$ROOT_SOL\" \"Root Solution\" \"${ROOT_SOL_MAP[@]}\"\ncheck_list \"$COMPRESS_FORMAT\" \"Compress Format\" \"${COMPRESS_FORMAT_MAP[@]}\"\n\nif [ \"$DEBUG\" ]; then\n    set -x\nfi\n\nif [ \"$HAS_GAPPS\" ]; then\n    case \"$ROOT_SOL\" in\n        \"none\")\n            ROOT_SOL=\"magisk\"\n            echo \"WARN: Force install Magisk since GApps needs it to mount the file\"\n            ;;\n        \"kernelsu\")\n            abort \"Unsupported combination: Install GApps and KernelSU\"\n            ;;\n        *)\n            ;;\n    esac\nfi\n\n# shellcheck disable=SC1091\n[ -f \"$PYTHON_VENV_DIR/bin/activate\" ] && {\n    source \"$PYTHON_VENV_DIR/bin/activate\" || abort \"Failed to activate virtual environment, please re-run install_deps.sh\"\n}\ndeclare -A RELEASE_NAME_MAP=([\"retail\"]=\"Retail\" [\"RP\"]=\"Release Preview\" [\"WIS\"]=\"Insider Slow\" [\"WIF\"]=\"Insider Fast\")\ndeclare -A ANDROID_API_MAP=([\"30\"]=\"11.0\" [\"32\"]=\"12.1\" [\"33\"]=\"13.0\")\ndeclare -A ARCH_NAME_MAP=([\"x64\"]=\"x86_64\" [\"arm64\"]=\"arm64\")\nRELEASE_NAME=${RELEASE_NAME_MAP[$RELEASE_TYPE]} || abort\necho -e \"INFO: Release Name: $RELEASE_NAME\\n\"\nWSA_ZIP_PATH=$DOWNLOAD_DIR/wsa-$RELEASE_TYPE.zip\nvclibs_PATH=\"$DOWNLOAD_DIR/Microsoft.VCLibs.140.00_$ARCH.appx\"\nUWPVCLibs_PATH=\"$DOWNLOAD_DIR/Microsoft.VCLibs.140.00.UWPDesktop_$ARCH.appx\"\nxaml_PATH=\"$DOWNLOAD_DIR/Microsoft.UI.Xaml.2.8_$ARCH.appx\"\nMAGISK_ZIP=magisk-$MAGISK_VER.zip\nMAGISK_PATH=$DOWNLOAD_DIR/$MAGISK_ZIP\nCUST_PATH=\"$DOWNLOAD_DIR/cust.img\"\nif [ \"$CUSTOM_MAGISK\" ]; then\n    if [ ! -f \"$MAGISK_PATH\" ]; then\n        echo \"Custom Magisk $MAGISK_ZIP not found\"\n        MAGISK_ZIP=app-$MAGISK_VER.apk\n        echo -e \"Fallback to $MAGISK_ZIP\\n\"\n        MAGISK_PATH=$DOWNLOAD_DIR/$MAGISK_ZIP\n        if [ ! -f \"$MAGISK_PATH\" ]; then\n            abort \"Custom Magisk $MAGISK_ZIP not found\\nPlease put custom Magisk in $DOWNLOAD_DIR\"\n        fi\n    fi\nfi\nANDROID_API=33\nupdate_gapps_files_name() {\n    GAPPS_IMAGE_NAME=gapps-${ANDROID_API_MAP[$ANDROID_API]}-${ARCH_NAME_MAP[$ARCH]}.img\n    GAPPS_RC_NAME=gapps-${ANDROID_API_MAP[$ANDROID_API]}.rc\n    GAPPS_IMAGE_PATH=$DOWNLOAD_DIR/$GAPPS_IMAGE_NAME\n    GAPPS_RC_PATH=$DOWNLOAD_DIR/$GAPPS_RC_NAME\n}\nWSA_MAJOR_VER=0\ngetKernelVersion() {\n    local bintype kernel_string kernel_version\n    bintype=\"$(file -b \"$1\")\"\n    if [[ $bintype == *\"version\"* ]]; then\n        readarray -td '' kernel_string < <(awk '{ gsub(/, /,\"\\0\"); print; }' <<<\"$bintype, \")\n        unset 'kernel_string[-1]'\n        for i in \"${kernel_string[@]}\"; do\n            if [[ $i == *\"version\"* ]]; then\n                IFS=\" \" read -r -a kernel_string <<<\"$i\"\n                kernel_version=\"${kernel_string[1]}\"\n            fi\n        done\n    else\n        IFS=\" \" read -r -a kernel_string <<<\"$(strings \"$1\" | grep 'Linux version')\"\n        kernel_version=\"${kernel_string[2]}\"\n    fi\n    IFS=\" \" read -r -a arr <<<\"${kernel_version//-/ }\"\n    printf '%s' \"${arr[0]}\"\n}\nupdate_ksu_zip_name() {\n    KERNEL_VER=\"\"\n    if [ -f \"$WORK_DIR/wsa/$ARCH/Tools/kernel\" ]; then\n        KERNEL_VER=$(getKernelVersion \"$WORK_DIR/wsa/$ARCH/Tools/kernel\")\n    fi\n    KERNELSU_ZIP_NAME=kernelsu-$ARCH-$KERNEL_VER.zip\n    KERNELSU_PATH=$DOWNLOAD_DIR/$KERNELSU_ZIP_NAME\n    KERNELSU_INFO=\"$KERNELSU_PATH.info\"\n}\n\nif [ -z ${OFFLINE+x} ]; then\n    echo \"Generating WSA Download Links\"\n    if [ -z ${SKIP_DOWN_WSA+x} ]; then\n        python3 generateWSALinks.py \"$ARCH\" \"$RELEASE_TYPE\" \"$DOWNLOAD_DIR\" \"$DOWNLOAD_CONF_NAME\" || abort\n        echo \"Downloading WSA\"\n    else\n        python3 generateWSALinks.py \"$ARCH\" \"$RELEASE_TYPE\" \"$DOWNLOAD_DIR\" \"$DOWNLOAD_CONF_NAME\" \"$SKIP_DOWN_WSA\" || abort\n        echo \"Skip download WSA, downloading WSA depends\"\n    fi\n    if ! aria2c --no-conf --log-level=info --log=\"$DOWNLOAD_DIR/aria2_download.log\" -x16 -s16 -j5 -c -R -m0 \\\n        --async-dns=false --check-integrity=true --continue=true --allow-overwrite=true --conditional-get=true \\\n        -d\"$DOWNLOAD_DIR\" -i\"$DOWNLOAD_DIR/$DOWNLOAD_CONF_NAME\"; then\n        abort \"We have encountered an error while downloading files.\"\n    fi\n    rm -f \"${DOWNLOAD_DIR:?}/$DOWNLOAD_CONF_NAME\"\nfi\n\necho \"Extracting WSA\"\nif [ -f \"$WSA_ZIP_PATH\" ]; then\n    if ! python3 extractWSA.py \"$ARCH\" \"$WSA_ZIP_PATH\" \"$WORK_DIR\" \"$WSA_WORK_ENV\"; then\n        CLEAN_DOWNLOAD_WSA=1\n        abort \"Unzip WSA failed\"\n    fi\n    echo -e \"done\\n\"\n    # shellcheck disable=SC1090\n    source \"$WSA_WORK_ENV\" || abort\nelse\n    abort \"The WSA zip package does not exist\"\nfi\nif [[ \"$WSA_MAJOR_VER\" -lt 2211 ]]; then\n    ANDROID_API=32\nfi\nif [ -z ${OFFLINE+x} ]; then\n    echo \"Generating Download Links\"\n    if [ \"$ROOT_SOL\" = \"magisk\" ]; then\n        if [ -z ${CUSTOM_MAGISK+x} ]; then\n            python3 generateMagiskLink.py \"$MAGISK_VER\" \"$DOWNLOAD_DIR\" \"$DOWNLOAD_CONF_NAME\" || abort\n        fi\n    fi\n    if [ \"$ROOT_SOL\" = \"kernelsu\" ]; then\n        update_ksu_zip_name\n        python3 generateKernelSULink.py \"$ARCH\" \"$DOWNLOAD_DIR\" \"$DOWNLOAD_CONF_NAME\" \"$KERNEL_VER\" \"$KERNELSU_ZIP_NAME\" || abort\n        # shellcheck disable=SC1090\n        source \"$WSA_WORK_ENV\" || abort\n        # shellcheck disable=SC2153\n        echo \"KERNELSU_VER=$KERNELSU_VER\" >\"$KERNELSU_INFO\"\n    fi\n    if [ \"$HAS_GAPPS\" ]; then\n        update_gapps_files_name\n        python3 generateGappsLink.py \"$ARCH\" \"$DOWNLOAD_DIR\" \"$DOWNLOAD_CONF_NAME\" \"$ANDROID_API\" \"$GAPPS_IMAGE_NAME\" || abort\n    fi\n    if [ -f \"$DOWNLOAD_DIR/$DOWNLOAD_CONF_NAME\" ]; then\n        echo \"Downloading Artifacts\"\n        if ! aria2c --no-conf --log-level=info --log=\"$DOWNLOAD_DIR/aria2_download.log\" -x16 -s16 -j5 -c -R -m0 \\\n            --async-dns=false --check-integrity=true --continue=true --allow-overwrite=true --conditional-get=true \\\n            -d\"$DOWNLOAD_DIR\" -i\"$DOWNLOAD_DIR/$DOWNLOAD_CONF_NAME\"; then\n            abort \"We have encountered an error while downloading files.\"\n        fi\n    fi\nfi\ndeclare -A FILES_CHECK_LIST=([xaml_PATH]=\"$xaml_PATH\" [vclibs_PATH]=\"$vclibs_PATH\" [UWPVCLibs_PATH]=\"$UWPVCLibs_PATH\")\nif [ \"$ROOT_SOL\" = \"magisk\" ]; then\n    FILES_CHECK_LIST+=([\"MAGISK_PATH\"]=\"$MAGISK_PATH\" [\"CUST_PATH\"]=\"$CUST_PATH\")\nfi\nif [ \"$ROOT_SOL\" = \"kernelsu\" ]; then\n    update_ksu_zip_name\n    FILES_CHECK_LIST+=([\"KERNELSU_PATH\"]=\"$KERNELSU_PATH\")\nfi\nif [ \"$HAS_GAPPS\" ]; then\n    update_gapps_files_name\n    FILES_CHECK_LIST+=([\"GAPPS_IMAGE_PATH\"]=\"$GAPPS_IMAGE_PATH\" [\"GAPPS_RC_PATH\"]=\"$GAPPS_RC_PATH\")\nfi\nfor i in \"${FILES_CHECK_LIST[@]}\"; do\n    if [ ! -f \"$i\" ]; then\n        echo \"Offline mode: missing [$i]\"\n        FILE_MISSING=\"1\"\n    fi\ndone\nif [ \"$FILE_MISSING\" ]; then\n    abort \"Some files are missing\"\nfi\nif [ \"$ROOT_SOL\" = \"magisk\" ]; then\n    echo \"Extracting Magisk\"\n    if [ -f \"$MAGISK_PATH\" ]; then\n        MAGISK_VERSION_NAME=\"\"\n        MAGISK_VERSION_CODE=0\n        if ! python3 extractMagisk.py \"$ARCH\" \"$MAGISK_PATH\" \"$WORK_DIR\"; then\n            CLEAN_DOWNLOAD_MAGISK=1\n            abort \"Unzip Magisk failed, is the download incomplete?\"\n        fi\n        # shellcheck disable=SC1090\n        source \"$WSA_WORK_ENV\" || abort\n        if [ \"$MAGISK_VERSION_CODE\" -lt 26000 ] && [ \"$MAGISK_VER\" != \"stable\" ] && [ -z ${CUSTOM_MAGISK+x} ]; then\n            abort \"Please install Magisk 26.0+\"\n        fi\n        chmod +x \"$WORK_DIR/magisk/magiskboot\" || abort\n    elif [ -z \"${CUSTOM_MAGISK+x}\" ]; then\n        abort \"The Magisk zip package does not exist, is the download incomplete?\"\n    else\n        abort \"The Magisk zip package does not exist, rename it to magisk-debug.zip and put it in the download folder.\"\n    fi\n    echo -e \"done\\n\"\nfi\n\nif [ \"$ROOT_SOL\" = \"magisk\" ]; then\n    echo \"Integrating Magisk\"\n    SKIP=\"#\"\n    SINGLEABI=\"#\"\n    SKIPINITLD=\"#\"\n    if [ -f \"$WORK_DIR/magisk/magisk64\" ]; then\n        \"$WORK_DIR/magisk/magiskboot\" compress=xz \"$WORK_DIR/magisk/magisk64\" \"$WORK_DIR/magisk/magisk64.xz\"\n        \"$WORK_DIR/magisk/magiskboot\" compress=xz \"$WORK_DIR/magisk/magisk32\" \"$WORK_DIR/magisk/magisk32.xz\"\n        unset SINGLEABI\n    else\n        \"$WORK_DIR/magisk/magiskboot\" compress=xz \"$WORK_DIR/magisk/magisk\" \"$WORK_DIR/magisk/magisk.xz\"\n        unset SKIP\n    fi\n    if [ -f \"$WORK_DIR/magisk/init-ld\" ]; then\n        \"$WORK_DIR/magisk/magiskboot\" compress=xz \"$WORK_DIR/magisk/init-ld\" \"$WORK_DIR/magisk/init-ld.xz\"\n        unset SKIPINITLD\n    fi\n    \"$WORK_DIR/magisk/magiskboot\" compress=xz \"$MAGISK_PATH\" \"$WORK_DIR/magisk/stub.xz\"\n    \"$WORK_DIR/magisk/magiskboot\" cpio \"$WORK_DIR/wsa/$ARCH/Tools/initrd.img\" \\\n        \"mv /init /wsainit\" \\\n        \"add 0750 /lspinit ../bin/$ARCH/lspinit\" \\\n        \"ln /lspinit /init\" \\\n        \"add 0750 /magiskinit $WORK_DIR/magisk/magiskinit\" \\\n        \"mkdir 0750 overlay.d\" \\\n        \"mkdir 0750 overlay.d/sbin\" \\\n        \"$SINGLEABI add 0644 overlay.d/sbin/magisk64.xz $WORK_DIR/magisk/magisk64.xz\" \\\n        \"$SINGLEABI add 0644 overlay.d/sbin/magisk32.xz $WORK_DIR/magisk/magisk32.xz\" \\\n        \"$SKIP add 0644 overlay.d/sbin/magisk.xz $WORK_DIR/magisk/magisk.xz\" \\\n        \"$SKIPINITLD add 0644 overlay.d/sbin/init-ld.xz $WORK_DIR/magisk/init-ld.xz\" \\\n        \"add 0644 overlay.d/sbin/stub.xz $WORK_DIR/magisk/stub.xz\" \\\n        \"mkdir 000 .backup\" \\\n        \"add 000 overlay.d/init.lsp.magisk.rc init.lsp.magisk.rc\" \\\n        \"add 000 overlay.d/sbin/post-fs-data.sh post-fs-data.sh\" \\\n        \"add 000 overlay.d/sbin/lsp_cust.img $CUST_PATH\" \\\n        || abort \"Unable to patch initrd\"\nelif [ \"$ROOT_SOL\" = \"kernelsu\" ]; then\n    echo \"Extracting KernelSU\"\n    # shellcheck disable=SC1090\n    source \"${KERNELSU_INFO:?}\" || abort\n    echo \"WSA Kernel Version: $KERNEL_VER\"\n    echo \"KernelSU Version: $KERNELSU_VER\"\n    if ! unzip \"$KERNELSU_PATH\" -d \"$WORK_DIR/kernelsu\"; then\n        CLEAN_DOWNLOAD_KERNELSU=1\n        abort \"Unzip KernelSU failed, package is corrupted?\"\n    fi\n    if [ \"$ARCH\" = \"x64\" ]; then\n        mv \"$WORK_DIR/kernelsu/bzImage\" \"$WORK_DIR/kernelsu/kernel\"\n    elif [ \"$ARCH\" = \"arm64\" ]; then\n        mv \"$WORK_DIR/kernelsu/Image\" \"$WORK_DIR/kernelsu/kernel\"\n    fi\n    echo \"Integrate KernelSU\"\n    mv \"$WORK_DIR/wsa/$ARCH/Tools/kernel\" \"$WORK_DIR/wsa/$ARCH/Tools/kernel_origin\"\n    cp \"$WORK_DIR/kernelsu/kernel\" \"$WORK_DIR/wsa/$ARCH/Tools/kernel\"\nfi\necho -e \"done\\n\"\nif [ \"$HAS_GAPPS\" ]; then\n    update_gapps_files_name\n    if [ -f \"$GAPPS_IMAGE_PATH\" ] && [ -f \"$GAPPS_RC_PATH\" ]; then\n        echo \"Integrating GApps\"\n        \"$WORK_DIR/magisk/magiskboot\" cpio \"$WORK_DIR/wsa/$ARCH/Tools/initrd.img\" \\\n            \"add 000 overlay.d/gapps.rc $GAPPS_RC_PATH\" \\\n            \"add 000 overlay.d/sbin/lsp_gapps.img $GAPPS_IMAGE_PATH\" \\\n            || abort \"Unable to patch initrd\"\n        echo -e \"done\\n\"\n    else\n        abort \"The GApps package does not exist.\"\n    fi\nfi\n\nif [ \"$REMOVE_AMAZON\" ]; then\n    rm -f \"$WORK_DIR/wsa/$ARCH/apex/\"mado*.apex || abort\nfi\n\necho \"Removing signature and add scripts\"\nrm -rf \"${WORK_DIR:?}\"/wsa/\"$ARCH\"/\\[Content_Types\\].xml \"$WORK_DIR/wsa/$ARCH/AppxBlockMap.xml\" \"$WORK_DIR/wsa/$ARCH/AppxSignature.p7x\" \"$WORK_DIR/wsa/$ARCH/AppxMetadata\" || abort\ncp \"$vclibs_PATH\" \"$xaml_PATH\" \"$WORK_DIR/wsa/$ARCH\" || abort\ncp \"$UWPVCLibs_PATH\" \"$xaml_PATH\" \"$WORK_DIR/wsa/$ARCH\" || abort\ncp \"../bin/$ARCH/makepri.exe\" \"$WORK_DIR/wsa/$ARCH\" || abort\ncp \"../xml/priconfig.xml\" \"$WORK_DIR/wsa/$ARCH/xml/\" || abort\ncp ../installer/MakePri.ps1 \"$WORK_DIR/wsa/$ARCH\" || abort\ncp ../installer/Install.ps1 \"$WORK_DIR/wsa/$ARCH\" || abort\ncp ../installer/Run.bat \"$WORK_DIR/wsa/$ARCH\" || abort\nfind \"$WORK_DIR/wsa/$ARCH\" -maxdepth 1 -mindepth 1 -printf \"%P\\n\" >\"$WORK_DIR/wsa/$ARCH/filelist.txt\" || abort\necho -e \"done\\n\"\n\nif [[ \"$ROOT_SOL\" = \"none\" ]]; then\n    name1=\"\"\nelif [ \"$ROOT_SOL\" = \"magisk\" ]; then\n    name1=\"-with-magisk-$MAGISK_VERSION_NAME($MAGISK_VERSION_CODE)-$MAGISK_VER\"\nelif [ \"$ROOT_SOL\" = \"kernelsu\" ]; then\n    name1=\"-with-$ROOT_SOL-$KERNELSU_VER\"\nfi\nif [ -z \"$HAS_GAPPS\" ]; then\n    name2=\"-NoGApps\"\nelse\n    name2=-GApps-${ANDROID_API_MAP[$ANDROID_API]}\nfi\nartifact_name=WSA_${WSA_VER}_${ARCH}_${WSA_REL}${name1}${name2}\n[ \"$REMOVE_AMAZON\" ] && artifact_name+=-NoAmazon\n\nif [ -f \"$OUTPUT_DIR\" ]; then\n    rm -rf ${OUTPUT_DIR:?}\nfi\nif [ ! -d \"$OUTPUT_DIR\" ]; then\n    mkdir -p \"$OUTPUT_DIR\"\nfi\nOUTPUT_PATH=\"${OUTPUT_DIR:?}/$artifact_name\"\nif [ \"$COMPRESS_FORMAT\" != \"none\" ]; then\n    mv \"$WORK_DIR/wsa/$ARCH\" \"$WORK_DIR/wsa/$artifact_name\"\n    if [ -n \"$COMPRESS_FORMAT\" ]; then\n        FILE_EXT=\".$COMPRESS_FORMAT\"\n        OUTPUT_PATH=\"$OUTPUT_PATH$FILE_EXT\"\n    fi\n    rm -f \"${OUTPUT_PATH:?}\" || abort\n    if [ \"$COMPRESS_FORMAT\" = \"7z\" ]; then\n        echo \"Compressing with 7z to $OUTPUT_PATH\"\n        7z a \"${OUTPUT_PATH:?}\" \"$WORK_DIR/wsa/$artifact_name\" || abort\n    elif [ \"$COMPRESS_FORMAT\" = \"zip\" ]; then\n        echo \"Compressing with zip to $OUTPUT_PATH\"\n        7z -tzip a \"$OUTPUT_PATH\" \"$WORK_DIR/wsa/$artifact_name\" || abort\n    fi\nelse\n    rm -rf \"${OUTPUT_PATH:?}\" || abort\n    echo \"Copying to $OUTPUT_PATH\"\n    cp -r \"$WORK_DIR/wsa/$ARCH\" \"$OUTPUT_PATH\" || abort\nfi\n"
  },
  {
    "path": "scripts/extractMagisk.py",
    "content": "#!/usr/bin/python3\n#\n# This file is part of MagiskOnWSALocal.\n#\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\n#\n# Copyright (C) 2024 LSPosed Contributors\n#\n\nimport sys\nimport zipfile\nfrom pathlib import Path\nimport platform\nimport os\nfrom typing import Any, OrderedDict\n\n\nclass Prop(OrderedDict):\n    def __init__(self, props: str = ...) -> None:\n        super().__init__()\n        for i, line in enumerate(props.splitlines(False)):\n            if '=' in line:\n                k, v = line.split('=', 1)\n                self[k] = v\n            else:\n                self[f\".{i}\"] = line\n\n    def __setattr__(self, __name: str, __value: Any) -> None:\n        self[__name] = __value\n\n    def __repr__(self):\n        return '\\n'.join(f'{item}={self[item]}' for item in self)\n\n\nis_x86_64 = platform.machine() in (\"AMD64\", \"x86_64\")\nhost_abi = \"x64\" if is_x86_64 else \"arm64\"\narch = sys.argv[1]\nmagisk_zip = sys.argv[2]\nworkdir = Path(sys.argv[3])\nworkdir.mkdir(parents=True, exist_ok=True)\n\nabi_map = {\"x64\": [\"x86_64\", \"x86\"], \"arm64\": [\"arm64-v8a\", \"armeabi-v7a\"]}\n\n\ndef extract_as(zip, name, as_name, dir):\n    info = zip.getinfo(name)\n    info.filename = as_name\n    zip.extract(info, workdir / dir)\n\n\nwith zipfile.ZipFile(magisk_zip) as zip:\n    props = Prop(zip.comment.decode().replace('\\000', '\\n'))\n    namelist = zip.namelist()\n    versionName = props.get(\"version\")\n    versionCode = props.get(\"versionCode\")\n    print(f\"Magisk version: {versionName} ({versionCode})\", flush=True)\n    if 'WSA_WORK_ENV' in os.environ and Path(os.environ['WSA_WORK_ENV']).is_file():\n        with open(os.environ['WSA_WORK_ENV'], 'r') as environ_file:\n            env = Prop(environ_file.read())\n            env.MAGISK_VERSION_NAME = versionName\n            env.MAGISK_VERSION_CODE = versionCode\n        with open(os.environ['WSA_WORK_ENV'], 'w') as environ_file:\n            environ_file.write(str(env))\n    if f\"lib/{ abi_map[arch][0] }/libmagisk64.so\" in namelist:\n        extract_as(zip, f\"lib/{ abi_map[arch][0] }/libmagisk64.so\", \"magisk64\", \"magisk\")\n        extract_as(zip, f\"lib/{ abi_map[arch][1] }/libmagisk32.so\", \"magisk32\", \"magisk\")\n    else:\n        extract_as(zip, f\"lib/{ abi_map[arch][0] }/libmagisk.so\", \"magisk\", \"magisk\")\n    if f\"lib/{ abi_map[arch][0] }/libinit-ld.so\" in namelist:\n        extract_as(zip, f\"lib/{ abi_map[arch][0] }/libinit-ld.so\", \"init-ld\", \"magisk\")\n    extract_as(zip, f\"lib/{ abi_map[arch][0] }/libmagiskinit.so\", \"magiskinit\", \"magisk\")\n    extract_as(zip, f\"lib/{ abi_map[host_abi][0] }/libmagiskboot.so\", \"magiskboot\", \"magisk\")\n"
  },
  {
    "path": "scripts/extractWSA.py",
    "content": "#!/usr/bin/python3\n#\n# This file is part of MagiskOnWSALocal.\n#\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\n#\n# Copyright (C) 2023 LSPosed Contributors\n#\n\nimport os\nimport sys\nfrom typing import Any, OrderedDict\n\nimport zipfile\nfrom pathlib import Path\nimport re\nimport shutil\n\n\nclass Prop(OrderedDict):\n    def __init__(self, props: str = ...) -> None:\n        super().__init__()\n        for i, line in enumerate(props.splitlines(False)):\n            if '=' in line:\n                k, v = line.split('=', 1)\n                self[k] = v\n            else:\n                self[f\".{i}\"] = line\n\n    def __setattr__(self, __name: str, __value: Any) -> None:\n        self[__name] = __value\n\n    def __repr__(self):\n        return '\\n'.join(f'{item}={self[item]}' for item in self)\n\n\narch = sys.argv[1]\n\nzip_name = \"\"\nwsa_zip_path = Path(sys.argv[2])\nrootdir = Path(sys.argv[3])\nenv_file = Path(sys.argv[4])\n\nworkdir = rootdir / \"wsa\"\narchdir = Path(workdir / arch)\npridir = workdir / archdir / 'pri'\nxmldir = workdir / archdir / 'xml'\nif not Path(rootdir).is_dir():\n    rootdir.mkdir()\n\nif Path(workdir).is_dir():\n    shutil.rmtree(workdir)\nelse:\n    workdir.unlink(missing_ok=True)\n\nif not Path(workdir).is_dir():\n    workdir.mkdir()\n\nif not Path(archdir).is_dir():\n    archdir.mkdir()\nuid = os.getuid()\nworkdir_rw = os.access(workdir, os.W_OK)\n\nwith zipfile.ZipFile(wsa_zip_path) as zip:\n    for f in zip.filelist:\n        filename_lower = f.filename.lower()\n        if arch in filename_lower:\n            zip_name = f.filename\n            if not Path(workdir / zip_name).is_file():\n                print(f\"unzipping {zip_name} to {workdir}\", flush=True)\n                zip_path = zip.extract(f, workdir)\n                with zipfile.ZipFile(zip_path) as wsa_zip:\n                    stat = Path(zip_path).stat()\n                    print(f\"unzipping from {zip_path}\", flush=True)\n                    wsa_zip.extractall(archdir)\n                ver_no = zip_name.split(\"_\")\n                long_ver = ver_no[1]\n                ver = long_ver.split(\".\")\n                major_ver = ver[0]\n                rel = ver_no[3].split(\".\")\n                rel_long = str(rel[0])\n                with open(env_file, 'r') as environ_file:\n                    env = Prop(environ_file.read())\n                    env.WSA_VER = long_ver\n                    env.WSA_MAJOR_VER = major_ver\n                    env.WSA_REL = rel_long\n                with open(env_file, 'w') as environ_file:\n                    environ_file.write(str(env))\n        if 'language' in filename_lower or 'scale' in filename_lower:\n            name = f.filename.split(\"_\")[2].split(\".\")[0]\n            zip.extract(f, workdir)\n            with zipfile.ZipFile(workdir / f.filename) as l:\n                for g in l.filelist:\n                    if g.filename == 'resources.pri':\n                        g.filename = f'resources.{name}.pri'\n                        l.extract(g, pridir)\n                    elif g.filename == 'AppxManifest.xml':\n                        g.filename = f'resources.{name}.xml'\n                        l.extract(g, xmldir)\n                    elif re.search(r'Images/.+\\.png', g.filename):\n                        l.extract(g, archdir)\n"
  },
  {
    "path": "scripts/gapps_debug.sh",
    "content": "#!/bin/bash\n#\n# This file is part of MagiskOnWSALocal.\n#\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\n#\n# Copyright (C) 2024 LSPosed Contributors\n#\n\nif [ ! \"$BASH_VERSION\" ]; then\n    echo \"Please do not use sh to run this script, just execute it directly\" 1>&2\n    exit 1\nfi\nHOST_ARCH=$(uname -m)\nif [ \"$HOST_ARCH\" != \"x86_64\" ] && [ \"$HOST_ARCH\" != \"aarch64\" ]; then\n    echo \"Unsupported architectures: $HOST_ARCH\"\n    exit 1\nfi\ncd \"$(dirname \"$0\")\" || exit 1\n# export TMPDIR=$HOME/.cache/wsa\nif [ \"$TMPDIR\" ] && [ ! -d \"$TMPDIR\" ]; then\n    mkdir -p \"$TMPDIR\"\nfi\nWORK_DIR=$(mktemp -d -t wsa-build-XXXXXXXXXX_) || exit 1\n\nDOWNLOAD_DIR=../download\nPYTHON_VENV_DIR=\"$(dirname \"$PWD\")/python3-env\"\ndir_clean() {\n    rm -rf \"${WORK_DIR:?}\"\n    if [ \"$TMPDIR\" ] && [ -d \"$TMPDIR\" ]; then\n        echo \"Cleanup Temp Directory\"\n        rm -rf \"${TMPDIR:?}\"\n        unset TMPDIR\n    fi\n    if [ \"$(python3 -c 'import sys ; print( 1 if sys.prefix != sys.base_prefix else 0 )')\" = \"1\" ]; then\n        echo \"deactivate python3 venv\"\n        deactivate\n    fi\n}\ntrap dir_clean EXIT\nabort() {\n    [ \"$1\" ] && echo -e \"ERROR: $1\"\n    echo \"Build: an error has occurred, exit\"\n    if [ -d \"$WORK_DIR\" ]; then\n        echo -e \"\\nCleanup Work Directory\"\n        dir_clean\n    fi\n    exit 1\n}\ntrap abort INT TERM\n# shellcheck disable=SC1091\n[ -f \"$PYTHON_VENV_DIR/bin/activate\" ] && {\n    source \"$PYTHON_VENV_DIR/bin/activate\" || abort \"Failed to activate virtual environment, please re-run install_deps.sh\"\n}\ndeclare -A ANDROID_API_MAP=([\"30\"]=\"11.0\" [\"32\"]=\"12.1\" [\"33\"]=\"13.0\")\ndeclare -A ARCH_NAME_MAP=([\"x64\"]=\"x86_64\" [\"arm64\"]=\"arm64\")\nANDROID_API=33\nMAGISK_VER=$1\nARCH=$2\nTARGET=$3\nif [ -z \"$MAGISK_VER\" ] || [ -z \"$ARCH\" ] || [ -z \"$TARGET\" ]; then\n    echo \"Usage: $0 <release|debug> <x64|arm64> <initrd>\"\n    exit 1\nfi\nupdate_gapps_files_name() {\n    GAPPS_IMAGE_NAME=gapps-${ANDROID_API_MAP[$ANDROID_API]}-${ARCH_NAME_MAP[$ARCH]}.img\n    GAPPS_RC_NAME=gapps-${ANDROID_API_MAP[$ANDROID_API]}.rc\n    GAPPS_IMAGE_PATH=$DOWNLOAD_DIR/$GAPPS_IMAGE_NAME\n    GAPPS_RC_PATH=$DOWNLOAD_DIR/$GAPPS_RC_NAME\n}\nMAGISK_ZIP=magisk-$MAGISK_VER.zip\nMAGISK_PATH=$DOWNLOAD_DIR/$MAGISK_ZIP\nif [ ! -f \"$MAGISK_PATH\" ]; then\n    echo \"Custom Magisk $MAGISK_ZIP not found\"\n    MAGISK_ZIP=app-$MAGISK_VER.apk\n    echo -e \"Fallback to $MAGISK_ZIP\\n\"\n    MAGISK_PATH=$DOWNLOAD_DIR/$MAGISK_ZIP\n    if [ ! -f \"$MAGISK_PATH\" ]; then\n        abort \"Custom Magisk $MAGISK_ZIP not found\\nPlease put custom Magisk in $DOWNLOAD_DIR\"\n    fi\nfi\necho \"Extracting Magisk\"\nif [ -f \"$MAGISK_PATH\" ]; then\n    if ! python3 extractMagisk.py \"$ARCH\" \"$MAGISK_PATH\" \"$WORK_DIR\"; then\n        abort \"Unzip Magisk failed, is the download incomplete?\"\n    fi\n    chmod +x \"$WORK_DIR/magisk/magiskboot\" || abort\nelif [ -z \"${CUSTOM_MAGISK+x}\" ]; then\n    abort \"The Magisk zip package does not exist, is the download incomplete?\"\nelse\n    abort \"The Magisk zip package does not exist, rename it to magisk-debug.zip and put it in the download folder.\"\nfi\necho -e \"done\\n\"\n\nupdate_gapps_files_name\nif [ -f \"$GAPPS_IMAGE_PATH\" ] && [ -f \"$GAPPS_RC_PATH\" ]; then\n    echo \"Integrating GApps\"\n    \"$WORK_DIR/magisk/magiskboot\" cpio \"$TARGET\" \\\n        \"add 000 overlay.d/gapps.rc $GAPPS_RC_PATH\" \\\n        \"add 000 overlay.d/sbin/lsp_gapps.img $GAPPS_IMAGE_PATH\" ||\n        abort \"Unable to patch initrd\"\n    echo -e \"done\\n\"\nelse\n    abort \"The GApps package does not exist.\"\nfi\n"
  },
  {
    "path": "scripts/generateGappsLink.py",
    "content": "#!/usr/bin/python3\n#\n# This file is part of MagiskOnWSALocal.\n#\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\n#\n# Copyright (C) 2025 LSPosed Contributors\n#\nimport sys\nfrom pathlib import Path\n\narch = sys.argv[1]\narg2 = sys.argv[2]\ndownload_dir = Path.cwd().parent / \"download\" if arg2 == \"\" else Path(arg2)\ntempScript = sys.argv[3]\nandroid_api = sys.argv[4]\nfile_name = sys.argv[5]\nprint(f\"Generating GApps download link: arch={arch}\", flush=True)\nabi_map = {\"x64\": \"x86_64\", \"arm64\": \"arm64\"}\nandroid_api_map = {\"30\": \"11.0\", \"32\": \"12.1\", \"33\": \"13.0\"}\nrelease = android_api_map[android_api]\ndownload_files = {}\ndownload_files[f\"gapps-{release}.rc\"] = f\"https://github.com/LSPosed/WSA-Addon/releases/latest/download/gapps-{release}.rc\"\ndownload_files[f\"gapps-{release}-{abi_map[arch]}.img\"] = f\"https://github.com/LSPosed/WSA-Addon/releases/latest/download/gapps-{release}-{abi_map[arch]}.img\"\nwith open(download_dir / tempScript, \"a\") as f:\n    for key, value in download_files.items():\n        print(f\"download link: {value}\\npath: {download_dir / key}\\n\", flush=True)\n        f.writelines(value + \"\\n\")\n        f.writelines(f\"  dir={download_dir}\\n\")\n        f.writelines(f\"  out={key}\\n\")\n"
  },
  {
    "path": "scripts/generateKernelSULink.py",
    "content": "#!/usr/bin/python3\n#\n# This file is part of MagiskOnWSALocal.\n#\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\n#\n# Copyright (C) 2024 LSPosed Contributors\n#\n\nfrom datetime import datetime\nimport sys\nimport os\nfrom typing import Any, OrderedDict\n\nimport requests\nimport json\nimport re\nfrom pathlib import Path\nfrom packaging import version\n\n\nclass Prop(OrderedDict):\n    def __init__(self, props: str = ...) -> None:\n        super().__init__()\n        for i, line in enumerate(props.splitlines(False)):\n            if '=' in line:\n                k, v = line.split('=', 1)\n                self[k] = v\n            else:\n                self[f\".{i}\"] = line\n\n    def __setattr__(self, __name: str, __value: Any) -> None:\n        self[__name] = __value\n\n    def __repr__(self):\n        return '\\n'.join(f'{item}={self[item]}' for item in self)\n\n\narch = sys.argv[1]\narg2 = sys.argv[2]\ndownload_dir = Path.cwd().parent / \"download\" if arg2 == \"\" else Path(arg2)\ntempScript = sys.argv[3]\nkernelVersion = sys.argv[4]\nfile_name = sys.argv[5]\nabi_map = {\"x64\": \"x86_64\", \"arm64\": \"arm64\"}\nprint(\n    f\"Generating KernelSU download link: arch={abi_map[arch]}, kernel version={kernelVersion}\", flush=True)\nres = requests.get(\n    f\"https://api.github.com/repos/tiann/KernelSU/releases/latest\")\njson_data = json.loads(res.content)\nheaders = res.headers\nx_ratelimit_remaining = headers[\"x-ratelimit-remaining\"]\nkernel_ver = 0\nif res.status_code == 200:\n    link = \"\"\n    assets = json_data[\"assets\"]\n    for asset in assets:\n        asset_name = asset[\"name\"]\n        if re.match(rf'kernel-WSA-{abi_map[arch]}-{kernelVersion}.*\\.zip$', asset_name) and asset[\"content_type\"] == \"application/zip\":\n            tmp_kernel_ver = re.search(\n                u'\\d{1}.\\d{1,}.\\d{1,}.\\d{1,}', asset_name.split(\"-\")[3]).group()\n            if (kernel_ver == 0):\n                kernel_ver = tmp_kernel_ver\n            elif version.parse(kernel_ver) < version.parse(tmp_kernel_ver):\n                kernel_ver = tmp_kernel_ver\n    print(f\"Kernel version: {kernel_ver}\", flush=True)\n    for asset in assets:\n        if re.match(rf'kernel-WSA-{abi_map[arch]}-{kernel_ver}.*\\.zip$', asset[\"name\"]) and asset[\"content_type\"] == \"application/zip\":\n            link = asset[\"browser_download_url\"]\n            break\n    if link == \"\":\n        print(\n            f\"Error: No KernelSU release found for arch={abi_map[arch]}, kernel version={kernelVersion}\", flush=True)\n        exit(1)\n    release_name = json_data[\"name\"]\n    with open(os.environ['WSA_WORK_ENV'], 'r') as environ_file:\n        env = Prop(environ_file.read())\n        env.KERNELSU_VER = release_name\n    with open(os.environ['WSA_WORK_ENV'], 'w') as environ_file:\n        environ_file.write(str(env))\nelif res.status_code == 403 and x_ratelimit_remaining == '0':\n    message = json_data[\"message\"]\n    print(f\"Github API Error: {message}\", flush=True)\n    ratelimit_reset = headers[\"x-ratelimit-reset\"]\n    ratelimit_reset = datetime.fromtimestamp(int(ratelimit_reset))\n    print(\n        f\"The current rate limit window resets in {ratelimit_reset}\", flush=True)\n    exit(1)\n\nprint(f\"download link: {link}\", flush=True)\n\nwith open(download_dir/tempScript, 'a') as f:\n    f.writelines(f'{link}\\n')\n    f.writelines(f'  dir={download_dir}\\n')\n    f.writelines(f'  out={file_name}\\n')\n"
  },
  {
    "path": "scripts/generateMagiskLink.py",
    "content": "#!/usr/bin/python3\n#\n# This file is part of MagiskOnWSALocal.\n#\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\n#\n# Copyright (C) 2025 LSPosed Contributors\n#\nimport sys\n\nimport json\nimport requests\nfrom pathlib import Path\n\nmagisk_ver = sys.argv[1]\ndownload_dir = (Path.cwd().parent / \"download\" if sys.argv[2] == \"\" else Path(sys.argv[2]))\ntempScript = sys.argv[3]\ndownload_files = {}\ncdn_hosts = [\n    \"cdn.jsdelivr.net\",\n    \"fastly.jsdelivr.net\",\n    \"testingcf.jsdelivr.net\",\n    \"gcore.jsdelivr.net\",\n]\nprint(f\"Generating Magisk download link: release type={magisk_ver}\", flush=True)\nmagisk_link = None\nif not magisk_ver:\n    magisk_ver = \"stable\"\nif (\n    magisk_ver == \"stable\"\n    or magisk_ver == \"beta\"\n    or magisk_ver == \"canary\"\n    or magisk_ver == \"debug\"\n):\n    try:\n        magisk_link = json.loads(requests.get(f\"https://topjohnwu.github.io/magisk-files/{magisk_ver}.json\").content)[\"magisk\"][\"link\"]\n        download_files[f\"magisk-{magisk_ver}.zip\"] = magisk_link\n    except Exception:\n        print(\"Failed to fetch from GitHub API, fallbacking to jsdelivr...\")\n        for host in cdn_hosts:\n            try:\n                magisk_link = json.loads(requests.get(f\"https://{host}/gh/topjohnwu/magisk-files@master/{magisk_ver}.json\").content)[\"magisk\"][\"link\"]\n                download_files[f\"magisk-{magisk_ver}.zip\"] = magisk_link\n                break\n            except Exception:\n                print(f\"Failed to fetch from {host}, trying next...\", flush=True)\n                pass\n    finally:\n        if magisk_link is None:\n            print(\"Failed to fetch Magisk download link\", flush=True)\n            exit(1)\n\ndownload_files[\"cust.img\"] = \"https://github.com/LSPosed/WSA-Addon/releases/latest/download/cust.img\"\nwith open(download_dir / tempScript, \"a\") as f:\n    for key, value in download_files.items():\n        print(f\"download link: {value}\\npath: {download_dir / key}\\n\", flush=True)\n        f.writelines(value + \"\\n\")\n        f.writelines(f\"  dir={download_dir}\\n\")\n        f.writelines(f\"  out={key}\\n\")\n"
  },
  {
    "path": "scripts/generateWSALinks.py",
    "content": "#!/usr/bin/python3\n#\n# This file is part of MagiskOnWSALocal.\n#\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\n#\n# Copyright (C) 2024 LSPosed Contributors\n#\n\nimport html\nimport logging\nimport re\nimport sys\n\nfrom pathlib import Path\nfrom threading import Thread\nfrom typing import Any, OrderedDict\nfrom xml.dom import minidom\n\nfrom requests import Session\nfrom packaging import version\n\n\nclass Prop(OrderedDict):\n    def __init__(self, props: str = ...) -> None:\n        super().__init__()\n        for i, line in enumerate(props.splitlines(False)):\n            if '=' in line:\n                k, v = line.split('=', 1)\n                self[k] = v\n            else:\n                self[f\".{i}\"] = line\n\n    def __setattr__(self, __name: str, __value: Any) -> None:\n        self[__name] = __value\n\n    def __repr__(self):\n        return '\\n'.join(f'{item}={self[item]}' for item in self)\n\n\nlogging.captureWarnings(True)\narch = sys.argv[1]\n\nrelease_name_map = {\"retail\": \"Retail\", \"RP\": \"Release Preview\",\n                    \"WIS\": \"Insider Slow\", \"WIF\": \"Insider Fast\"}\nrelease_type = sys.argv[2] if sys.argv[2] != \"\" else \"Retail\"\nrelease_name = release_name_map[release_type]\ndownload_dir = Path.cwd().parent / \\\n    \"download\" if sys.argv[3] == \"\" else Path(sys.argv[3])\nms_account_conf = download_dir/\".ms_account\"\ntempScript = sys.argv[4]\nskip_wsa_download = sys.argv[5] == \"1\" if len(sys.argv) >= 6 else False\ncat_id = '858014f3-3934-4abe-8078-4aa193e74ca8'\nuser = ''\nsession = Session()\nsession.verify = False\nif ms_account_conf.is_file():\n    with open(ms_account_conf, \"r\") as f:\n        conf = Prop(f.read())\n        user = conf.get('user_code')\nprint(\n    f\"Generating WSA download link: arch={arch} release_type={release_name}\\n\", flush=True)\nwith open(Path.cwd().parent / (\"xml/GetCookie.xml\"), \"r\") as f:\n    cookie_content = f.read().format(user)\n\nout = session.post(\n    'https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx',\n    data=cookie_content,\n    headers={'Content-Type': 'application/soap+xml; charset=utf-8'}\n)\ndoc = minidom.parseString(out.text)\ncookie = doc.getElementsByTagName('EncryptedData')[0].firstChild.nodeValue\n\nwith open(Path.cwd().parent / \"xml/WUIDRequest.xml\", \"r\") as f:\n    cat_id_content = f.read().format(user, cookie, cat_id, release_type)\n\nout = session.post(\n    'https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx',\n    data=cat_id_content,\n    headers={'Content-Type': 'application/soap+xml; charset=utf-8'}\n)\n\ndoc = minidom.parseString(html.unescape(out.text))\n\nfilenames = {}\nfor node in doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[0].getElementsByTagName('Update'):\n    node_xml = node.getElementsByTagName('Xml')[0]\n    node_files = node_xml.getElementsByTagName('Files')\n    if not node_files:\n        continue\n    else:\n        for node_file in node_files[0].getElementsByTagName('File'):\n            if node_file.hasAttribute('InstallerSpecificIdentifier') and node_file.hasAttribute('FileName'):\n                filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (f\"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}\",\n                                                                                      node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)\n\nidentities = {}\nfor node in doc.getElementsByTagName('NewUpdates')[0].getElementsByTagName('UpdateInfo'):\n    node_xml = node.getElementsByTagName('Xml')[0]\n    if not node_xml.getElementsByTagName('SecuredFragment'):\n        continue\n    else:\n        id = node.getElementsByTagName('ID')[0].firstChild.nodeValue\n        update_identity = node_xml.getElementsByTagName('UpdateIdentity')[0]\n        if id in filenames:\n            fileinfo = filenames[id]\n            if fileinfo[0] not in identities:\n                identities[fileinfo[0]] = ([update_identity.attributes['UpdateID'].value,\n                                            update_identity.attributes['RevisionNumber'].value], fileinfo[1])\n\nwith open(Path.cwd().parent / \"xml/FE3FileUrl.xml\", \"r\") as f:\n    FE3_file_content = f.read()\n\nif not download_dir.is_dir():\n    download_dir.mkdir()\n\ntmpdownlist = open(download_dir/tempScript, 'a')\ndownload_files = {}\n\n\ndef send_req(i, v, out_file_name):\n    out = session.post(\n        'https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx/secured',\n        data=FE3_file_content.format(user, i, v, release_type),\n        headers={'Content-Type': 'application/soap+xml; charset=utf-8'}\n    )\n    doc = minidom.parseString(out.text)\n    for l in doc.getElementsByTagName(\"FileLocation\"):\n        url = l.getElementsByTagName(\"Url\")[0].firstChild.nodeValue\n        if len(url) != 99:\n            download_files[out_file_name] = url\n\n\nthreads = []\nwsa_build_ver = 0\nfor filename, values in identities.items():\n    if re.match(rf\"MicrosoftCorporationII\\.WindowsSubsystemForAndroid_.*\\.msixbundle\", filename):\n        tmp_wsa_build_ver = re.search(\n            r'\\d{4}.\\d{5}.\\d{1,}.\\d{1,}', filename).group()\n        if (wsa_build_ver == 0):\n            wsa_build_ver = tmp_wsa_build_ver\n        elif version.parse(wsa_build_ver) < version.parse(tmp_wsa_build_ver):\n            wsa_build_ver = tmp_wsa_build_ver\nfor filename, values in identities.items():\n    if re.match(rf\"Microsoft\\.UI\\.Xaml\\..*_{arch}_.*\\.appx\", filename):\n        out_file_name = f\"{values[1]}_{arch}.appx\"\n        out_file = download_dir / out_file_name\n    elif re.match(rf\"Microsoft\\.VCLibs\\..+\\.UWPDesktop_.*_{arch}_.*\\.appx\", filename):\n        out_file_name = f\"{values[1]}_{arch}.appx\"\n        out_file = download_dir / out_file_name\n    elif re.match(rf\"Microsoft\\.VCLibs\\..+_.*_{arch}_.*\\.appx\", filename):\n        out_file_name = f\"{values[1]}_{arch}.appx\"\n        out_file = download_dir / out_file_name\n    elif not skip_wsa_download and re.match(rf\"MicrosoftCorporationII\\.WindowsSubsystemForAndroid_.*\\.msixbundle\", filename):\n        tmp_wsa_build_ver = re.search(\n            r'\\d{4}.\\d{5}.\\d{1,}.\\d{1,}', filename).group()\n        if (wsa_build_ver != tmp_wsa_build_ver):\n            continue\n        version_splitted = wsa_build_ver.split(\".\")\n        major_ver = version_splitted[0]\n        minor_ver = version_splitted[1]\n        build_ver = version_splitted[2]\n        revision_ver = version_splitted[3]\n        out_file_name = f\"wsa-{release_type}.zip\"\n        out_file = download_dir / out_file_name\n    else:\n        continue\n    th = Thread(target=send_req, args=(\n        values[0][0], values[0][1], out_file_name))\n    threads.append(th)\n    th.daemon = True\n    th.start()\nfor th in threads:\n    th.join()\nprint(f'WSA Build Version={wsa_build_ver}\\n', flush=True)\nfor key, value in download_files.items():\n    print(f\"download link: {value}\\npath: {download_dir / key}\\n\", flush=True)\n    tmpdownlist.writelines(value + '\\n')\n    tmpdownlist.writelines(f'  dir={download_dir}\\n')\n    tmpdownlist.writelines(f'  out={key}\\n')\ntmpdownlist.close()\n"
  },
  {
    "path": "scripts/init.lsp.magisk.rc",
    "content": "on post-fs-data\n    exec u:r:magisk:s0 0 0 -- /system/bin/sh ${MAGISKTMP}/post-fs-data.sh\n"
  },
  {
    "path": "scripts/install_deps.sh",
    "content": "#!/bin/bash\n#\n# This file is part of MagiskOnWSALocal.\n#\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\n#\n# Copyright (C) 2023 LSPosed Contributors\n#\n\nif [ ! \"$BASH_VERSION\" ]; then\n    echo \"Please do not use sh to run this script, just execute it directly\" 1>&2\n    exit 1\nfi\ncd \"$(dirname \"$0\")\" || exit 1\nabort() {\n    [ \"$1\" ] && echo \"ERROR: $1\"\n    echo \"Dependencies: an error has occurred, exit\"\n    exit 1\n}\nrequire_su() {\n    if test \"$(id -u)\" != \"0\"; then\n        if [ \"$(sudo id -u)\" != \"0\" ]; then\n            echo \"sudo is required to run this script\"\n            abort\n        fi\n    fi\n}\n\necho \"Checking and ensuring dependencies\"\ncheck_dependencies() {\n    command -v whiptail >/dev/null 2>&1 || command -v dialog >/dev/null 2>&1 || NEED_INSTALL+=(\"whiptail\")\n    command -v pip >/dev/null 2>&1 || NEED_INSTALL+=(\"python3-pip\")\n    command -v aria2c >/dev/null 2>&1 || NEED_INSTALL+=(\"aria2\")\n    command -v 7z >/dev/null 2>&1 || NEED_INSTALL+=(\"p7zip-full\")\n    command -v unzip >/dev/null 2>&1 || NEED_INSTALL+=(\"unzip\")\n}\ncheck_dependencies\nosrel=$(sed -n '/^ID_LIKE=/s/^.*=//p' /etc/os-release)\ndeclare -A os_pm_install\n# os_pm_install[\"/etc/redhat-release\"]=yum\nos_pm_install[\"/etc/arch-release\"]=pacman\nos_pm_install[\"/etc/gentoo-release\"]=emerge\nos_pm_install[\"/etc/SuSE-release\"]=zypper\nos_pm_install[\"/etc/debian_version\"]=apt-get\n# os_pm_install[\"/etc/alpine-release\"]=apk\n\ndeclare -A PM_UPDATE_MAP\nPM_UPDATE_MAP[\"yum\"]=\"check-update\"\nPM_UPDATE_MAP[\"pacman\"]=\"-Syu --noconfirm\"\nPM_UPDATE_MAP[\"emerge\"]=\"-auDU1 @world\"\nPM_UPDATE_MAP[\"zypper\"]=\"ref\"\nPM_UPDATE_MAP[\"apt-get\"]=\"update\"\nPM_UPDATE_MAP[\"apk\"]=\"update\"\n\ndeclare -A PM_INSTALL_MAP\nPM_INSTALL_MAP[\"yum\"]=\"install -y\"\nPM_INSTALL_MAP[\"pacman\"]=\"-S --noconfirm --needed\"\nPM_INSTALL_MAP[\"emerge\"]=\"-a\"\nPM_INSTALL_MAP[\"zypper\"]=\"in -y\"\nPM_INSTALL_MAP[\"apt-get\"]=\"install -y\"\nPM_INSTALL_MAP[\"apk\"]=\"add\"\n\ndeclare -A PM_UPGRADE_MAP\nPM_UPGRADE_MAP[\"apt-get\"]=\"upgrade -y\"\nPM_UPGRADE_MAP[\"zypper\"]=\"up -y\"\n\ncheck_package_manager() {\n    for f in \"${!os_pm_install[@]}\"; do\n        if [[ -f $f ]]; then\n            PM=\"${os_pm_install[$f]}\"\n            break\n        fi\n    done\n    if [[ \"$osrel\" = *\"suse\"* ]]; then\n        PM=\"zypper\"\n    fi\n    if [ -n \"$PM\" ]; then\n        readarray -td ' ' UPDATE_OPTION <<<\"${PM_UPDATE_MAP[$PM]} \"\n        unset 'UPDATE_OPTION[-1]'\n        readarray -td ' ' INSTALL_OPTION <<<\"${PM_INSTALL_MAP[$PM]} \"\n        unset 'INSTALL_OPTION[-1]'\n        readarray -td ' ' UPGRADE_OPTION <<<\"${PM_UPGRADE_MAP[$PM]} \"\n        unset 'UPGRADE_OPTION[-1]'\n    fi\n}\n\ncheck_package_manager\nrequire_su\nif [ -z \"$PM\" ]; then\n    echo \"Unable to determine package manager: Unsupported distros\"\n    abort\nelif [[ \"$PM\" =~ pacman|emerge ]]; then\n    [ \"$PM\" = \"emerge\" ] && (sudo emerge -qoO aria2[adns] || abort)\n    i=30\n    while ((i-- > 1)) &&\n        ! read -r -sn 1 -t 1 -p $'\\r:: Proceed with full system upgrade? Cancel after '$i$'s.. [y/N]\\e[0K ' answer; do\n        :\n    done\n    [[ $answer == [yY] ]] && answer=Yes || answer=No\n    echo \"$answer\"\n    case \"$answer\" in\n    Yes)\n        if ! (sudo \"$PM\" \"${UPDATE_OPTION[@]}\" ca-certificates); then abort; fi\n        ;;\n    *)\n        abort \"Operation cancelled by user\"\n        ;;\n    esac\nelse\n    if ! (sudo \"$PM\" \"${UPDATE_OPTION[@]}\" && sudo \"$PM\" \"${UPGRADE_OPTION[@]}\" ca-certificates); then abort; fi\nfi\n\nif [ -n \"${NEED_INSTALL[*]}\" ]; then\n    if [ \"$PM\" = \"zypper\" ]; then\n        NEED_INSTALL_FIX=${NEED_INSTALL[*]}\n        {\n            NEED_INSTALL_FIX=${NEED_INSTALL_FIX//whiptail/dialog} 2>&1\n        } >>/dev/null\n\n        readarray -td ' ' NEED_INSTALL <<<\"$NEED_INSTALL_FIX \"\n        unset 'NEED_INSTALL[-1]'\n    elif [ \"$PM\" = \"apk\" ]; then\n        NEED_INSTALL_FIX=${NEED_INSTALL[*]}\n        readarray -td ' ' NEED_INSTALL <<<\"${NEED_INSTALL_FIX//p7zip-full/p7zip} \"\n        unset 'NEED_INSTALL[-1]'\n    elif [ \"$PM\" = \"pacman\" ]; then\n        NEED_INSTALL_FIX=${NEED_INSTALL[*]}\n        {\n            NEED_INSTALL_FIX=${NEED_INSTALL_FIX//whiptail/libnewt} 2>&1\n            NEED_INSTALL_FIX=${NEED_INSTALL_FIX//python3-pip/python-pip} 2>&1\n            NEED_INSTALL_FIX=${NEED_INSTALL_FIX//p7zip-full/p7zip} 2>&1\n        } >>/dev/null\n\n        readarray -td ' ' NEED_INSTALL <<<\"$NEED_INSTALL_FIX \"\n        unset 'NEED_INSTALL[-1]'\n    elif [ \"$PM\" = \"emerge\" ]; then\n        NEED_INSTALL_FIX=${NEED_INSTALL[*]}\n        {\n            NEED_INSTALL_FIX=${NEED_INSTALL_FIX//whiptail/dialog} 2>&1\n            NEED_INSTALL_FIX=${NEED_INSTALL_FIX//python3-pip/dev-python/pip} 2>&1\n            NEED_INSTALL_FIX=${NEED_INSTALL_FIX//p7zip-full/p7zip} 2>&1\n        } >>/dev/null\n\n        readarray -td ' ' NEED_INSTALL <<<\"$NEED_INSTALL_FIX \"\n        unset 'NEED_INSTALL[-1]'\n    fi\n    if ! (sudo \"$PM\" \"${INSTALL_OPTION[@]}\" \"${NEED_INSTALL[@]}\"); then abort; fi\n\nfi\n\npython_version=$(python3 -c 'import sys;print(\"{0}{1}\".format(*(sys.version_info[:2])))')\nPYTHON_VENV_DIR=\"$(dirname \"$PWD\")/python3-env\"\nif [ \"$python_version\" -ge 311 ] || [ -f \"$PYTHON_VENV_DIR/bin/activate\" ]; then\n    if ! (python3 -c \"import venv\" >/dev/null 2>&1) || ! (python3 -c \"import ensurepip\" >/dev/null 2>&1); then\n        case \"$PM\" in\n        zypper)\n            if ! (sudo \"$PM\" \"${INSTALL_OPTION[@]}\" \"python3-venvctrl\"); then\n                abort\n            fi\n            ;;\n        *)\n            if ! (sudo \"$PM\" \"${INSTALL_OPTION[@]}\" \"python3-venv\"); then\n                abort\n            fi\n            ;;\n        esac\n    fi\n    echo \"Creating python3 virtual env\"\n    python3 -m venv --system-site-packages \"$PYTHON_VENV_DIR\" || {\n        echo \"Failed to upgrade python3 virtual env, clear and recreate\"\n        python3 -m venv --clear --system-site-packages \"$PYTHON_VENV_DIR\" || abort \"Failed to create python3 virtual env\"\n    }\nfi\nif [ -f \"$PYTHON_VENV_DIR/bin/activate\" ]; then\n    # shellcheck disable=SC1091\n    source \"$PYTHON_VENV_DIR\"/bin/activate || abort \"Failed to activate python3 virtual env\"\n    python3 -c \"import pkg_resources; pkg_resources.require(open('requirements.txt',mode='r'))\" &>/dev/null || {\n        echo \"Installing Python3 dependencies\"\n        python3 -m pip install -r requirements.txt || abort \"Failed to install python3 dependencies\"\n    }\n    deactivate\nelse\n    python3 -m pip install -r requirements.txt -q || abort \"Failed to install python3 dependencies\"\nfi\n"
  },
  {
    "path": "scripts/magisk_debug.sh",
    "content": "#!/bin/bash\n#\n# This file is part of MagiskOnWSALocal.\n#\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\n#\n# Copyright (C) 2024 LSPosed Contributors\n#\n\nif [ ! \"$BASH_VERSION\" ]; then\n    echo \"Please do not use sh to run this script, just execute it directly\" 1>&2\n    exit 1\nfi\nHOST_ARCH=$(uname -m)\nif [ \"$HOST_ARCH\" != \"x86_64\" ] && [ \"$HOST_ARCH\" != \"aarch64\" ]; then\n    echo \"Unsupported architectures: $HOST_ARCH\"\n    exit 1\nfi\ncd \"$(dirname \"$0\")\" || exit 1\n# export TMPDIR=$HOME/.cache/wsa\nif [ \"$TMPDIR\" ] && [ ! -d \"$TMPDIR\" ]; then\n    mkdir -p \"$TMPDIR\"\nfi\nWORK_DIR=$(mktemp -d -t wsa-build-XXXXXXXXXX_) || exit 1\n\nDOWNLOAD_DIR=../download\nPYTHON_VENV_DIR=\"$(dirname \"$PWD\")/python3-env\"\ndir_clean() {\n    rm -rf \"${WORK_DIR:?}\"\n    if [ \"$TMPDIR\" ] && [ -d \"$TMPDIR\" ]; then\n        echo \"Cleanup Temp Directory\"\n        rm -rf \"${TMPDIR:?}\"\n        unset TMPDIR\n    fi\n    if [ \"$(python3 -c 'import sys ; print( 1 if sys.prefix != sys.base_prefix else 0 )')\" = \"1\" ]; then\n        echo \"deactivate python3 venv\"\n        deactivate\n    fi\n}\ntrap dir_clean EXIT\nabort() {\n    [ \"$1\" ] && echo -e \"ERROR: $1\"\n    echo \"Build: an error has occurred, exit\"\n    if [ -d \"$WORK_DIR\" ]; then\n        echo -e \"\\nCleanup Work Directory\"\n        dir_clean\n    fi\n    exit 1\n}\ntrap abort INT TERM\n# shellcheck disable=SC1091\n[ -f \"$PYTHON_VENV_DIR/bin/activate\" ] && {\n    source \"$PYTHON_VENV_DIR/bin/activate\" || abort \"Failed to activate virtual environment, please re-run install_deps.sh\"\n}\nMAGISK_VER=$1\nARCH=$2\nTARGET=$3\nif [ -z \"$MAGISK_VER\" ] || [ -z \"$ARCH\" ] || [ -z \"$TARGET\" ]; then\n    echo \"Usage: $0 <release|debug> <x64|arm64> <initrd>\"\n    exit 1\nfi\nMAGISK_ZIP=magisk-$MAGISK_VER.zip\nMAGISK_PATH=$DOWNLOAD_DIR/$MAGISK_ZIP\nif [ ! -f \"$MAGISK_PATH\" ]; then\n    echo \"Custom Magisk $MAGISK_ZIP not found\"\n    MAGISK_ZIP=app-$MAGISK_VER.apk\n    echo -e \"Fallback to $MAGISK_ZIP\\n\"\n    MAGISK_PATH=$DOWNLOAD_DIR/$MAGISK_ZIP\n    if [ ! -f \"$MAGISK_PATH\" ]; then\n        abort \"Custom Magisk $MAGISK_ZIP not found\\nPlease put custom Magisk in $DOWNLOAD_DIR\"\n    fi\nfi\necho \"Extracting Magisk\"\nif [ -f \"$MAGISK_PATH\" ]; then\n    if ! python3 extractMagisk.py \"$ARCH\" \"$MAGISK_PATH\" \"$WORK_DIR\"; then\n        abort \"Unzip Magisk failed, is the download incomplete?\"\n    fi\n    chmod +x \"$WORK_DIR/magisk/magiskboot\" || abort\nelif [ -z \"${CUSTOM_MAGISK+x}\" ]; then\n    abort \"The Magisk zip package does not exist, is the download incomplete?\"\nelse\n    abort \"The Magisk zip package does not exist, rename it to magisk-debug.zip and put it in the download folder.\"\nfi\necho -e \"done\\n\"\necho \"Integrating Magisk\"\nSKIP=\"#\"\nSINGLEABI=\"#\"\nSKIPINITLD=\"#\"\nif [ -f \"$WORK_DIR/magisk/magisk64\" ]; then\n    \"$WORK_DIR/magisk/magiskboot\" compress=xz \"$WORK_DIR/magisk/magisk64\" \"$WORK_DIR/magisk/magisk64.xz\"\n    \"$WORK_DIR/magisk/magiskboot\" compress=xz \"$WORK_DIR/magisk/magisk32\" \"$WORK_DIR/magisk/magisk32.xz\"\n    unset SINGLEABI\nelse\n    \"$WORK_DIR/magisk/magiskboot\" compress=xz \"$WORK_DIR/magisk/magisk\" \"$WORK_DIR/magisk/magisk.xz\"\n    unset SKIP\nfi\nif [ -f \"$WORK_DIR/magisk/init-ld\" ]; then\n    \"$WORK_DIR/magisk/magiskboot\" compress=xz \"$WORK_DIR/magisk/init-ld\" \"$WORK_DIR/magisk/init-ld.xz\"\n    unset SKIPINITLD\nfi\n\"$WORK_DIR/magisk/magiskboot\" compress=xz \"$MAGISK_PATH\" \"$WORK_DIR/magisk/stub.xz\"\n\"$WORK_DIR/magisk/magiskboot\" cpio \"$TARGET\" \\\n    \"add 0750 /lspinit ../bin/$ARCH/lspinit\" \\\n    \"add 0750 /magiskinit $WORK_DIR/magisk/magiskinit\" \\\n    \"$SINGLEABI add 0644 overlay.d/sbin/magisk64.xz $WORK_DIR/magisk/magisk64.xz\" \\\n    \"$SINGLEABI add 0644 overlay.d/sbin/magisk32.xz $WORK_DIR/magisk/magisk32.xz\" \\\n    \"$SKIP add 0644 overlay.d/sbin/magisk.xz $WORK_DIR/magisk/magisk.xz\" \\\n    \"$SKIPINITLD add 0644 overlay.d/sbin/init-ld.xz $WORK_DIR/magisk/init-ld.xz\" \\\n    \"add 0644 overlay.d/sbin/stub.xz $WORK_DIR/magisk/stub.xz\" \\\n    || abort \"Unable to patch initrd\"\n"
  },
  {
    "path": "scripts/post-fs-data.sh",
    "content": "#!/bin/sh\nMAGISKTMP=/sbin\n[ -d /sbin ] || MAGISKTMP=/debug_ramdisk\nMAGISKBIN=/data/adb/magisk\nif [ ! -d /data/adb ]; then\n    mkdir -m 700 /data/adb\n    chcon u:object_r:adb_data_file:s0 /data/adb\nfi\nif [ ! -d $MAGISKBIN ]; then\n    # shellcheck disable=SC2174\n    mkdir -p -m 755 $MAGISKBIN\n    chcon u:object_r:system_file:s0 $MAGISKBIN\nfi\nABI=$(getprop ro.product.cpu.abi)\nfor file in busybox magiskpolicy magiskboot magiskinit; do\n    [ -x \"$MAGISKBIN/$file\" ] || {\n        unzip -d $MAGISKBIN -oj $MAGISKTMP/stub.apk \"lib/$ABI/lib$file.so\"\n        mv $MAGISKBIN/lib$file.so $MAGISKBIN/$file\n        chmod 755 \"$MAGISKBIN/$file\"\n    }\ndone\nfor file in util_functions.sh boot_patch.sh; do\n    [ -x \"$MAGISKBIN/$file\" ] || {\n        unzip -d $MAGISKBIN -oj $MAGISKTMP/stub.apk \"assets/$file\"\n        chmod 755 \"$MAGISKBIN/$file\"\n    }\ndone\nfor file in \"$MAGISKTMP\"/*; do\n    if echo \"$file\" | grep -Eq \"lsp_.+\\.img\"; then\n        foldername=$(basename \"$file\" .img)\n        mkdir -p \"$MAGISKTMP/$foldername\"\n        mount -t auto -o ro,loop \"$file\" \"$MAGISKTMP/$foldername\"\n        \"$MAGISKTMP/$foldername/post-fs-data.sh\" &\n    fi\ndone\nwait\nfor file in \"$MAGISKTMP\"/*; do\n    if echo \"$file\" | grep -Eq \"lsp_.+\\.img\"; then\n        foldername=$(basename \"$file\" .img)\n        umount \"$MAGISKTMP/$foldername\"\n        rm -rf \"${MAGISKTMP:?}/${foldername:?}\"\n        rm -f \"$file\"\n    fi\ndone\n"
  },
  {
    "path": "scripts/requirements.txt",
    "content": "requests\npackaging\n"
  },
  {
    "path": "scripts/run.sh",
    "content": "#!/bin/bash\n#\n# This file is part of MagiskOnWSALocal.\n#\n# MagiskOnWSALocal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# MagiskOnWSALocal is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\n#\n# Copyright (C) 2024 LSPosed Contributors\n#\n\nif [ ! \"$BASH_VERSION\" ]; then\n    echo \"Please do not use sh to run this script, just execute it directly\" 1>&2\n    exit 1\nfi\ncd \"$(dirname \"$0\")\" || exit 1\n\n./install_deps.sh || exit 1\n\nWHIPTAIL=$(command -v whiptail 2>/dev/null)\nDIALOG=$(command -v dialog 2>/dev/null)\nDIALOG=${WHIPTAIL:-$DIALOG}\nfunction Radiolist {\n    declare -A o=\"$1\"\n    shift\n    if ! $DIALOG --nocancel --radiolist \"${o[title]}\" 0 0 0 \"$@\" 3>&1 1>&2 2>&3; then\n        echo \"${o[default]}\"\n    fi\n}\n\nfunction YesNoBox {\n    declare -A o=\"$1\"\n    local default\n    [ \"$2\" ] && {\n        [ \"$2\" = \"no\" ] && default=\"--defaultno\"\n    }\n    shift\n    $DIALOG --title \"${o[title]}\" $default --yesno \"${o[text]}\" 0 0\n}\n\nfunction DialogBox {\n    declare -A o=\"$1\"\n    shift\n    $DIALOG --title \"${o[title]}\" --msgbox \"${o[text]}\" 0 0\n}\nintro=\"Welcome to MagiskOnWSA!\n\n    With this utility, you can integrate Magisk for WSA easily.\n    Use arrow keys to navigate, and press space to select.\n    Press enter to confirm.\n\"\nDialogBox \"([title]='Intro to MagiskOnWSA' \\\n            [text]='$intro')\"\n\nARCH=$(\n    Radiolist '([title]=\"Build arch\"\n                [default]=\"x64\")' \\\n        'x64' \"X86_64\" 'on' \\\n        'arm64' \"AArch64\" 'off'\n)\n\nRELEASE_TYPE=$(\n    Radiolist '([title]=\"WSA release type\"\n                [default]=\"retail\")' \\\n        'retail' \"Stable Channel\" 'on' \\\n        'release preview' \"Release Preview Channel\" 'off' \\\n        'insider slow' \"Beta Channel\" 'off' \\\n        'insider fast' \"Dev Channel\" 'off'\n)\ndeclare -A RELEASE_TYPE_MAP=([\"retail\"]=\"retail\" [\"release preview\"]=\"RP\" [\"insider slow\"]=\"WIS\" [\"insider fast\"]=\"WIF\")\nCOMMAND_LINE=(--arch \"$ARCH\" --release-type \"${RELEASE_TYPE_MAP[$RELEASE_TYPE]}\")\nif (YesNoBox '([title]=\"Root\" [text]=\"Do you want to Root WSA?\")'); then\n    ROOT_SOL=$(\n        Radiolist '([title]=\"Root solution\"\n                    [default]=\"magisk\")' \\\n            'magisk' \"Magisk\" 'on' \\\n            'kernelsu' \"KernelSU\" 'off'\n    )\n    COMMAND_LINE+=(--root-sol \"$ROOT_SOL\")\nelse\n    COMMAND_LINE+=(--root-sol \"none\")\nfi\n\nif [ \"$ROOT_SOL\" = \"magisk\" ]; then\n    MAGISK_VER=$(\n        Radiolist '([title]=\"Magisk version\"\n                    [default]=\"stable\")' \\\n            'stable' \"Stable Channel\" 'on' \\\n            'beta' \"Beta Channel\" 'off' \\\n            'canary' \"Canary Channel\" 'off' \\\n            'debug' \"Canary Channel Debug Build\" 'off'\n    )\n    COMMAND_LINE+=(--magisk-ver \"$MAGISK_VER\")\n    if (YesNoBox '([title]=\"Install GApps\" [text]=\"Do you want to install GApps?\")'); then\n        COMMAND_LINE+=(--install-gapps)\n    fi\nfi\n\nif (YesNoBox '([title]=\"Remove Amazon Appstore\" [text]=\"Do you want to remove Amazon Appstore?\")' no); then\n    COMMAND_LINE+=(--remove-amazon)\nfi\n\nif (YesNoBox '([title]=\"Compress output\" [text]=\"Do you want to compress the output?\")'); then\n    COMPRESS_FORMAT=$(\n        Radiolist '([title]=\"Compress format\"\n                    [default]=\"7z\")' \\\n            '7z' \"7-Zip\" 'on' \\\n            'zip' \"Zip\" 'off'\n    )\n    COMMAND_LINE+=(--compress-format \"$COMPRESS_FORMAT\")\nfi\n\nclear\necho \"COMMAND_LINE=${COMMAND_LINE[*]}\"\nchmod +x ./build.sh\n./build.sh \"${COMMAND_LINE[@]}\"\n"
  },
  {
    "path": "xml/FE3FileUrl.xml",
    "content": "<s:Envelope xmlns:a=\"http://www.w3.org/2005/08/addressing\"\r\n\txmlns:s=\"http://www.w3.org/2003/05/soap-envelope\">\r\n\t<s:Header>\r\n\t\t<a:Action s:mustUnderstand=\"1\">http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/GetExtendedUpdateInfo2</a:Action>\r\n\t\t<a:MessageID>urn:uuid:2cc99c2e-3b3e-4fb1-9e31-0cd30e6f43a0</a:MessageID>\r\n\t\t<a:To s:mustUnderstand=\"1\">https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx/secured</a:To>\r\n\t\t<o:Security s:mustUnderstand=\"1\"\r\n\t\t\txmlns:o=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\r\n\t\t\t<Timestamp xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\r\n\t\t\t\t<Created>2017-08-01T00:29:01.868Z</Created>\r\n\t\t\t\t<Expires>2017-08-01T00:34:01.868Z</Expires>\r\n\t\t\t</Timestamp>\r\n\t\t\t<wuws:WindowsUpdateTicketsToken wsu:id=\"ClientMSA\"\r\n\t\t\t\txmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"\r\n\t\t\t\txmlns:wuws=\"http://schemas.microsoft.com/msus/2014/10/WindowsUpdateAuthorization\">\r\n\t\t\t\t<TicketType Name=\"MSA\" Version=\"1.0\" Policy=\"MBI_SSL\">\r\n\t\t\t\t\t<user>{}</user>\r\n\t\t\t\t</TicketType>\r\n\t\t\t</wuws:WindowsUpdateTicketsToken>\r\n\t\t</o:Security>\r\n\t</s:Header>\r\n\t<s:Body>\r\n\t\t<GetExtendedUpdateInfo2 xmlns=\"http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService\">\r\n\t\t\t<updateIDs>\r\n\t\t\t\t<UpdateIdentity>\r\n\t\t\t\t\t<UpdateID>{}</UpdateID>\r\n\t\t\t\t\t<RevisionNumber>{}</RevisionNumber>\r\n\t\t\t\t</UpdateIdentity>\r\n\t\t\t</updateIDs>\r\n\t\t\t<infoTypes>\r\n\t\t\t\t<XmlUpdateFragmentType>FileUrl</XmlUpdateFragmentType>\r\n\t\t\t\t<XmlUpdateFragmentType>FileDecryption</XmlUpdateFragmentType>\r\n\t\t\t</infoTypes>\r\n\t\t\t<deviceAttributes>BranchReadinessLevel=CB;CurrentBranch=rs_prerelease;OEMModel=Virtual Machine;FlightRing={};AttrDataVer=21;SystemManufacturer=Microsoft Corporation;InstallLanguage=en-US;OSUILocale=en-US;InstallationType=Client;FlightingBranchName=external;FirmwareVersion=Hyper-V UEFI Release v2.5;SystemProductName=Virtual Machine;OSSkuId=48;FlightContent=Branch;App=WU;OEMName_Uncleaned=Microsoft Corporation;AppVer=10.0.22621.900;OSArchitecture=AMD64;SystemSKU=None;UpdateManagementGroup=2;IsFlightingEnabled=1;IsDeviceRetailDemo=0;TelemetryLevel=3;OSVersion=10.0.22621.900;DeviceFamily=Windows.Desktop;</deviceAttributes>\r\n\t\t</GetExtendedUpdateInfo2>\r\n\t</s:Body>\r\n</s:Envelope>\r\n"
  },
  {
    "path": "xml/GetCookie.xml",
    "content": "<Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n\txmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\r\n\txmlns=\"http://www.w3.org/2003/05/soap-envelope\">\r\n\t<Header>\r\n\t\t<Action d3p1:mustUnderstand=\"1\"\r\n\t\t\txmlns:d3p1=\"http://www.w3.org/2003/05/soap-envelope\"\r\n\t\t\txmlns=\"http://www.w3.org/2005/08/addressing\">http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/GetCookie</Action>\r\n\t\t<MessageID xmlns=\"http://www.w3.org/2005/08/addressing\">urn:uuid:b9b43757-2247-4d7b-ae8f-a71ba8a22386</MessageID>\r\n\t\t<To d3p1:mustUnderstand=\"1\"\r\n\t\t\txmlns:d3p1=\"http://www.w3.org/2003/05/soap-envelope\"\r\n\t\t\txmlns=\"http://www.w3.org/2005/08/addressing\">https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx</To>\r\n\t\t<Security d3p1:mustUnderstand=\"1\"\r\n\t\t\txmlns:d3p1=\"http://www.w3.org/2003/05/soap-envelope\"\r\n\t\t\txmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\r\n\t\t\t<Timestamp xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\r\n\t\t\t\t<Created>2017-12-02T00:16:15.210Z</Created>\r\n\t\t\t\t<Expires>2017-12-29T06:25:43.943Z</Expires>\r\n\t\t\t</Timestamp>\r\n\t\t\t<WindowsUpdateTicketsToken d4p1:id=\"ClientMSA\"\r\n\t\t\t\txmlns:d4p1=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"\r\n\t\t\t\txmlns=\"http://schemas.microsoft.com/msus/2014/10/WindowsUpdateAuthorization\">\r\n\t\t\t\t<TicketType Name=\"MSA\" Version=\"1.0\" Policy=\"MBI_SSL\">\r\n\t\t\t\t\t<user>{}</user>\r\n\t\t\t\t</TicketType>\r\n\t\t\t</WindowsUpdateTicketsToken>\r\n\t\t</Security>\r\n\t</Header>\r\n\t<Body>\r\n\t\t<GetCookie xmlns=\"http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService\">\r\n\t\t\t<oldCookie>\r\n\t\t\t</oldCookie>\r\n\t\t\t<lastChange>2015-10-21T17:01:07.1472913Z</lastChange>\r\n\t\t\t<currentTime>2017-12-02T00:16:15.217Z</currentTime>\r\n\t\t\t<protocolVersion>1.40</protocolVersion>\r\n\t\t</GetCookie>\r\n\t</Body>\r\n</Envelope>"
  },
  {
    "path": "xml/WUIDRequest.xml",
    "content": "<s:Envelope xmlns:a=\"http://www.w3.org/2005/08/addressing\"\r\n\txmlns:s=\"http://www.w3.org/2003/05/soap-envelope\">\r\n\t<s:Header>\r\n\t\t<a:Action s:mustUnderstand=\"1\">http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/SyncUpdates</a:Action>\r\n\t\t<a:MessageID>urn:uuid:175df68c-4b91-41ee-b70b-f2208c65438e</a:MessageID>\r\n\t\t<a:To s:mustUnderstand=\"1\">https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx</a:To>\r\n\t\t<o:Security s:mustUnderstand=\"1\"\r\n\t\t\txmlns:o=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\r\n\t\t\t<Timestamp xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\r\n\t\t\t\t<Created>2017-08-05T02:03:05.038Z</Created>\r\n\t\t\t\t<Expires>2017-08-05T02:08:05.038Z</Expires>\r\n\t\t\t</Timestamp>\r\n\t\t\t<wuws:WindowsUpdateTicketsToken wsu:id=\"ClientMSA\"\r\n\t\t\t\txmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"\r\n\t\t\t\txmlns:wuws=\"http://schemas.microsoft.com/msus/2014/10/WindowsUpdateAuthorization\">\r\n\t\t\t\t<TicketType Name=\"MSA\" Version=\"1.0\" Policy=\"MBI_SSL\">\r\n\t\t\t\t\t<user>{}</user>\r\n\t\t\t\t</TicketType>\r\n\t\t\t</wuws:WindowsUpdateTicketsToken>\r\n\t\t</o:Security>\r\n\t</s:Header>\r\n\t<s:Body>\r\n\t\t<SyncUpdates xmlns=\"http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService\">\r\n\t\t\t<cookie>\r\n\t\t\t\t<Expiration>2045-03-11T02:02:48Z</Expiration>\r\n\t\t\t\t<EncryptedData>{}</EncryptedData>\r\n\t\t\t</cookie>\r\n\t\t\t<parameters>\r\n\t\t\t\t<ExpressQuery>false</ExpressQuery>\r\n\t\t\t\t<InstalledNonLeafUpdateIDs>\r\n\t\t\t\t\t<int>1</int>\r\n\t\t\t\t\t<int>2</int>\r\n\t\t\t\t\t<int>3</int>\r\n\t\t\t\t\t<int>11</int>\r\n\t\t\t\t\t<int>19</int>\r\n\t\t\t\t\t<int>544</int>\r\n\t\t\t\t\t<int>549</int>\r\n\t\t\t\t\t<int>2359974</int>\r\n\t\t\t\t\t<int>2359977</int>\r\n\t\t\t\t\t<int>5169044</int>\r\n\t\t\t\t\t<int>8788830</int>\r\n\t\t\t\t\t<int>23110993</int>\r\n\t\t\t\t\t<int>23110994</int>\r\n\t\t\t\t\t<int>54341900</int>\r\n\t\t\t\t\t<int>54343656</int>\r\n\t\t\t\t\t<int>59830006</int>\r\n\t\t\t\t\t<int>59830007</int>\r\n\t\t\t\t\t<int>59830008</int>\r\n\t\t\t\t\t<int>60484010</int>\r\n\t\t\t\t\t<int>62450018</int>\r\n\t\t\t\t\t<int>62450019</int>\r\n\t\t\t\t\t<int>62450020</int>\r\n\t\t\t\t\t<int>66027979</int>\r\n\t\t\t\t\t<int>66053150</int>\r\n\t\t\t\t\t<int>97657898</int>\r\n\t\t\t\t\t<int>98822896</int>\r\n\t\t\t\t\t<int>98959022</int>\r\n\t\t\t\t\t<int>98959023</int>\r\n\t\t\t\t\t<int>98959024</int>\r\n\t\t\t\t\t<int>98959025</int>\r\n\t\t\t\t\t<int>98959026</int>\r\n\t\t\t\t\t<int>104433538</int>\r\n\t\t\t\t\t<int>104900364</int>\r\n\t\t\t\t\t<int>105489019</int>\r\n\t\t\t\t\t<int>117765322</int>\r\n\t\t\t\t\t<int>129905029</int>\r\n\t\t\t\t\t<int>130040031</int>\r\n\t\t\t\t\t<int>132387090</int>\r\n\t\t\t\t\t<int>132393049</int>\r\n\t\t\t\t\t<int>133399034</int>\r\n\t\t\t\t\t<int>138537048</int>\r\n\t\t\t\t\t<int>140377312</int>\r\n\t\t\t\t\t<int>143747671</int>\r\n\t\t\t\t\t<int>158941041</int>\r\n\t\t\t\t\t<int>158941042</int>\r\n\t\t\t\t\t<int>158941043</int>\r\n\t\t\t\t\t<int>158941044</int>\r\n\t\t\t\t\t<int>159123858</int>\r\n\t\t\t\t\t<int>159130928</int>\r\n\t\t\t\t\t<int>164836897</int>\r\n\t\t\t\t\t<int>164847386</int>\r\n\t\t\t\t\t<int>164848327</int>\r\n\t\t\t\t\t<int>164852241</int>\r\n\t\t\t\t\t<int>164852246</int>\r\n\t\t\t\t\t<int>164852252</int>\r\n\t\t\t\t\t<int>164852253</int>\r\n\t\t\t\t</InstalledNonLeafUpdateIDs>\r\n\t\t\t\t<OtherCachedUpdateIDs>\r\n\t\t\t\t\t<int>10</int>\r\n\t\t\t\t\t<int>17</int>\r\n\t\t\t\t\t<int>2359977</int>\r\n\t\t\t\t\t<int>5143990</int>\r\n\t\t\t\t\t<int>5169043</int>\r\n\t\t\t\t\t<int>5169047</int>\r\n\t\t\t\t\t<int>8806526</int>\r\n\t\t\t\t\t<int>9125350</int>\r\n\t\t\t\t\t<int>9154769</int>\r\n\t\t\t\t\t<int>10809856</int>\r\n\t\t\t\t\t<int>23110995</int>\r\n\t\t\t\t\t<int>23110996</int>\r\n\t\t\t\t\t<int>23110999</int>\r\n\t\t\t\t\t<int>23111000</int>\r\n\t\t\t\t\t<int>23111001</int>\r\n\t\t\t\t\t<int>23111002</int>\r\n\t\t\t\t\t<int>23111003</int>\r\n\t\t\t\t\t<int>23111004</int>\r\n\t\t\t\t\t<int>24513870</int>\r\n\t\t\t\t\t<int>28880263</int>\r\n\t\t\t\t\t<int>30077688</int>\r\n\t\t\t\t\t<int>30486944</int>\r\n\t\t\t\t\t<int>30526991</int>\r\n\t\t\t\t\t<int>30528442</int>\r\n\t\t\t\t\t<int>30530496</int>\r\n\t\t\t\t\t<int>30530501</int>\r\n\t\t\t\t\t<int>30530504</int>\r\n\t\t\t\t\t<int>30530962</int>\r\n\t\t\t\t\t<int>30535326</int>\r\n\t\t\t\t\t<int>30536242</int>\r\n\t\t\t\t\t<int>30539913</int>\r\n\t\t\t\t\t<int>30545142</int>\r\n\t\t\t\t\t<int>30545145</int>\r\n\t\t\t\t\t<int>30545488</int>\r\n\t\t\t\t\t<int>30546212</int>\r\n\t\t\t\t\t<int>30547779</int>\r\n\t\t\t\t\t<int>30548797</int>\r\n\t\t\t\t\t<int>30548860</int>\r\n\t\t\t\t\t<int>30549262</int>\r\n\t\t\t\t\t<int>30551160</int>\r\n\t\t\t\t\t<int>30551161</int>\r\n\t\t\t\t\t<int>30551164</int>\r\n\t\t\t\t\t<int>30553016</int>\r\n\t\t\t\t\t<int>30553744</int>\r\n\t\t\t\t\t<int>30554014</int>\r\n\t\t\t\t\t<int>30559008</int>\r\n\t\t\t\t\t<int>30559011</int>\r\n\t\t\t\t\t<int>30560006</int>\r\n\t\t\t\t\t<int>30560011</int>\r\n\t\t\t\t\t<int>30561006</int>\r\n\t\t\t\t\t<int>30563261</int>\r\n\t\t\t\t\t<int>30565215</int>\r\n\t\t\t\t\t<int>30578059</int>\r\n\t\t\t\t\t<int>30664998</int>\r\n\t\t\t\t\t<int>30677904</int>\r\n\t\t\t\t\t<int>30681618</int>\r\n\t\t\t\t\t<int>30682195</int>\r\n\t\t\t\t\t<int>30685055</int>\r\n\t\t\t\t\t<int>30702579</int>\r\n\t\t\t\t\t<int>30708772</int>\r\n\t\t\t\t\t<int>30709591</int>\r\n\t\t\t\t\t<int>30711304</int>\r\n\t\t\t\t\t<int>30715418</int>\r\n\t\t\t\t\t<int>30720106</int>\r\n\t\t\t\t\t<int>30720273</int>\r\n\t\t\t\t\t<int>30732075</int>\r\n\t\t\t\t\t<int>30866952</int>\r\n\t\t\t\t\t<int>30866964</int>\r\n\t\t\t\t\t<int>30870749</int>\r\n\t\t\t\t\t<int>30877852</int>\r\n\t\t\t\t\t<int>30878437</int>\r\n\t\t\t\t\t<int>30890151</int>\r\n\t\t\t\t\t<int>30892149</int>\r\n\t\t\t\t\t<int>30990917</int>\r\n\t\t\t\t\t<int>31049444</int>\r\n\t\t\t\t\t<int>31190936</int>\r\n\t\t\t\t\t<int>31196961</int>\r\n\t\t\t\t\t<int>31197811</int>\r\n\t\t\t\t\t<int>31198836</int>\r\n\t\t\t\t\t<int>31202713</int>\r\n\t\t\t\t\t<int>31203522</int>\r\n\t\t\t\t\t<int>31205442</int>\r\n\t\t\t\t\t<int>31205557</int>\r\n\t\t\t\t\t<int>31207585</int>\r\n\t\t\t\t\t<int>31208440</int>\r\n\t\t\t\t\t<int>31208451</int>\r\n\t\t\t\t\t<int>31209591</int>\r\n\t\t\t\t\t<int>31210536</int>\r\n\t\t\t\t\t<int>31211625</int>\r\n\t\t\t\t\t<int>31212713</int>\r\n\t\t\t\t\t<int>31213588</int>\r\n\t\t\t\t\t<int>31218518</int>\r\n\t\t\t\t\t<int>31219420</int>\r\n\t\t\t\t\t<int>31220279</int>\r\n\t\t\t\t\t<int>31220302</int>\r\n\t\t\t\t\t<int>31222086</int>\r\n\t\t\t\t\t<int>31227080</int>\r\n\t\t\t\t\t<int>31229030</int>\r\n\t\t\t\t\t<int>31238236</int>\r\n\t\t\t\t\t<int>31254198</int>\r\n\t\t\t\t\t<int>31258008</int>\r\n\t\t\t\t\t<int>36436779</int>\r\n\t\t\t\t\t<int>36437850</int>\r\n\t\t\t\t\t<int>36464012</int>\r\n\t\t\t\t\t<int>41916569</int>\r\n\t\t\t\t\t<int>47249982</int>\r\n\t\t\t\t\t<int>47283134</int>\r\n\t\t\t\t\t<int>58577027</int>\r\n\t\t\t\t\t<int>58578040</int>\r\n\t\t\t\t\t<int>58578041</int>\r\n\t\t\t\t\t<int>58628920</int>\r\n\t\t\t\t\t<int>59107045</int>\r\n\t\t\t\t\t<int>59125697</int>\r\n\t\t\t\t\t<int>59142249</int>\r\n\t\t\t\t\t<int>60466586</int>\r\n\t\t\t\t\t<int>60478936</int>\r\n\t\t\t\t\t<int>66450441</int>\r\n\t\t\t\t\t<int>66467021</int>\r\n\t\t\t\t\t<int>66479051</int>\r\n\t\t\t\t\t<int>75202978</int>\r\n\t\t\t\t\t<int>77436021</int>\r\n\t\t\t\t\t<int>77449129</int>\r\n\t\t\t\t\t<int>85159569</int>\r\n\t\t\t\t\t<int>90199702</int>\r\n\t\t\t\t\t<int>90212090</int>\r\n\t\t\t\t\t<int>96911147</int>\r\n\t\t\t\t\t<int>97110308</int>\r\n\t\t\t\t\t<int>98528428</int>\r\n\t\t\t\t\t<int>98665206</int>\r\n\t\t\t\t\t<int>98837995</int>\r\n\t\t\t\t\t<int>98842922</int>\r\n\t\t\t\t\t<int>98842977</int>\r\n\t\t\t\t\t<int>98846632</int>\r\n\t\t\t\t\t<int>98866485</int>\r\n\t\t\t\t\t<int>98874250</int>\r\n\t\t\t\t\t<int>98879075</int>\r\n\t\t\t\t\t<int>98904649</int>\r\n\t\t\t\t\t<int>98918872</int>\r\n\t\t\t\t\t<int>98945691</int>\r\n\t\t\t\t\t<int>98959458</int>\r\n\t\t\t\t\t<int>98984707</int>\r\n\t\t\t\t\t<int>100220125</int>\r\n\t\t\t\t\t<int>100238731</int>\r\n\t\t\t\t\t<int>100662329</int>\r\n\t\t\t\t\t<int>100795834</int>\r\n\t\t\t\t\t<int>100862457</int>\r\n\t\t\t\t\t<int>103124811</int>\r\n\t\t\t\t\t<int>103348671</int>\r\n\t\t\t\t\t<int>104369981</int>\r\n\t\t\t\t\t<int>104372472</int>\r\n\t\t\t\t\t<int>104385324</int>\r\n\t\t\t\t\t<int>104465831</int>\r\n\t\t\t\t\t<int>104465834</int>\r\n\t\t\t\t\t<int>104467697</int>\r\n\t\t\t\t\t<int>104473368</int>\r\n\t\t\t\t\t<int>104482267</int>\r\n\t\t\t\t\t<int>104505005</int>\r\n\t\t\t\t\t<int>104523840</int>\r\n\t\t\t\t\t<int>104550085</int>\r\n\t\t\t\t\t<int>104558084</int>\r\n\t\t\t\t\t<int>104659441</int>\r\n\t\t\t\t\t<int>104659675</int>\r\n\t\t\t\t\t<int>104664678</int>\r\n\t\t\t\t\t<int>104668274</int>\r\n\t\t\t\t\t<int>104671092</int>\r\n\t\t\t\t\t<int>104673242</int>\r\n\t\t\t\t\t<int>104674239</int>\r\n\t\t\t\t\t<int>104679268</int>\r\n\t\t\t\t\t<int>104686047</int>\r\n\t\t\t\t\t<int>104698649</int>\r\n\t\t\t\t\t<int>104751469</int>\r\n\t\t\t\t\t<int>104752478</int>\r\n\t\t\t\t\t<int>104755145</int>\r\n\t\t\t\t\t<int>104761158</int>\r\n\t\t\t\t\t<int>104762266</int>\r\n\t\t\t\t\t<int>104786484</int>\r\n\t\t\t\t\t<int>104853747</int>\r\n\t\t\t\t\t<int>104873258</int>\r\n\t\t\t\t\t<int>104983051</int>\r\n\t\t\t\t\t<int>105063056</int>\r\n\t\t\t\t\t<int>105116588</int>\r\n\t\t\t\t\t<int>105178523</int>\r\n\t\t\t\t\t<int>105318602</int>\r\n\t\t\t\t\t<int>105362613</int>\r\n\t\t\t\t\t<int>105364552</int>\r\n\t\t\t\t\t<int>105368563</int>\r\n\t\t\t\t\t<int>105369591</int>\r\n\t\t\t\t\t<int>105370746</int>\r\n\t\t\t\t\t<int>105373503</int>\r\n\t\t\t\t\t<int>105373615</int>\r\n\t\t\t\t\t<int>105376634</int>\r\n\t\t\t\t\t<int>105377546</int>\r\n\t\t\t\t\t<int>105378752</int>\r\n\t\t\t\t\t<int>105379574</int>\r\n\t\t\t\t\t<int>105381626</int>\r\n\t\t\t\t\t<int>105382587</int>\r\n\t\t\t\t\t<int>105425313</int>\r\n\t\t\t\t\t<int>105495146</int>\r\n\t\t\t\t\t<int>105862607</int>\r\n\t\t\t\t\t<int>105939029</int>\r\n\t\t\t\t\t<int>105995585</int>\r\n\t\t\t\t\t<int>106017178</int>\r\n\t\t\t\t\t<int>106129726</int>\r\n\t\t\t\t\t<int>106768485</int>\r\n\t\t\t\t\t<int>107825194</int>\r\n\t\t\t\t\t<int>111906429</int>\r\n\t\t\t\t\t<int>115121473</int>\r\n\t\t\t\t\t<int>115578654</int>\r\n\t\t\t\t\t<int>116630363</int>\r\n\t\t\t\t\t<int>117835105</int>\r\n\t\t\t\t\t<int>117850671</int>\r\n\t\t\t\t\t<int>118638500</int>\r\n\t\t\t\t\t<int>118662027</int>\r\n\t\t\t\t\t<int>118872681</int>\r\n\t\t\t\t\t<int>118873829</int>\r\n\t\t\t\t\t<int>118879289</int>\r\n\t\t\t\t\t<int>118889092</int>\r\n\t\t\t\t\t<int>119501720</int>\r\n\t\t\t\t\t<int>119551648</int>\r\n\t\t\t\t\t<int>119569538</int>\r\n\t\t\t\t\t<int>119640702</int>\r\n\t\t\t\t\t<int>119667998</int>\r\n\t\t\t\t\t<int>119674103</int>\r\n\t\t\t\t\t<int>119697201</int>\r\n\t\t\t\t\t<int>119706266</int>\r\n\t\t\t\t\t<int>119744627</int>\r\n\t\t\t\t\t<int>119773746</int>\r\n\t\t\t\t\t<int>120072697</int>\r\n\t\t\t\t\t<int>120144309</int>\r\n\t\t\t\t\t<int>120214154</int>\r\n\t\t\t\t\t<int>120357027</int>\r\n\t\t\t\t\t<int>120392612</int>\r\n\t\t\t\t\t<int>120399120</int>\r\n\t\t\t\t\t<int>120553945</int>\r\n\t\t\t\t\t<int>120783545</int>\r\n\t\t\t\t\t<int>120797092</int>\r\n\t\t\t\t\t<int>120881676</int>\r\n\t\t\t\t\t<int>120889689</int>\r\n\t\t\t\t\t<int>120999554</int>\r\n\t\t\t\t\t<int>121168608</int>\r\n\t\t\t\t\t<int>121268830</int>\r\n\t\t\t\t\t<int>121341838</int>\r\n\t\t\t\t\t<int>121729951</int>\r\n\t\t\t\t\t<int>121803677</int>\r\n\t\t\t\t\t<int>122165810</int>\r\n\t\t\t\t\t<int>125408034</int>\r\n\t\t\t\t\t<int>127293130</int>\r\n\t\t\t\t\t<int>127566683</int>\r\n\t\t\t\t\t<int>127762067</int>\r\n\t\t\t\t\t<int>127861893</int>\r\n\t\t\t\t\t<int>128571722</int>\r\n\t\t\t\t\t<int>128647535</int>\r\n\t\t\t\t\t<int>128698922</int>\r\n\t\t\t\t\t<int>128701748</int>\r\n\t\t\t\t\t<int>128771507</int>\r\n\t\t\t\t\t<int>129037212</int>\r\n\t\t\t\t\t<int>129079800</int>\r\n\t\t\t\t\t<int>129175415</int>\r\n\t\t\t\t\t<int>129317272</int>\r\n\t\t\t\t\t<int>129319665</int>\r\n\t\t\t\t\t<int>129365668</int>\r\n\t\t\t\t\t<int>129378095</int>\r\n\t\t\t\t\t<int>129424803</int>\r\n\t\t\t\t\t<int>129590730</int>\r\n\t\t\t\t\t<int>129603714</int>\r\n\t\t\t\t\t<int>129625954</int>\r\n\t\t\t\t\t<int>129692391</int>\r\n\t\t\t\t\t<int>129714980</int>\r\n\t\t\t\t\t<int>129721097</int>\r\n\t\t\t\t\t<int>129886397</int>\r\n\t\t\t\t\t<int>129968371</int>\r\n\t\t\t\t\t<int>129972243</int>\r\n\t\t\t\t\t<int>130009862</int>\r\n\t\t\t\t\t<int>130033651</int>\r\n\t\t\t\t\t<int>130040030</int>\r\n\t\t\t\t\t<int>130040032</int>\r\n\t\t\t\t\t<int>130040033</int>\r\n\t\t\t\t\t<int>130091954</int>\r\n\t\t\t\t\t<int>130100640</int>\r\n\t\t\t\t\t<int>130131267</int>\r\n\t\t\t\t\t<int>130131921</int>\r\n\t\t\t\t\t<int>130144837</int>\r\n\t\t\t\t\t<int>130171030</int>\r\n\t\t\t\t\t<int>130172071</int>\r\n\t\t\t\t\t<int>130197218</int>\r\n\t\t\t\t\t<int>130212435</int>\r\n\t\t\t\t\t<int>130291076</int>\r\n\t\t\t\t\t<int>130402427</int>\r\n\t\t\t\t\t<int>130405166</int>\r\n\t\t\t\t\t<int>130676169</int>\r\n\t\t\t\t\t<int>130698471</int>\r\n\t\t\t\t\t<int>130713390</int>\r\n\t\t\t\t\t<int>130785217</int>\r\n\t\t\t\t\t<int>131396908</int>\r\n\t\t\t\t\t<int>131455115</int>\r\n\t\t\t\t\t<int>131682095</int>\r\n\t\t\t\t\t<int>131689473</int>\r\n\t\t\t\t\t<int>131701956</int>\r\n\t\t\t\t\t<int>132142800</int>\r\n\t\t\t\t\t<int>132525441</int>\r\n\t\t\t\t\t<int>132765492</int>\r\n\t\t\t\t\t<int>132801275</int>\r\n\t\t\t\t\t<int>133399034</int>\r\n\t\t\t\t\t<int>134522926</int>\r\n\t\t\t\t\t<int>134524022</int>\r\n\t\t\t\t\t<int>134528994</int>\r\n\t\t\t\t\t<int>134532942</int>\r\n\t\t\t\t\t<int>134536993</int>\r\n\t\t\t\t\t<int>134538001</int>\r\n\t\t\t\t\t<int>134547533</int>\r\n\t\t\t\t\t<int>134549216</int>\r\n\t\t\t\t\t<int>134549317</int>\r\n\t\t\t\t\t<int>134550159</int>\r\n\t\t\t\t\t<int>134550214</int>\r\n\t\t\t\t\t<int>134550232</int>\r\n\t\t\t\t\t<int>134551154</int>\r\n\t\t\t\t\t<int>134551207</int>\r\n\t\t\t\t\t<int>134551390</int>\r\n\t\t\t\t\t<int>134553171</int>\r\n\t\t\t\t\t<int>134553237</int>\r\n\t\t\t\t\t<int>134554199</int>\r\n\t\t\t\t\t<int>134554227</int>\r\n\t\t\t\t\t<int>134555229</int>\r\n\t\t\t\t\t<int>134555240</int>\r\n\t\t\t\t\t<int>134556118</int>\r\n\t\t\t\t\t<int>134557078</int>\r\n\t\t\t\t\t<int>134560099</int>\r\n\t\t\t\t\t<int>134560287</int>\r\n\t\t\t\t\t<int>134562084</int>\r\n\t\t\t\t\t<int>134562180</int>\r\n\t\t\t\t\t<int>134563287</int>\r\n\t\t\t\t\t<int>134565083</int>\r\n\t\t\t\t\t<int>134566130</int>\r\n\t\t\t\t\t<int>134568111</int>\r\n\t\t\t\t\t<int>134624737</int>\r\n\t\t\t\t\t<int>134666461</int>\r\n\t\t\t\t\t<int>134672998</int>\r\n\t\t\t\t\t<int>134684008</int>\r\n\t\t\t\t\t<int>134916523</int>\r\n\t\t\t\t\t<int>135100527</int>\r\n\t\t\t\t\t<int>135219410</int>\r\n\t\t\t\t\t<int>135222083</int>\r\n\t\t\t\t\t<int>135306997</int>\r\n\t\t\t\t\t<int>135463054</int>\r\n\t\t\t\t\t<int>135779456</int>\r\n\t\t\t\t\t<int>135812968</int>\r\n\t\t\t\t\t<int>136097030</int>\r\n\t\t\t\t\t<int>136131333</int>\r\n\t\t\t\t\t<int>136146907</int>\r\n\t\t\t\t\t<int>136157556</int>\r\n\t\t\t\t\t<int>136320962</int>\r\n\t\t\t\t\t<int>136450641</int>\r\n\t\t\t\t\t<int>136466000</int>\r\n\t\t\t\t\t<int>136745792</int>\r\n\t\t\t\t\t<int>136761546</int>\r\n\t\t\t\t\t<int>136840245</int>\r\n\t\t\t\t\t<int>138160034</int>\r\n\t\t\t\t\t<int>138181244</int>\r\n\t\t\t\t\t<int>138210071</int>\r\n\t\t\t\t\t<int>138210107</int>\r\n\t\t\t\t\t<int>138232200</int>\r\n\t\t\t\t\t<int>138237088</int>\r\n\t\t\t\t\t<int>138277547</int>\r\n\t\t\t\t\t<int>138287133</int>\r\n\t\t\t\t\t<int>138306991</int>\r\n\t\t\t\t\t<int>138324625</int>\r\n\t\t\t\t\t<int>138341916</int>\r\n\t\t\t\t\t<int>138372035</int>\r\n\t\t\t\t\t<int>138372036</int>\r\n\t\t\t\t\t<int>138375118</int>\r\n\t\t\t\t\t<int>138378071</int>\r\n\t\t\t\t\t<int>138380128</int>\r\n\t\t\t\t\t<int>138380194</int>\r\n\t\t\t\t\t<int>138534411</int>\r\n\t\t\t\t\t<int>138618294</int>\r\n\t\t\t\t\t<int>138931764</int>\r\n\t\t\t\t\t<int>139536037</int>\r\n\t\t\t\t\t<int>139536038</int>\r\n\t\t\t\t\t<int>139536039</int>\r\n\t\t\t\t\t<int>139536040</int>\r\n\t\t\t\t\t<int>140367832</int>\r\n\t\t\t\t\t<int>140406050</int>\r\n\t\t\t\t\t<int>140421668</int>\r\n\t\t\t\t\t<int>140422973</int>\r\n\t\t\t\t\t<int>140423713</int>\r\n\t\t\t\t\t<int>140436348</int>\r\n\t\t\t\t\t<int>140483470</int>\r\n\t\t\t\t\t<int>140615715</int>\r\n\t\t\t\t\t<int>140802803</int>\r\n\t\t\t\t\t<int>140896470</int>\r\n\t\t\t\t\t<int>141189437</int>\r\n\t\t\t\t\t<int>141192744</int>\r\n\t\t\t\t\t<int>141382548</int>\r\n\t\t\t\t\t<int>141461680</int>\r\n\t\t\t\t\t<int>141624996</int>\r\n\t\t\t\t\t<int>141627135</int>\r\n\t\t\t\t\t<int>141659139</int>\r\n\t\t\t\t\t<int>141872038</int>\r\n\t\t\t\t\t<int>141993721</int>\r\n\t\t\t\t\t<int>142006413</int>\r\n\t\t\t\t\t<int>142045136</int>\r\n\t\t\t\t\t<int>142095667</int>\r\n\t\t\t\t\t<int>142227273</int>\r\n\t\t\t\t\t<int>142250480</int>\r\n\t\t\t\t\t<int>142518788</int>\r\n\t\t\t\t\t<int>142544931</int>\r\n\t\t\t\t\t<int>142546314</int>\r\n\t\t\t\t\t<int>142555433</int>\r\n\t\t\t\t\t<int>142653044</int>\r\n\t\t\t\t\t<int>143191852</int>\r\n\t\t\t\t\t<int>143258496</int>\r\n\t\t\t\t\t<int>143299722</int>\r\n\t\t\t\t\t<int>143331253</int>\r\n\t\t\t\t\t<int>143432462</int>\r\n\t\t\t\t\t<int>143632431</int>\r\n\t\t\t\t\t<int>143695326</int>\r\n\t\t\t\t\t<int>144219522</int>\r\n\t\t\t\t\t<int>144590916</int>\r\n\t\t\t\t\t<int>145410436</int>\r\n\t\t\t\t\t<int>146720405</int>\r\n\t\t\t\t\t<int>150810438</int>\r\n\t\t\t\t\t<int>151258773</int>\r\n\t\t\t\t\t<int>151315554</int>\r\n\t\t\t\t\t<int>151400090</int>\r\n\t\t\t\t\t<int>151429441</int>\r\n\t\t\t\t\t<int>151439617</int>\r\n\t\t\t\t\t<int>151453617</int>\r\n\t\t\t\t\t<int>151466296</int>\r\n\t\t\t\t\t<int>151511132</int>\r\n\t\t\t\t\t<int>151636561</int>\r\n\t\t\t\t\t<int>151823192</int>\r\n\t\t\t\t\t<int>151827116</int>\r\n\t\t\t\t\t<int>151850642</int>\r\n\t\t\t\t\t<int>152016572</int>\r\n\t\t\t\t\t<int>153111675</int>\r\n\t\t\t\t\t<int>153114652</int>\r\n\t\t\t\t\t<int>153123147</int>\r\n\t\t\t\t\t<int>153267108</int>\r\n\t\t\t\t\t<int>153389799</int>\r\n\t\t\t\t\t<int>153395366</int>\r\n\t\t\t\t\t<int>153718608</int>\r\n\t\t\t\t\t<int>154171028</int>\r\n\t\t\t\t\t<int>154315227</int>\r\n\t\t\t\t\t<int>154559688</int>\r\n\t\t\t\t\t<int>154978771</int>\r\n\t\t\t\t\t<int>154979742</int>\r\n\t\t\t\t\t<int>154985773</int>\r\n\t\t\t\t\t<int>154989370</int>\r\n\t\t\t\t\t<int>155044852</int>\r\n\t\t\t\t\t<int>155065458</int>\r\n\t\t\t\t\t<int>155578573</int>\r\n\t\t\t\t\t<int>156403304</int>\r\n\t\t\t\t\t<int>159085959</int>\r\n\t\t\t\t\t<int>159776047</int>\r\n\t\t\t\t\t<int>159816630</int>\r\n\t\t\t\t\t<int>160733048</int>\r\n\t\t\t\t\t<int>160733049</int>\r\n\t\t\t\t\t<int>160733050</int>\r\n\t\t\t\t\t<int>160733051</int>\r\n\t\t\t\t\t<int>160733056</int>\r\n\t\t\t\t\t<int>164824922</int>\r\n\t\t\t\t\t<int>164824924</int>\r\n\t\t\t\t\t<int>164824926</int>\r\n\t\t\t\t\t<int>164824930</int>\r\n\t\t\t\t\t<int>164831646</int>\r\n\t\t\t\t\t<int>164831647</int>\r\n\t\t\t\t\t<int>164831648</int>\r\n\t\t\t\t\t<int>164831650</int>\r\n\t\t\t\t\t<int>164835050</int>\r\n\t\t\t\t\t<int>164835051</int>\r\n\t\t\t\t\t<int>164835052</int>\r\n\t\t\t\t\t<int>164835056</int>\r\n\t\t\t\t\t<int>164835057</int>\r\n\t\t\t\t\t<int>164835059</int>\r\n\t\t\t\t\t<int>164836898</int>\r\n\t\t\t\t\t<int>164836899</int>\r\n\t\t\t\t\t<int>164836900</int>\r\n\t\t\t\t\t<int>164845333</int>\r\n\t\t\t\t\t<int>164845334</int>\r\n\t\t\t\t\t<int>164845336</int>\r\n\t\t\t\t\t<int>164845337</int>\r\n\t\t\t\t\t<int>164845341</int>\r\n\t\t\t\t\t<int>164845342</int>\r\n\t\t\t\t\t<int>164845345</int>\r\n\t\t\t\t\t<int>164845346</int>\r\n\t\t\t\t\t<int>164845349</int>\r\n\t\t\t\t\t<int>164845350</int>\r\n\t\t\t\t\t<int>164845353</int>\r\n\t\t\t\t\t<int>164845355</int>\r\n\t\t\t\t\t<int>164845358</int>\r\n\t\t\t\t\t<int>164845361</int>\r\n\t\t\t\t\t<int>164845364</int>\r\n\t\t\t\t\t<int>164847387</int>\r\n\t\t\t\t\t<int>164847388</int>\r\n\t\t\t\t\t<int>164847389</int>\r\n\t\t\t\t\t<int>164847390</int>\r\n\t\t\t\t\t<int>164848328</int>\r\n\t\t\t\t\t<int>164848329</int>\r\n\t\t\t\t\t<int>164848330</int>\r\n\t\t\t\t\t<int>164849448</int>\r\n\t\t\t\t\t<int>164849449</int>\r\n\t\t\t\t\t<int>164849451</int>\r\n\t\t\t\t\t<int>164849452</int>\r\n\t\t\t\t\t<int>164849454</int>\r\n\t\t\t\t\t<int>164849455</int>\r\n\t\t\t\t\t<int>164849457</int>\r\n\t\t\t\t\t<int>164849461</int>\r\n\t\t\t\t\t<int>164850219</int>\r\n\t\t\t\t\t<int>164850220</int>\r\n\t\t\t\t\t<int>164850222</int>\r\n\t\t\t\t\t<int>164850223</int>\r\n\t\t\t\t\t<int>164850224</int>\r\n\t\t\t\t\t<int>164850226</int>\r\n\t\t\t\t\t<int>164850227</int>\r\n\t\t\t\t\t<int>164850228</int>\r\n\t\t\t\t\t<int>164850229</int>\r\n\t\t\t\t\t<int>164850231</int>\r\n\t\t\t\t\t<int>164850236</int>\r\n\t\t\t\t\t<int>164850237</int>\r\n\t\t\t\t\t<int>164850240</int>\r\n\t\t\t\t\t<int>164850242</int>\r\n\t\t\t\t\t<int>164850243</int>\r\n\t\t\t\t\t<int>164852242</int>\r\n\t\t\t\t\t<int>164852243</int>\r\n\t\t\t\t\t<int>164852244</int>\r\n\t\t\t\t\t<int>164852247</int>\r\n\t\t\t\t\t<int>164852248</int>\r\n\t\t\t\t\t<int>164852249</int>\r\n\t\t\t\t\t<int>164852250</int>\r\n\t\t\t\t\t<int>164852251</int>\r\n\t\t\t\t\t<int>164852254</int>\r\n\t\t\t\t\t<int>164852256</int>\r\n\t\t\t\t\t<int>164852257</int>\r\n\t\t\t\t\t<int>164852258</int>\r\n\t\t\t\t\t<int>164852259</int>\r\n\t\t\t\t\t<int>164852260</int>\r\n\t\t\t\t\t<int>164852261</int>\r\n\t\t\t\t\t<int>164852262</int>\r\n\t\t\t\t\t<int>164853061</int>\r\n\t\t\t\t\t<int>164853063</int>\r\n\t\t\t\t\t<int>164853071</int>\r\n\t\t\t\t\t<int>164853072</int>\r\n\t\t\t\t\t<int>164853075</int>\r\n\t\t\t\t\t<int>168118980</int>\r\n\t\t\t\t\t<int>168118981</int>\r\n\t\t\t\t\t<int>168118983</int>\r\n\t\t\t\t\t<int>168118984</int>\r\n\t\t\t\t\t<int>168180375</int>\r\n\t\t\t\t\t<int>168180376</int>\r\n\t\t\t\t\t<int>168180378</int>\r\n\t\t\t\t\t<int>168180379</int>\r\n\t\t\t\t\t<int>168270830</int>\r\n\t\t\t\t\t<int>168270831</int>\r\n\t\t\t\t\t<int>168270833</int>\r\n\t\t\t\t\t<int>168270834</int>\r\n\t\t\t\t\t<int>168270835</int>\r\n\t\t\t\t</OtherCachedUpdateIDs>\r\n\t\t\t\t<SkipSoftwareSync>false</SkipSoftwareSync>\r\n\t\t\t\t<NeedTwoGroupOutOfScopeUpdates>true</NeedTwoGroupOutOfScopeUpdates>\r\n\t\t\t\t<FilterAppCategoryIds>\r\n\t\t\t\t\t<CategoryIdentifier>\r\n\t\t\t\t\t\t<Id>{}</Id>\r\n\t\t\t\t\t</CategoryIdentifier>\r\n\t\t\t\t</FilterAppCategoryIds>\r\n\t\t\t\t<TreatAppCategoryIdsAsInstalled>true</TreatAppCategoryIdsAsInstalled>\r\n\t\t\t\t<AlsoPerformRegularSync>false</AlsoPerformRegularSync>\r\n\t\t\t\t<ComputerSpec/>\r\n\t\t\t\t<ExtendedUpdateInfoParameters>\r\n\t\t\t\t\t<XmlUpdateFragmentTypes>\r\n\t\t\t\t\t\t<XmlUpdateFragmentType>Extended</XmlUpdateFragmentType>\r\n\t\t\t\t\t</XmlUpdateFragmentTypes>\r\n\t\t\t\t\t<Locales>\r\n\t\t\t\t\t\t<string>en-US</string>\r\n\t\t\t\t\t\t<string>en</string>\r\n\t\t\t\t\t</Locales>\r\n\t\t\t\t</ExtendedUpdateInfoParameters>\r\n\t\t\t\t<ClientPreferredLanguages>\r\n\t\t\t\t\t<string>en-US</string>\r\n\t\t\t\t</ClientPreferredLanguages>\r\n\t\t\t\t<ProductsParameters>\r\n\t\t\t\t\t<SyncCurrentVersionOnly>false</SyncCurrentVersionOnly>\r\n\t\t\t\t\t<DeviceAttributes>BranchReadinessLevel=CB;CurrentBranch=rs_prerelease;OEMModel=Virtual Machine;FlightRing={};AttrDataVer=21;SystemManufacturer=Microsoft Corporation;InstallLanguage=en-US;OSUILocale=en-US;InstallationType=Client;FlightingBranchName=external;FirmwareVersion=Hyper-V UEFI Release v2.5;SystemProductName=Virtual Machine;OSSkuId=48;FlightContent=Branch;App=WU;OEMName_Uncleaned=Microsoft Corporation;AppVer=10.0.22621.900;OSArchitecture=AMD64;SystemSKU=None;UpdateManagementGroup=2;IsFlightingEnabled=1;IsDeviceRetailDemo=0;TelemetryLevel=3;OSVersion=10.0.22621.900;DeviceFamily=Windows.Desktop;</DeviceAttributes>\r\n\t\t\t\t\t<CallerAttributes>Interactive=1;IsSeeker=0;</CallerAttributes>\r\n\t\t\t\t\t<Products/>\r\n\t\t\t\t</ProductsParameters>\r\n\t\t\t</parameters>\r\n\t\t</SyncUpdates>\r\n\t</s:Body>\r\n</s:Envelope>\r\n"
  },
  {
    "path": "xml/priconfig.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<!--    This file is part of MagiskOnWSALocal.\r\n\r\n        MagiskOnWSALocal is free software: you can redistribute it and/or modify\r\n        it under the terms of the GNU Affero General Public License as\r\n        published by the Free Software Foundation, either version 3 of the\r\n        License, or (at your option) any later version.\r\n\r\n        MagiskOnWSALocal is distributed in the hope that it will be useful,\r\n        but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n        GNU Affero General Public License for more details.\r\n\r\n        You should have received a copy of the GNU Affero General Public License\r\n        along with MagiskOnWSALocal.  If not, see <https://www.gnu.org/licenses/>.\r\n\r\n        Copyright (C) 2023 LSPosed Contributors\r\n-->\r\n<resources targetOsVersion=\"10.0.0\" majorVersion=\"1\">\r\n\t<index root=\"\\\" startIndexAt=\"\\\">\r\n\t\t<default>\r\n\t\t\t<qualifier name=\"Language\" value=\"en-US\" />\r\n\t\t</default>\r\n\t\t<indexer-config type=\"folder\" foldernameAsQualifier=\"true\" filenameAsQualifier=\"true\"\r\n\t\t\tqualifierDelimiter=\".\" />\r\n\t\t<indexer-config type=\"PRI\" />\r\n\t\t<indexer-config type=\"priinfo\" />\r\n\t</index>\r\n</resources>"
  }
]