All Projects → joncardasis → To-The-Apples-Core

joncardasis / To-The-Apples-Core

Licence: MIT license
⚙️ A collection of non-jailbroken code snippets on reverse-engineered iOS private apis

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to To-The-Apples-Core

isJailbroken
Detect whether iOS device is jailbroken or not | Jailbreak detection for iOS
Stars: ✭ 64 (-7.25%)
Mutual labels:  jailbreak, jailbroken
hippie68.github.io
This is sleirsgoevy's PS4 jailbreak for firmware 7.02/7.5x, upgraded with additional features and more payloads.
Stars: ✭ 35 (-49.28%)
Mutual labels:  jailbreak, spoof
playground
ReScript playground
Stars: ✭ 25 (-63.77%)
Mutual labels:  playground
airboardgame
AirBoardGame is a virtual tabletop to play and create any boardgame online with your friends
Stars: ✭ 45 (-34.78%)
Mutual labels:  playground
ML-Playground
A Playground for machine learning techniques
Stars: ✭ 97 (+40.58%)
Mutual labels:  playground
iBadApple
First ever: Windows, free iCloud & activation lock bypass... that isn't a malware!
Stars: ✭ 133 (+92.75%)
Mutual labels:  jailbreak
iOS-Tweak-Dev-Tools
A collection of useful development tools and forks of tools that are geared towards iOS jailbreak developers.
Stars: ✭ 37 (-46.38%)
Mutual labels:  jailbreak
ProxySwitcher
Easily enable / disable WiFi proxy on a jailbroken iOS device
Stars: ✭ 55 (-20.29%)
Mutual labels:  jailbreak
react-playground
Xcode Playground but React.
Stars: ✭ 26 (-62.32%)
Mutual labels:  playground
try-manubot
A repository to practice contributing to a Manubot manuscript
Stars: ✭ 35 (-49.28%)
Mutual labels:  playground
allthefirmwares
Go! Get all the firmwares!
Stars: ✭ 79 (+14.49%)
Mutual labels:  jailbreak
schema.tl
📜 Easy-to-use TL-Schema viewer
Stars: ✭ 55 (-20.29%)
Mutual labels:  playground
vue-code-view
A Vue 2 component like Vue SFC REPL `@vue/repl` : u can edit, run and preview the code effect display in real time on the web page.
Stars: ✭ 67 (-2.9%)
Mutual labels:  playground
AppExplorer
⚙️ An application which showcases the use of Apple's private frameworks.
Stars: ✭ 15 (-78.26%)
Mutual labels:  ios-core
iOS-Jailbreak-Development
GeoSn0w's majestic knowledge base for iOS 12 / iOS 13 Jailbreak Development.
Stars: ✭ 55 (-20.29%)
Mutual labels:  jailbreak
GravityTagCloudView
A tag cloud view with gravity.
Stars: ✭ 22 (-68.12%)
Mutual labels:  playground
iSecureOS
An iOS Security assessment app for jailbroken iOS Devices.
Stars: ✭ 111 (+60.87%)
Mutual labels:  jailbreak
web-dojo
A dojo for JavaScript and more.
Stars: ✭ 20 (-71.01%)
Mutual labels:  playground
tokonoma
Graphics related projects/prototypes/playground (Vulkan, C++17)
Stars: ✭ 23 (-66.67%)
Mutual labels:  playground
er-console
随机打印恶搞信息
Stars: ✭ 24 (-65.22%)
Mutual labels:  spoof

Logo

To The Apple's Core serves as a house for testing the boundaries of what can be done on Native iOS without a jailbreak.

This project is for educational purposes and the code should not be used in any application targeted for the App Store.

All projects and snippits are made for and run on non-jailbroken devices. While untested, most following snippits should be able to run in Playgrounds on iPad.

Contents


🔋 Retrieve Device Battery Info

import Darwin
import Foundation

/**
 Obtains an array of dictionaries representing device battery info. Returns nil if there was an issue retrieving info from battery API.
 */
