Skip to content

Instantly share code, notes, and snippets.

Martin tinue

  • Switzerland
Block or report user

Report or block tinue

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
@tinue
tinue / FCPrivateBatteryStatus.m
Created Apr 1, 2016 — forked from marcoarment/FCPrivateBatteryStatus.m
How to get raw battery info (mAh remaining, etc.) from iOS using private APIs. For internal testing only, NOT APP STORE DISTRIBUTION!
View FCPrivateBatteryStatus.m
#import <Foundation/Foundation.h>
#include <dlfcn.h>
NSDictionary *FCPrivateBatteryStatus()
{
static mach_port_t *s_kIOMasterPortDefault;
static kern_return_t (*s_IORegistryEntryCreateCFProperties)(mach_port_t entry, CFMutableDictionaryRef *properties, CFAllocatorRef allocator, UInt32 options);
static mach_port_t (*s_IOServiceGetMatchingService)(mach_port_t masterPort, CFDictionaryRef matching CF_RELEASES_ARGUMENT);
static CFMutableDictionaryRef (*s_IOServiceMatching)(const char *name);
You can’t perform that action at this time.