Hacking Thursday
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    1
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # LineageOS 刷機筆記 Authors & Contributors: - Mat ## 觀念介紹 ### 主要流程 ### A/B分割區 #### Q: 如何檢查目前的分割區為何? ``` fastboot getvar current-slot ``` #### Q: 如何手動切換分割區 ``` fastboot set_active b ``` ### 主架構晶片 - CPU & ARCH - SoC ### 打開"開發者選項" ## 事前準備 ### 取得型號資訊 至系統的 "設定" >> "關於手機" 的設定分頁裡,找出 "型號" 參數。 然後至 LineageOS 支援列表查找對應的型號: <https://wiki.lineageos.org/devices/> 舉 `H4133` 為例: - 該型號列在 `Xperia XA2` 的 "Supported models" 內 - codename 為 `pioneer` - 參考網頁: <https://wiki.lineageos.org/devices/pioneer/> ### 安裝 adb/fastboot 工具 ``` sudo apt install adb fastboot ``` 確認版本資訊: ``` adb --version fastboot --version ``` ### 下載檔案 ## 案例: Sony Xperia XA2 ``` adb reboot bootloader ``` ``` $ fastboot devices CQ300191LQ fastboot ``` ``` $ fastboot boot twrp-3.7.0_9-0-pioneer.img Sending 'boot.img' (32464 KB) FAILED (Write to device failed (Cannot send after transport endpoint shutdown)) fastboot: error: Command failed ``` 這裡改中間改接一條 USB Hub 就可以通了 ``` adb sideload lineage-19.1-20220818-nightly-pioneer-signed.zip ``` ``` adb reboot recovery ``` - 選擇 "Apply Update" - 選擇 "Apply from ADB" - 此時會出現 "ADB Sideload" 的訊息 執行 ``` adb sideload MindTheGapps-12.1.0-arm64-20220605_112439.zip ``` 遇到 ``` Signature verification failed Install anyway? ``` 選擇 "Yes" 回到主選單 選擇 "Reboot system now" ## 案例: Google Pixel 4 ## 案例: Xiaomi Redmi 10C ``` adb sideload F-Droid.apk ``` 2022-10-13: ``` adb reboot recovery ``` 進到 recovery mode 之後 按 "Factory reset" 接著回到主選單 選 "Advanced" => "Enable ADB" 選 "Apply Update" => "Apply from ADB" ``` adb sideload MindTheGapps-12.1.0-arm64-20220605_112439.zip ``` 再按 "Reboot system now" 重開機 裝 F-Droid 先到 https://f-droid.org/ 下載 apk 然後執行 ``` adb install F-Droid.apk ``` 裝 Magisk 自 https://github.com/topjohnwu/Magisk/releases/tag/v25.2 下載 ``` adb install Magisk-v25.2.apk ``` ``` adb root adb shell ``` ``` $ adb shell fog:/ # whoami root fog:/ # ``` ``` fog:/ # ls -l /dev/block/by-name/ | grep boot lrwxrwxrwx 1 root root 16 1970-05-11 00:38 boot_a -> /dev/block/sde11 lrwxrwxrwx 1 root root 16 1970-05-11 00:38 boot_b -> /dev/block/sde33 lrwxrwxrwx 1 root root 16 1970-05-11 00:38 vendor_boot_a -> /dev/block/sde20 lrwxrwxrwx 1 root root 16 1970-05-11 00:38 vendor_boot_b -> /dev/block/sde43 fog:/ # ``` ``` dd if=/dev/block/by-name/boot_b of=/data/media/0/boot.img ``` ``` adb pull /data/media/0/boot.img ``` 進到 Magisk 程式,點選安裝 => "選擇並修補檔案" 完成後會放在 Download 目錄 ``` /data/media/0/Download/magisk_patched-25200_APUyA.img ``` 用 adb pull 下來 ``` adb pull /data/media/0/Download/magisk_patched-25200_APUyA.img adb reboot bootloader ``` ``` fastboot flash boot magisk_patched-25200_APUyA.img fastboot reboot ``` ## 實測 版本組合: | 項目 | 主系統 | Magisk | LSPosed | Shamiko | Universal SafetyNet Fix | Magisk Hide Props Config | | ---- | -------------- | ------------ | ------- | ------- | ----------------------- | ------------------------ | | (A) | LineageOS 19.1 | v25.2 zygisk | v1.8.3 | v0.5.2 | v2.3.1 | v6.1.2-v137 | 測試要點: - 將測試目標 App 加進 Magisk 的 DenyList - 重新啟動前,先清除先前的執行狀態 - 進入目標 App 的 "App info" - 按 **Force stop** 強制停止運行中的 instance - 進到 **Storage & cache** - 按 **Clear storage** - 優先通過 **SafetyNet Test** 測試 - https://play.google.com/store/apps/details?id=org.freeandroidtools.safetynettest - 通過後,再進行其他 Apps 測試 - 建議關掉 USB debugging 的功能(開發者選項) ### SafetyNet Test | 名稱 | 最新測試日期 | 測試結果 | 版本組合 | 硬體 | | -------------- | ------------ | -------- | -------- | -------------------- | | SafetyNet Test | 2022-10-24 | Passed | (A) | Sony Xperia XA2+/XA2 | ### 銀行 Apps | 名稱 | 最新測試日期 | 測試結果 | 版本組合 | 硬體 | | ------------ | ------------ | ------------------------ | -------- | --------------------- | | 玉山行動銀行 | 2022-10-23 | **Open failed** | (A) | Sony Xperia XA2/ XA2+ | | 國泰世華銀行 | 2022-10-24 | -- | (A) | Sony Xperia XA2 | | 台新銀行 | 2022-10-24 | -- | (A) | Sony Xperia XA2 | | Richart | 2022-10-24 | --(需關掉 USB debugging) | (A) | Sony Xperia XA2 | | 富邦行動銀行 | 2022-10-24 | -- | (A) | Sony Xperia XA2 | | 兆豐銀行 | 2022-10-24 | -- | (A) | Sony Xperia XA2 | | 永豐銀行 | 2022-10-24 | -- | (A) | Sony Xperia XA2 | | 將來銀行 | 2022-10-24 | -- | (A) | Sony Xperia XA2 | | 元大銀行 | 2022-10-24 | -- | (A) | Sony Xperia XA2 | | 中國信託 | 2022-10-24 | -- | (A) | Sony Xperia XA2 | | 遠東商銀 | 2022-10-24 | -- | (A) | Sony Xperia XA2 | | 彰化銀行 | 2022-10-24 | -- | (A) | Sony Xperia XA2 | | 臺灣銀行 | 2022-10-24 | -- | (A) | Sony Xperia XA2 | ### 行動支付 Apps | 名稱 | 最新測試日期 | 測試結果 | 版本組合 | 硬體 | | ------------------------ | ------------ | -------- | -------- | ---------------- | | Google Pay | 2022-10-24 | -- | (A) | Sony Xperia XA2+ | | LINE Pay | 2022-10-24 | -- | (A) | Sony Xperia XA2+ | | 台灣行動支付(Taiway Pay) | 2022-10-24 | -- | (A) | Sony Xperia XA2+ | | 中油 Pay | 2022-10-24 | -- | (A) | Sony Xperia XA2 | ### 其他 Apps | 名稱 | 最新測試日期 | 測試結果 | 版本組合 | 硬體 | | -------------------- | ------------ | -------- | -------- | ---------------- | | Easy Wallet 悠遊付 | 2022-10-24 | -- | (A) | Sony Xperia XA2+ | | 健保快易通(健康存摺) | 2022-10-24 | -- | (A) | Sony Xperia XA2+ |

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully