Skip to content

Instantly share code, notes, and snippets.

Enigmatic Ape enigmaticape

Block or report user

Report or block enigmaticape

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:5fc8fbba86fea7309022
Type : 8 Version : 1 Octets :
Type : 20 Version : 1 Octets :
Type : 1 Version : 1 Octets : 0
Type : 11 Version : 1 Octets : 0
Type : 14 Version : 1 Octets : 82
Type : 15 Version : 1 Octets : 0
Type : 16 Version : 1 Octets : 0
Type : 25 Version : 1 Octets : 3
Type : 10 Version : 1 Octets : 4+
Type : 3 Version : 1 Octets : 1.2
@enigmaticape
enigmaticape / gist:26fb131f7379a20c7718
Created May 22, 2014
Quick, dirty and really painfully ugly way to parse the data fields out of an app store receipt.
View gist:26fb131f7379a20c7718
#import <Foundation/Foundation.h>
typedef struct _ASNObject {
NSInteger index;
uint8_t type;
NSUInteger datap;
NSUInteger length;
NSUInteger next;
} ASNObject;
View gist:3b8426bed90a9735740f
{
environment = Sandbox;
receipt = {
"adam_id" = 0;
"application_version" = "1.2";
"bundle_id" = "com.enigmaticape.Phoreal";
"download_id" = 0;
"in_app" = (
);
"original_application_version" = "1.0";
View gist:36ba91e7be9d48a80035
- (id) parseReceiptData:(NSData *)receipt_data OnAppStoreUsingURL:(NSURL *) store_URL {
NSDictionary * request_contents = @{
@"receipt-data" : [receipt_data base64EncodedStringWithOptions:0]
};
NSError * error = nil;
NSData * request_data = (
[NSJSONSerialization
View gist:0946e5d490a1a85a9e33
SMTWiFiStatus * wstatus = [SMTWiFiStatus new];
NSLog(@"Wifi Enabled : %@", [wstatus isWiFiEnabled ] ? @"Yes" : @"No");
NSLog(@"Wifi Connected : %@", [wstatus isWiFiConnected] ? @"Yes" : @"No");
NSLog(@"Wifi BSSID : %@", [wstatus BSSID]);
NSLog(@"Wifi SSID : %@", [wstatus SSID ]);
View gist:4e8d467571680a3bf774
#import <Foundation/Foundation.h>
#import <ifaddrs.h>
#import <net/if.h>
#import <SystemConfiguration/CaptiveNetwork.h>
@interface SMTWiFiStatus : NSObject
- (BOOL) isWiFiEnabled;
- (BOOL) isWiFiConnected;
View oneweirdtrick-wi-fi.on.connected
Name : lo0, sa_family : 18
Name : lo0, sa_family : 30
Name : lo0, sa_family : 2
Name : lo0, sa_family : 30
Name : pdp_ip0, sa_family : 18
Name : pdp_ip0, sa_family : 2
Name : en0, sa_family : 18
Name : en0, sa_family : 30
Name : en0, sa_family : 2
Name : awdl0, sa_family : 18
View oneweirdtrick-wi-fi.on.not.connected
Name : lo0, sa_family : 18
Name : lo0, sa_family : 30
Name : lo0, sa_family : 2
Name : lo0, sa_family : 30
Name : pdp_ip0, sa_family : 18
Name : pdp_ip0, sa_family : 2
Name : en0, sa_family : 18
Name : awdl0, sa_family : 18
Name : awdl0, sa_family : 30
View onewierdtrick-wi-fi.off
Name : lo0, sa_family : 18
Name : lo0, sa_family : 30
Name : lo0, sa_family : 2
Name : lo0, sa_family : 30
Name : pdp_ip0, sa_family : 18
Name : pdp_ip0, sa_family : 2
Name : en0, sa_family : 18
Name : awdl0, sa_family : 18
@enigmaticape
enigmaticape / oneweirdtrick.c
Created May 21, 2014
Determine if Wi-Fi is enabled on iOS with this one weird trick.
View oneweirdtrick.c
struct ifaddrs *interfaces;
if(!getifaddrs(&interfaces)) {
for( struct ifaddrs *interface = interfaces; interface; interface=interface->ifa_next) {
BOOL up = (interface->ifa_flags & IFF_UP) == IFF_UP;
if ( up ) {
NSLog(
@"Name : %s, sa_family : %d",
interface->ifa_name,
interface->ifa_addr->sa_family
You can’t perform that action at this time.