Example Usage
# copy/rename it to ig.apk
sudo cp com.instagram.android_version...apk ig.apk

# decompile the apk
sudo apktool d -r -f -o ig_plain ig.apk

# break the endpoints with script.sh
sudo chmod +x script.sh
sudo ./script.sh

# recompile the apk
sudo apktool b -r -f ig_plain

sudo cp ig_plain/dist/ig.apk patched.apk

# optimize with zipalign
sudo zipalign -v 4 patched.apk install.apk

# generate keypair (insert password 'foobar', the keygen step is required only the first time)
sudo keytool -genkeypair -alias key0 -keyalg RSA -keysize 4096 -validity 10000 -keystore patched_instagram_key.jks

# sign the apk with 'foobar' as password
sudo echo foobar | apksigner sign --ks ./patched_instagram_key.jks --v1-signing-enabled true --v2-signing-enabled true --v3-signing-enabled false install.apk