Skip to content

Instantly share code, notes, and snippets.

const Long = require('long')
var tagChars = '0289PYLQGRJCUV'
module.exports = {
tag2id: (tag) => {
if (tag === undefined || typeof tag !== 'string') return false
let id = 0
let tagArray = tag.split('')
for (let a = 0; a < tagArray.length; a++) {
@aperpen
aperpen / decrypt.py
Created July 20, 2018 23:30
Decrypt Supercell Clash Royale XML files
from Crypto.Cipher import AES
import base64
import hashlib
import xml.etree.ElementTree
import sys
package_name = "com.supercell.clashroyale"
def build_storage_new_key():
@aperpen
aperpen / decrypt.js
Created March 8, 2019 17:20
Decrypt Supercell storage_new.xml files
const crypto = require('crypto')
const fs = require('fs')
// Constants
const PACKAGE_NAME = 'com.supercell.clashroyale'
const AES_MODE_CBC = 'cbc'
const AES_MODE_ECB = 'ecb'
const AES_IV_KEY = 'fldsjfodasjifudslfjdsaofshaufihadsf'
class AESCipher {