Skip to content

Commit

Permalink
Switch to jesec/samfirm.js
Browse files Browse the repository at this point in the history
  • Loading branch information
luk1337 committed Nov 10, 2020
1 parent b9f4d0a commit 162048e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,11 @@ jobs:
with:
submodules: true

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-setuptools
sudo pip3 install git+https://github.com/nlscc/samloader.git
- name: Compare latest version with current version
id: check
run: |
need_update=0
latest=`python3 -m samloader -m ${{ matrix.model }} -r ${{ matrix.region }} checkupdate`
latest=`curl --retry 5 --retry-delay 5 http://fota-cloud-dn.ospserver.net/firmware/${{ matrix.region }}/${{ matrix.model }}/version.xml | grep latest | sed 's/^[^>]*>//' | sed 's/<.*//'`
latest_short=`echo $latest | cut -d'/' -f1`
latest_modem=`echo $latest | cut -d'/' -f3`
current=`cat current.${{ matrix.model }}` || need_update=1
Expand All @@ -44,14 +38,19 @@ jobs:
echo ::set-output name=latest_modemversion::$latest_modem
echo ::set-output name=need_update::$need_update
- name: Use Node.js 15
if: steps.check.outputs.need_update == 1
uses: actions/setup-node@v1
with:
node-version: 15

- name: Install dependencies
if: steps.check.outputs.need_update == 1
run: sudo npm i -g samfirm

- name: Fetch firmware
if: steps.check.outputs.need_update == 1
run: |
python3 -m samloader -m ${{ matrix.model }} -r ${{ matrix.region }} download -v ${{ steps.check.outputs.latest_version }} -o fw_encrypted
python3 -m samloader -m ${{ matrix.model }} -r ${{ matrix.region }} decrypt -v ${{ steps.check.outputs.latest_version }} -V 4 -i fw_encrypted -o fw_decrypted
unzip fw_decrypted "AP_*" "BL_*"
unzip fw_decrypted "CP_*" || true
rm fw_encrypted fw_decrypted
run: samfirm -m ${{ matrix.model }} -r ${{ matrix.region }}

- name: Get path of files
if: steps.check.outputs.need_update == 1
Expand Down
2 changes: 1 addition & 1 deletion current.SM-T720
Original file line number Diff line number Diff line change
@@ -1 +1 @@
T720XXU1CTI1/T720OXM1CTI1/T720XXU1CTI1/T720XXU1CTI1
T720XXU1CTI1/T720OXM1CTI1/
2 changes: 1 addition & 1 deletion current.SM-T725
Original file line number Diff line number Diff line change
@@ -1 +1 @@
T725XXU1CTI1/T725OXM1CTI1/T725XXU1CTH3/T725XXU1CTI1
T725XXU1CTI1/T725OXM1CTI1/T725XXU1CTH3

0 comments on commit 162048e

Please sign in to comment.