Guest User

Untitled

a guest
Jun 6th, 2020
73
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #File selection
  2.  
  3. if [ "$1" == "-h" ];then
  4.  
  5.     echo "Usage: crExtract [-n filename.apk]"
  6.  
  7.     exit
  8.  
  9.     if [ "$1" == "-n" ];then
  10.  
  11.         if [ $2 ];then
  12.  
  13.             filename=$2
  14.  
  15.         else
  16.  
  17.             echo "You need to insert a filename"
  18.  
  19.             exit
  20.  
  21.         fi
  22.  
  23.     else
  24.  
  25.         echo "Give me the clash royale filename"
  26.  
  27.         read filename
  28.  
  29.     fi
  30.  
  31.     if [ ! -f $filename ];then
  32.  
  33.         echo "File not found!"
  34.  
  35.         exit
  36.  
  37.     fi
  38.  
  39. fi
  40.  
  41. #Unzipping
  42.  
  43. echo "Unzipping crash royale apk"
  44.  
  45. unzip -o -q $filename -d "extracted"
  46.  
  47. #Decrypting
  48.  
  49. echo "Decrypting csv files"
  50.  
  51. mkdir decrypted
  52.  
  53. for path in $(find assets -name "*.csv")
  54.  
  55.     do
  56.  
  57.     f= $(echo "$path" | rev | cut -d "/" -f1 | rev)
  58.  
  59.         (
  60.  
  61.             dd if=$path bs=1 count=9 status=none
  62.  
  63.             dd if=/dev/zero bs=1 count=4 status=none
  64.  
  65.             dd if=$path bs=1 skip=9 status=none
  66.  
  67.         ) | lzma -d -f > "decrypted/" $f
  68.  
  69.     done
  70.  
  71. echo "All the decrypted file are stored in the decrypted folder"
  72.  
  73. #Delete partial files
  74.  
  75. rm -r extracted
RAW Paste Data