func deviceBatteryInfo() -> [[String: AnyObject]]? {
    guard case let handle = dlopen("/System/Library/PrivateFrameworks/BatteryCenter.framework/BatteryCenter", RTLD_LAZY), handle != nil,
        let c = NSClassFromString("BCBatteryDeviceController") as AnyObject as? NSObjectProtocol else {
            return nil
    }
    
    func sharedInstance() -> String { return "sharedInstance" } // Silence compiler warnings
    guard c.responds(to: Selector(sharedInstance())) == true else { return nil }
    
    let instance = c.perform(Selector(sharedInstance())).takeUnretainedValue()
    
    guard let batteries = instance.value(forKey: "connectedDevices") as? [AnyObject] else { return nil }
    
    let batteryInfo = batteries.compactMap { battery -> [String: AnyObject]? in
        var propertyCount: UInt32 = 0
        guard let properties = class_copyPropertyList(battery.classForCoder, &propertyCount) else { return nil }
        var batteryDictionary = [String: AnyObject]()
        
        for i in 0..<propertyCount {
            let cPropertyName = property_getName(properties[Int(i)])
            
            let pName = String(cString: cPropertyName)
            batteryDictionary[pName] = battery.value(forKey: pName) as AnyObject
        }
        
        free(properties) //release Obj-C property structs
        return batteryDictionary
    }
    
    return batteryInfo
}

print("Batteries' Info: \(deviceBatteryInfo())")

Retreive App Info from SpringBoard

I've created an entire project around this idea called AppExplorer. Check out the repo for more info and how you can implement it in your own project.

✈️ Check for Airplane Mode

AirplaneManager.swift
class AirplaneManager{
    
    /**
     Whether or not airplane mode is enabled. Returns nil if an error occured getting info from API.
     */
    static func isAirplaneModeEnabled() -> Bool?{
        guard case let handle = dlopen("/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport", RTLD_LAZY), handle != nil,
            let c = NSClassFromString("RadiosPreferences") as? NSObject.Type else {
                return nil
        }
        let radioPreferences = c.init()
        
        if radioPreferences.responds(to: NSSelectorFromString("airplaneMode")) {
            return (radioPreferences.value(forKey: "airplaneMode") as AnyObject).boolValue
        }
        return false
    }
}

print("Airplane Mode Enabled: \(AirplaneManager.isAirplaneModeEnabled())")

🔗 Gather Hotspot Info

MobileHotspotReader.swift

Setup

In order to use the SCDynamicStoreCreate and SCDynamicStoreCopyValue functions the __OSX_AVAILABLE_STARTING macro will need to be changed for these functions.

The easiest way to do this is ⌘ + ⌥ + CLICK on the function names in Xcode which will take you to the respective headers. Comment out the macros as seen here:

SCDynamicStoreRef __nullable SCDynamicStoreCreate (
			CFAllocatorRef __nullable allocator,
			CFStringRef name,
			SCDynamicStoreCallBack __nullable callout,
			SCDynamicStoreContext * __nullable context
			)	/*	__OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_NA)*/;
CFPropertyListRef __nullable SCDynamicStoreCopyValue(
			SCDynamicStoreRef __nullable store,
			CFStringRef key
			)	/*	__OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_NA)*/;

Example Usage

let reader = MobileHotspotReader.sharedReader
print("Connected Devices: \(reader.numberOfConnectedDevices)")
print("Connected over Bluetooth: \(reader.connectionsOverBluetooth)")

📶 Obtain Networking Info (Wifi, Tethering, Etc.)

NetworkManager.swift

This code requires no private apis, but does use hard-coded strings which may change in future OS versions.

Example Usage:

print("Wifi is Enabled     : \(NetworkManager.wifiEnabled())")
print("Wifi is Connected   : \(NetworkManager.wifiConnected())")
print("Currently Tethering : \(NetworkManager.isTethering())")

📱 Setting Lock Screen and Home Screen Images

WallpaperSetter.playground

⚠️ DEPRECATED: This snippits is deprecated due to iOS 11.0 preventing dynamic linking to the SpringBoardUI framework.

import Darwin
import UIKit

struct WallpaperLocation: OptionSet {
    let rawValue: Int
    static let lockscreen = WallpaperLocation(rawValue: 1 << 0)
    static let homescreen = WallpaperLocation(rawValue: 1 << 1)
}

func setWallpaper(image: UIImage, location: WallpaperLocation) -> Bool{
    guard case let handle = dlopen("/System/Library/PrivateFrameworks/SpringBoardUI.framework/SpringBoardUI", RTLD_LAZY), handle != nil else{
        return false
    }
    guard case let symbol = dlsym(handle, "SBSUIWallpaperSetImageAsWallpaperForLocations"), symbol != nil else{
        return false
    }
    
    typealias methodSignature = @convention(c) (AnyObject, NSInteger) -> ()
    let _ = unsafeBitCast(symbol, to: methodSignature.self)(image, location.rawValue)
    dlclose(handle)
    return true
}

setWallpaper(image, location: [.homescreen, .lockscreen])
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].