Skip to content

Instantly share code, notes, and snippets.

@luihum
Last active November 8, 2021 08:51
Show Gist options
  • Save luihum/ff015a7141c923c3d1f017692e2462c6 to your computer and use it in GitHub Desktop.
Save luihum/ff015a7141c923c3d1f017692e2462c6 to your computer and use it in GitHub Desktop.

ProgressArchiver95

What is this?

This is a tool for archiving the game Progressbar95. It's really just a split APK extractor, but hardcoded for a specific game.

How to use:

  • Install Termux and give it storage permission

  • Make sure you're at your Termux home: cd

  • Copy the script to your Termux home: cp /sdcard/Download/ProgressArchiver95.sh ~

  • Add execute permission: chmod +x ProgressArchiver95.sh

  • Run with ~/ProgressArchiver95.sh NOTE: needs root on Android 11 and possibly Android 10

FAQ

Q: Why do I need to use this?

A: Technically, you don't. But the commands are easy to mistype and have cryptic errors, and they're very repetitive. So I made this tool, which handles errors, adds some options, and even verifies if your device can be used for this.

Q: Is it safe?

A: It is 100% safe and virus free, I wrote it myself and you can even check the code, just cat ProgressArchiver95.sh or use your favorite text editor.

Q: I found a bug! How can I report it?

A: DM me with a screenshot of the script's output on Termux and a description of the bug.

Q: It says my phone likely runs Android 11, but it isn't 11!

A: Go to your phone's settings and open "About" or something. DM me the reported Android version and a screenshot of the script.

Q: Is UserLAnd supported?

A: No, but it might work.

Q: It says Progressbar95 is not installed, but it is!

A: Re-run the script with the -I option.

Archiving Very Old Versions (before 0.50)

This tool will not work on very old versions of the game, due to a change in how the game files were stored after 0.50. Before 0.50, all ABIs and DPIs were in one file, therefore the same APK worked on any device.

Newer versions of the game use split APKs, a feature of the Android package system that allows apps to have multiple files containing just what is needed for that device. This tool is designed for split APKs.

To archive old versions, use the following commands:

