Skip to content

Instantly share code, notes, and snippets.

@eboye
Last active December 19, 2022 00:09
Show Gist options
  • Save eboye/0b9107dd0abc0edb1bce5582cfc60d85 to your computer and use it in GitHub Desktop.
Save eboye/0b9107dd0abc0edb1bce5582cfc60d85 to your computer and use it in GitHub Desktop.
Repack Binance deb as AppImage
#!/bin/sh
function readlink_file()
{
next_path=$1
while [ "$i" != 10 ] && [ "x$next_path" != "x$path" ]; do
path=$next_path
next_path=$(readlink "$path" || echo $path)
i=`expr $i + 1`
done
echo "$path"
}
function basedir()
{
file=$(readlink -f "$1") || $(readlink_file "$1")
echo $(cd "$(dirname "$file")" && pwd -P)
}
cd $(basedir "$0") && opt/Binance/binance
[Desktop Entry]
Name=Binance
Exec=binance
Icon=binance-512x512
Type=Application
Categories=Finance

get the repack.sh from this gist to some empty folder

make a Binance.AppDir folder in it copy AppRun, binance-512x512.png and Binance.desktop from this gist to Binance.AppDir folder

On line 10. edit the URL to appimagetool binary, in this case it's ~/Applications/appimagetool-x86_64.AppImage but yours may be different.

run it

sh repack.sh

It will get the latest deb from binance and create the AppImage which you can run.

#!/usr/bin/env bash
rm -rf Binance.AppDir/opt
wget https://download.binance.com/electron-desktop/linux/production/binance-amd64-linux.deb
ar vx binance-amd64-linux.deb
rm -f binance-amd64-linux.deb control.tar.gz debian-binary
mkdir Binance.AppDir
tar xvf data.tar.xz ./opt
mv opt Binance.AppDir
rm -f data.tar.xz
~/Applications/appimagetool-x86_64.AppImage Binance.AppDir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment