├── .gitignore ├── tweak-fix-bind-loss ├── control │ ├── postinst │ ├── prerm │ └── control └── data │ └── opt │ ├── etc │ └── dinit.d │ │ └── tweak-fix-bind-loss │ └── bin │ └── wtfos-fix-bind-loss ├── tweak-prevent-force-upgrade ├── control │ ├── postinst │ ├── prerm │ └── control └── data │ ├── opt │ ├── etc │ │ └── dinit.d │ │ │ └── tweak-prevent-force-upgrade │ └── bin │ │ └── wtfos-remove-force-upgrade │ └── blackbox │ └── upgrade │ └── backup │ └── gl170 │ └── gl170.cfg.sig ├── README.md ├── make-packages.sh ├── LICENSE └── .github └── workflows └── build.yml /.gitignore: -------------------------------------------------------------------------------- 1 | *.ipk 2 | */ipk 3 | setup-payload.tgz 4 | -------------------------------------------------------------------------------- /tweak-fix-bind-loss/control/postinst: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | /opt/sbin/dinitctl -u enable tweak-fix-bind-loss || true -------------------------------------------------------------------------------- /tweak-fix-bind-loss/control/prerm: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | /opt/sbin/dinitctl -u disable tweak-fix-bind-loss || true -------------------------------------------------------------------------------- /tweak-fix-bind-loss/data/opt/etc/dinit.d/tweak-fix-bind-loss: -------------------------------------------------------------------------------- 1 | type = scripted 2 | command = /opt/bin/wtfos-fix-bind-loss -------------------------------------------------------------------------------- /tweak-prevent-force-upgrade/control/postinst: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | /opt/sbin/dinitctl -u enable tweak-fix-bind-loss || true -------------------------------------------------------------------------------- /tweak-prevent-force-upgrade/control/prerm: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | /opt/sbin/dinitctl -u disable tweak-prevent-force-upgrade || true -------------------------------------------------------------------------------- /tweak-prevent-force-upgrade/data/opt/etc/dinit.d/tweak-prevent-force-upgrade: -------------------------------------------------------------------------------- 1 | type = scripted 2 | command = /opt/bin/wtfos-remove-force-upgrade -------------------------------------------------------------------------------- /tweak-prevent-force-upgrade/data/opt/bin/wtfos-remove-force-upgrade: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | setprop dji.prop.enforce_upgrade 0 3 | rm -f /cache/force_upgrade 4 | -------------------------------------------------------------------------------- /tweak-prevent-force-upgrade/data/blackbox/upgrade/backup/gl170/gl170.cfg.sig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fpv-wtf/wtfos-tweaks/HEAD/tweak-prevent-force-upgrade/data/blackbox/upgrade/backup/gl170/gl170.cfg.sig -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # wtfos-tweaks 2 | Various tweaks for OS behavior on DJI FPV devices 3 | 4 | ## tweak-prevent-force-upgrade 5 | Automatically removes forced upgrade flags during boot for safety and lies to Assistant and Fly App on gl170 about installed FW version. -------------------------------------------------------------------------------- /tweak-fix-bind-loss/data/opt/bin/wtfos-fix-bind-loss: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | if [ "$(unrd product_type)" == "wm150_gls" ] && [ "$(busybox devmem 0x0B52A004 32)" == "0x00000001" ]; then 4 | busybox devmem 0x0B52A004 32 $(busybox devmem 0x0B52A000 32) 5 | busybox devmem 0x0B52A00C 32 $(busybox devmem 0x0B52A000 32) 6 | modem_info.sh reboot 7 | fi -------------------------------------------------------------------------------- /tweak-prevent-force-upgrade/control/control: -------------------------------------------------------------------------------- 1 | Package: tweak-prevent-force-upgrade 2 | Version: 0.9.3 3 | Maintainer: Joonas Trussmann joonas@batman.ee 4 | Description: Prevents accidental force upgrades on Goggles v2 by connecting to Fly App in DJI FPV Drone mode. 5 | Architecture: pigeon-glasses-v2 6 | Homepage: https://github.com/fpv-wtf/wtfos-tweaks 7 | Depends: dinit 8 | -------------------------------------------------------------------------------- /tweak-fix-bind-loss/control/control: -------------------------------------------------------------------------------- 1 | Package: tweak-fix-bind-loss 2 | Version: 0.1.0 3 | Maintainer: Joonas Trussmann joonas@batman.ee 4 | Description: Fixes binding loss for AU/Vista when switching from FPV/Avata/O3 mode to DIY mode. Does not currently work the other way around. The glass is half full. 5 | Architecture: pigeon-glasses-v2 6 | Homepage: https://github.com/fpv-wtf/wtfos-tweaks 7 | Depends: dinit 8 | -------------------------------------------------------------------------------- /make-packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | for dir in *; do 4 | if [ -f "$dir/control/control" ]; then 5 | cd $dir 6 | NAME=$(cat ./control/control | grep Package | cut -d" " -f2) 7 | ARCH=$(cat ./control/control | grep Architecture | cut -d" " -f2) 8 | VERSION=$(cat ./control/control | grep Version | cut -d" " -f2) 9 | IPK_NAME="${NAME}_${VERSION}_${ARCH}.ipk" 10 | 11 | mkdir -p data 12 | 13 | rm -rf ipk 14 | rm -rf $IPK_NAME 15 | 16 | mkdir ipk 17 | 18 | echo "2.0" > ipk/debian-binary 19 | 20 | cd control 21 | tar --owner=0 --group=0 -czvf ../ipk/control.tar.gz . 22 | cd .. 23 | 24 | cd data 25 | tar --owner=0 --group=0 -czvf ../ipk/data.tar.gz . 26 | cd .. 27 | 28 | cd ipk 29 | tar --owner=0 --group=0 -czvf "../../${IPK_NAME}" ./control.tar.gz ./data.tar.gz ./debian-binary 30 | cd .. 31 | cd .. 32 | fi 33 | done -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 fpv.wtf 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | on: 2 | # Triggers the workflow on push or pull request events but only for the main branch 3 | push: 4 | branches: [ main ] 5 | tags: 6 | - '*' 7 | 8 | # pull_request: 9 | # branches: [ main ] 10 | 11 | # Allows you to run this workflow manually from the Actions tab 12 | workflow_dispatch: 13 | 14 | jobs: 15 | release: 16 | name: Create new releas and attach IPKs and setup payload 17 | runs-on: ubuntu-latest 18 | permissions: 19 | contents: write 20 | needs: build 21 | steps: 22 | - name: Branch name 23 | id: branch_name 24 | run: | 25 | echo ::set-output name=IS_TAG::${{ startsWith(github.ref, 'refs/tags/') }} 26 | echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} 27 | echo ::set-output name=RELEASE_VERSION::${GITHUB_REF#refs/*/} 28 | 29 | - name: Download artifact 30 | env: 31 | IS_TAG: ${{ steps.branch_name.outputs.IS_TAG }} 32 | SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} 33 | if: "${{ env.IS_TAG == 'true' }}" 34 | uses: actions/download-artifact@v2 35 | with: 36 | name: ${{ env.ARTIFACT_NAME }} 37 | 38 | - name: View content 39 | env: 40 | IS_TAG: ${{ steps.branch_name.outputs.IS_TAG }} 41 | SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} 42 | if: "${{ env.IS_TAG == 'true' }}" 43 | run: ls -R 44 | 45 | - name: Create tagged release 46 | id: create_release 47 | env: 48 | IS_TAG: ${{ steps.branch_name.outputs.IS_TAG }} 49 | SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} 50 | if: "${{ env.IS_TAG == 'true' }}" 51 | uses: ncipollo/release-action@v1 52 | with: 53 | tag: ${{ env.SOURCE_TAG }} 54 | name: ${{ env.SOURCE_TAG }} 55 | token: ${{ secrets.GITHUB_TOKEN }} 56 | prerelease: false 57 | artifacts: "./*/*.ipk" 58 | 59 | build: 60 | name: Build .ipk packages 61 | runs-on: ubuntu-latest 62 | 63 | steps: 64 | - name: Checkout Code 65 | uses: actions/checkout@v2 66 | 67 | - name: Get GitHub Build Number (ENV) 68 | id: get_buildno 69 | run: echo "GITHUBBUILDNUMBER=${{ github.run_number }}" >> $GITHUB_ENV 70 | continue-on-error: true 71 | 72 | - name: Get repository name 73 | run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | cut -d '/' -f2)" >> $GITHUB_ENV 74 | shell: bash 75 | 76 | - name: Make artifact name 77 | id: make_artifactname 78 | run: | 79 | ARTIFACT_NAME="${{ env.REPOSITORY_NAME }}-${{ github.run_number }}" 80 | echo "${ARTIFACT_NAME}" 81 | echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV 82 | 83 | - name: Build ipk packages 84 | run: ./make-packages.sh 85 | 86 | 87 | - name: Upload release artifacts 88 | uses: actions/upload-artifact@v2 89 | with: 90 | name: ${{ env.ARTIFACT_NAME }} 91 | path: | 92 | ./*.ipk 93 | --------------------------------------------------------------------------------