Skip to content

Instantly share code, notes, and snippets.

@jake-yeg
Last active January 7, 2019 22:07
Show Gist options
  • Save jake-yeg/cebe325bfdc52118afddb6bed87f59cc to your computer and use it in GitHub Desktop.
Save jake-yeg/cebe325bfdc52118afddb6bed87f59cc to your computer and use it in GitHub Desktop.
<?php
require_once('stripephp/init.php');
//Load up the APK's.
$files = array_diff(scandir(dirname(__FILE__) . '/apks'), array('..', '.'));
//Decompile each, and grep for sk_live
foreach($files as $file){
shell_exec('apktool d apks/' . $file . ' -o source/ -f');
preg_match('~sk_test_\w+~', shell_exec('grep -r \'sk_test\' ' . dirname(__FILE__) . '/source/'), $result);
//Should only have a single key; ignore multiples.
file_put_contents('keys.txt', $result[0] . PHP_EOL, FILE_APPEND);
}
$keys = file('keys.txt');
foreach($keys as $key){
\Stripe\Stripe::setApiKey(trim($key));
$customers = \Stripe\Customer::all();
var_dump($customers);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment