Last active
June 26, 2017 18:11
Revisions
-
kroo revised this gist
Apr 23, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ ## How to Use ## Open up `Terminal.app` in your `/Applications/Utilities` directory, then type in these commands, one after each other: 1. Create a temporary directory for cycript: ``` -
kroo revised this gist
Apr 23, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ ## How to Use ## Open a `Terminal.app` in your /Applications/Utilities directory, then run these commands, one after each other: 1. Create a temporary directory for cycript: ``` -
kroo revised this gist
Apr 23, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,4 +38,5 @@ Open a `Terminal.app` in your applications directory, then run these commands, o ``` sudo ./cycript -p GrowlVoice fix_growlvoice.js ``` Each time you restart GrowlVoice, you will need to run this fix script again. Run `cd ~/cycript && sudo ./cycript -p GrowlVoice fix_growlvoice.js` to run the script sometime later. -
kroo revised this gist
Apr 23, 2014 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,20 +16,26 @@ Open a `Terminal.app` in your applications directory, then run these commands, o ``` unzip cycript.zip ``` 4. Download `fix_growlvoice.js`: ``` curl https://gist.githubusercontent.com/kroo/11205755/raw/fix_growlvoice.js -o fix_growlvoice.js ``` 5. Start GrowlVoice now. ``` open -a GrowlVoice ``` 6. A popup window should appear about malformed JSON. Close it. 7. Ensure cycript is executable: ``` chmod +x ./cycript ``` 8. Patch the running GrowlVoice process: ``` sudo ./cycript -p GrowlVoice fix_growlvoice.js ```
-
kroo revised this gist
Apr 23, 2014 . 1 changed file with 35 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ ## How to Use ## Open a `Terminal.app` in your applications directory, then run these commands, one after each other: 1. Create a temporary directory for cycript: ``` mkdir cycript && cd cycript ``` 2. Pull the latest cycript from cycript.org: ``` curl -L https://cydia.saurik.com/api/latest/3 -o cycript.zip ``` 3. Unzip cycript: ``` unzip cycript.zip ``` 4. Download `fix_growlvoice.js`: ``` curl https://gist.githubusercontent.com/kroo/11205755/raw/fix_growlvoice.js -o fix_growlvoice.js ``` 5. Start GrowlVoice now. ``` open -a GrowlVoice ``` 6. A popup window should appear about malformed JSON. Close it. 7. Ensure cycript is executable: ``` chmod +x ./cycript ``` 8. Patch the running GrowlVoice process: ``` sudo ./cycript -p GrowlVoice fix_growlvoice.js ``` -
kroo revised this gist
Apr 23, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ * - Download cycript from cycript.org, and extract somewhere sane * - download this script to the same place as cycript * - Start GrowlVoice (it will complain about malformed JSON) * - Run sudo ./cycript -p GrowlVoice fix_growlvoice.js */ @import com.saurik.substrate.MS -
kroo created this gist
Apr 23, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,67 @@ /** * A quick n' dirty hack to fix a dying GrowlVoice * * GrowlVoice is now officially dead: https://twitter.com/GrowlVoice/status/455931023868448768 * However, Google didn't really shut off API access (there wasn't really any to begin with); * they slightly mangled a JSON object GrowlVoice was looking for on one of Google Voice's * internal pages. * * The following is a Cycript script that will bring a dead GrowlVoice back * to life for the moment (until Google decides to mangle things more). * * To use: * * - Download cycript from cycript.org, and extract somewhere sane * - download this script to the same place as cycript * - Start GrowlVoice (it will complain about malformed JSON) * - Run ./cycript -p GrowlVoice fix_growlvoice.js */ @import com.saurik.substrate.MS var oldm = {}, NSUTF8StringEncoding = 4, MESSAGE = @selector(accountInfoFetcher:finishedWithData:error:), START_TOKEN = 'var _gcData = ', END_TOKEN = '};'; // It's failing in accountInfoFetcher:finishedWithData:error:, a callback method // that parses a response from Google's auth page, and pulls in a bunch of info. // // Since it's failing there, let's hook it, and massage the data we're getting // back until GrowlVoice can understand it again. // // Using MobileSubstrate, the following line 'swizzles' the method, replacing // it with our own wrapper function: MS.hookMessage(GoogleVoiceLoginInterface, MESSAGE, function (fetcher, data, err) { // In particular, we need to find a json object embedded in the page that was // just returned into this function (as the second arg, data). // Convert to NSString from NSData var sdata = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; // Find the start and end of the JSON object, then split the page into 3 // sections: before the json object, after, and the object itself. This is // pretty fragile, but exactly what GrowlVoice does, so we might as well be // consistant. var startIndex = sdata.indexOf(START_TOKEN) + START_TOKEN.length; var endIndex = sdata.indexOf(END_TOKEN, startIndex) + 1; var prefix = sdata.slice(0, startIndex); var suffix = sdata.slice(endIndex); var authJSON = sdata.slice(startIndex, endIndex); // Now, fix the JSON object. This method is robust, but dangerous: // Google's new JSON encoding format only works when evaluating as a // javascript statement -- it's really not even close to valid json. // Therefore, we evaluate that line as a javascript statement, then // re-encode back to well-formed json. eval('var gcData = ' + authJSON); var fixedJSON = JSON.stringify(gcData); // reconstruct the original page, and pass back through to the original method var newdata = [(prefix + fixedJSON + suffix) dataUsingEncoding:NSUTF8StringEncoding]; oldm->call(this, fetcher, newdata, err); }, oldm); // trigger the signin process again [choose(GoogleVoiceLoginInterface)[0] signIn];