pm path com.spookyhousestudios.progressbar95
cp *.apk ~
#!/bin/bash
######################
# ProgressArchiver95 #
# by Luihum#1287 #
# Version 1.01 #
# Oct 3, 2021 #
######################
# Root is required on Android 11
# Use in Termux
# please don't complain about bad code
#
# changelog:
# 1.0 - Release - October 3, 2021
# added everything, duh
#
# 1.01 - hotfix - same day
# Within 15 minutes of release,
# the first bug was found:
# #001 options make it say "shift count out of range"
# fixed"
cat << EOF
**********************
* ProgressArchiver95 *
* by Luihum#1287 *
* Version 1.01 *
**********************
EOF
skipInstallCheck=0
__ScriptVersion="1.01"
# yay! snippets are so useful
#=== FUNCTION ================================================================
# NAME: usage
# DESCRIPTION: Display usage information.
#===============================================================================
function usage ()
{
cat <<- EOT
Usage : $0 [options] [--]
Options:
-h Display this message
-v Display script version
-I Skip install check
EOT
} # ---------- end of function usage ----------
#-----------------------------------------------------------------------
# Handle command line arguments
#-----------------------------------------------------------------------
while getopts ":hvI" opt
do
case $opt in
h) usage; exit 0 ;;
v) echo "$0 -- Version "; exit 0 ;;
I) skipInstallCheck=1;;
\? ) echo -e "\n invalid option: \n"
usage; exit 1 ;;
esac # --- end of case ---
done
if [[ $# -eq 2 ]]; then
shift $((-1))
fi
#colors!!!
NC='\033[0m' # end color
RED='\033[0;31m' # dark red
GREEN='\033[0;32m' # dark green
LGREEN='\033[1;32m' # light green
LRED="\033[1;31m" # light red
CYAN="\033[0;36m" # cyan
YELLOW="\033[1;33m" # yellow
### sanity checks
# we use set +e so a fail doesn't crash the script
set +e
# testing if on android 11
echo -n checking for package manager version...
pm path com.spookyhousestudios.progressbar95 >/dev/null 2>&1
retVal=$?
if [ $retVal -eq 2 ]; then
printf "${RED}${NC}"
echo
echo This package manager implementation uses the package service.
echo This probably means this is Android 11, which is not supported.
echo Root is required in Android 11 because of security updates.
echo Aborting.
exit $retVal
else
printf "${LGREEN}${NC}"
echo
fi
# testing if game is installed (may not always work)
echo -n checking for Progressbar95 installed...
if [[ $skipInstallCheck -eq 0 ]]; then
output=$(pm path com.spookyhousestudios.progressbar95 2>/dev/null)
retVal=$?
if [[ $retVal -eq 1 && $(echo -n $output | head -c1 | wc -c) -eq 0 ]]; then
printf "${RED}${NC}"
echo
echo It seems like Progressbar95 is not installed.
echo Please note that this check may be a bit flakey;
echo If the game is installed, but not being detected,
echo try running the script again with the -I option.
echo Aborting.
exit $retVal
else
printf "${LGREEN}${NC}"
echo
fi
else
printf "${YELLOW}skipped${NC}"
echo
fi
#tests done
set -e
#echo yay it worked now make luihum make this script actually do stuff
# base.apk is guaranteed to be there, so
# we use it as a path reference
apk_path=$(pm path com.spookyhousestudios.progressbar95 | grep base.apk | sed 's/package://' | sed 's/\/base.apk//')
echo -n searching game install path for ABIs...
[ -f $apk_path/split_config.arm64_v8a.apk ] && echo -n "ARMv8 " && abi_armv8=1
[ -f $apk_path/split_config.armeabi_v7a.apk ] && echo -n "ARMv7 " && abi_armv7=1
[ -f $apk_path/split_config.x86_64.apk ] && echo -n "x86_64 " && abi_x86_64=1
[ -f $apk_path/split_config.x86.apk ] && echo -n "x86 " && abi_x86=1
abis=$(compgen -A variable | grep abi_)
if [[ $(echo -n $abis | head -c1 | wc -c) -eq 0 ]]; then
# this should be impossible
printf "${RED}${NC}"
echo
printf "${LRED}ERROR: No ABIs found${NC}"
echo This error should never happen. Contact me on Discord.
echo If this is a version before 0.50, you can ignore this.
echo "But still, if you have before 0.50 then contact anyway."
echo Read the script file and go to the end of the file.
exit 3
fi
echo
echo -n searching game install path for DPIs...
[ -f $apk_path/split_config.ldpi.apk ] && echo -n "LDPI " && ldpi=1
[ -f $apk_path/split_config.mdpi.apk ] && echo -n "MDPI " && mdpi=1
[ -f $apk_path/split_config.hdpi.apk ] && echo -n "HDPI " && hdpi=1
[ -f $apk_path/split_config.xhdpi.apk ] && echo -n "XHDPI " && xhdpi=1
[ -f $apk_path/split_config.xxhdpi.apk ] && echo -n "XXHDPI " && xxhdpi=1
[ -f $apk_path/split_config.xxxhdpi.apk ] && echo -n "XXXHDPI " && xxxhdpi=1
[ -f $apk_path/split_config.nodpi.apk ] && echo -n "NODPI " && nodpi=1
[ -f $apk_path/split_config.tvdpi.apk ] && echo -n "TVDPI " && tvdpi=1
echo
while true; do
read -r -n 1 -p "Do you want to copy base.apk? " yn
case $yn in
[Yy]* ) copyBase=1; break;;
[Nn]* ) copyBase=0; break;;
* ) echo "Please answer yes or no.";;
esac
done
echo
while true; do
read -r -n 1 -p "Do you want to copy the DPI files? " yn
case $yn in
[Yy]* ) copyDpi=1; break;;
[Nn]* ) copyDpi=0; break;;
* ) echo; echo "Please answer yes or no.";;
esac
done
echo
read -r -p "Enter directory to extract to (default .)" copyDir
copyDir=${copyDir:-.}
[ $copyBase -eq 1 ] && echo -n copying base.apk....... && cp $apk_path/base.apk $copyDir && printf "${LGREEN}${NC}" && echo
if [ $copyDpi -eq 1 ]; then
echo -n copying DPI files......
[ $ldpi ] && cp $apk_path/split_config.ldpi.apk $copyDir
[ $mdpi ] && cp $apk_path/split_config.mdpi.apk $copyDir
[ $hdpi ] && cp $apk_path/split_config.hdpi.apk $copyDir
[ $xhdpi ] && cp $apk_path/split_config.xhdpi.apk $copyDir
[ $xxhdpi ] && cp $apk_path/split_config.xxhdpi.apk $copyDir
[ $xxxhdpi ] && cp $apk_path/split_config.xxxhdpi.apk $copyDir
[ $nodpi ] && cp $apk_path/split_config.nodpi.apk $copyDir
[ $tvdpi ] && cp $apk_path/split_config.tvdpi.apk $copyDir
printf "${LGREEN}${NC}"
echo
fi
echo -n copying ABI............
[ $abi_x86 ] && cp $apk_path/split_config.x86.apk $copyDir
[ $abi_x86_64 ] && cp $apk_path/split_config.x86_64.apk $copyDir
[ $abi_armv7 ] && cp $apk_path/split_config.armeabi_v7a.apk $copyDir
[ $abi_armv8 ] && cp $apk_path/split_config.arm64_v8a.apk $copyDir
printf "${LGREEN}${NC}"
echo
echo
printf "${CYAN}Done! The files were copied to the directory.${NC}"
echo
#[ $]
#list of split apk names:
#base.apk - shared assets, code and data
#split_config.armeabi_v7a.apk - ARMv7a ABI
#split_config.arm64_v8a.apk - ARMv8 ABI
#split_config.x86_64.apk - x86_64 ABI
#split_config.x86.apk - x86 ABI
#split_config.*dpi.apk- DPI optimized assets
#dpi ids: ldpi mdpi hdpi xhdpi xxhdpi xxxhdpi nodpi tvdpi
exit
### Archiving Very Old Versions ###
# (before 0.50)
# This tool will not work on very old versions of the game,
# due to a change in how the game files were stored after
# 0.50. Before 0.50, all ABIs and DPIs were in one file,
# therefore the same APK worked on any device.
# Newer versions of the game use split APKs, a feature of
# the Android package system that allows apps to have
# multiple files containing just what is needed for that
# device. This tool is designed for split APKs.
# To archive old versions, use the following commands:
pm path com.spookyhousestudios.progressbar95
cp *.apk ~
@HoloCraftGaming
Copy link

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment