Skip to content

Commit

Permalink
Provision 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Dadoum authored Apr 23, 2023
2 parents b863447 + 649c7f6 commit 87eadc9
Show file tree
Hide file tree
Showing 18 changed files with 1,076 additions and 620 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/cmake-cross-compile.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: ARM builds

on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
on: push

env:
BUILD_TYPE: Release
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: x86_64 builds

on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
on: push

env:
BUILD_TYPE: Release
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bin/
.dub/
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake-d/cmake-d)

project(Provision D)
option(build_anisetteserver "Build Anisette server" ON)
option(build_mkcassette "Build mkcassette" OFF)
option(use_native_plist "Want dlang plist" OFF)
option(link_libplist_dynamic "Load libplist at runtime" OFF)

include(cmake/dependencies.cmake)
Expand All @@ -28,16 +30,14 @@ else()
endif()
endif()

if (plist_FOUND)
if (plist_FOUND AND NOT use_native_plist)
message("Using libplist. ")
add_library(plist ALIAS PkgConfig::plist)
target_compile_versions(provision PUBLIC LibPlist)
else()
if (build_sideloadipa)
message(FATAL_ERROR "Sideload IPA requires libplist development package. ")
endif()
message(WARNING "Using fallback Property list parser. ")

include(UseDub)
FetchContent_Declare(
plist_proj
GIT_REPOSITORY https://github.com/hatf0/plist
Expand Down Expand Up @@ -65,3 +65,13 @@ if(build_anisetteserver)

target_link_libraries(anisette_server provision handy-httpd)
endif()

if(build_mkcassette)
set(MKCASSETTE_SOURCE_DIR "mkcassette/")
file(GLOB_RECURSE MKCASSETTE_D_SOURCES "${MKCASSETTE_SOURCE_DIR}*.d")

add_executable(mkcassette ${MKCASSETTE_D_SOURCES})
target_include_directories(mkcassette PUBLIC ${MKCASSETTE_SOURCE_DIR})

target_link_libraries(mkcassette provision)
endif()
53 changes: 51 additions & 2 deletions LISEZMOI.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ les en-têtes HTTP à utiliser pour identifier l'appareil.

Plus précisément, libprovision enregistre l'appareil auprès d'apple et récupère les données ADI pour celui-ci.
Une fois connecté avec cette machine, les serveurs d'Apple se rappeleront de votre appareil comme sûre,
donc assurez vous de ne pas vous connecter n'importe où, et à conserver précieusement les données ADI à `~/.adi/adi.pb`.
donc assurez-vous de ne pas vous connecter n'importe où, et à conserver précieusement les données ADI à `~/.adi/adi.pb`.

Il y avait *sideload-ipa* aussi précédemment. Le code a été retiré, car il ne fonctionnait de toute façon pas
et que j'aide au développement de [SideServer]() (pas de lien officiel pour le moment), qui fonctionnera AltServer là
Expand All @@ -42,7 +42,7 @@ libplist.

## Compilation

Clonez le projet et compilez le avec DUB:
Clonez le projet et compilez le avec DUB :

```bash
git clone https://github.com/Dadoum/Provision --recursive
Expand All @@ -61,6 +61,55 @@ cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release
ninja
```

## Utilisation de libprovision

L'interface essaie tant bien que mal de rester proche de celle d'AuthKit, même si Provision est écrit en D.

```d
import std.digest: toHexString;
import file = std.file;
import std.path: expandTilde, buildPath;
import std.random: rndGen;
import std.range: take, array;
import std.stdio: stderr, write, writeln;
import std.uni: toUpper;
import std.uuid: randomUUID;
import provision.adi;
void main() {
string configuration_folder = expandTilde("~/.config/Provision/");
if (!file.exists(configuration_folder)) {
file.mkdir(configuration_folder);
}
ADI adi = new ADI("lib/" ~ architectureIdentifier);
adi.provisioningPath = configuration_folder;
Device device = new Device(configuration_folder.buildPath("device.json"));
if (!device.initialized) {
stderr.write("Creating machine... ");
device.serverFriendlyDescription = "<MacBookPro13,2> <macOS;13.1;22C65> <com.apple.AuthKit/1 (com.apple.dt.Xcode/3594.4.19)>";
device.uniqueDeviceIdentifier = randomUUID().toString().toUpper();
device.adiIdentifier = (cast(ubyte[]) rndGen.take(2).array()).toHexString().toLower();
device.localUserUUID = (cast(ubyte[]) rndGen.take(8).array()).toHexString().toUpper();
stderr.writeln("done !");
}
adi.identifier = device.adiIdentifier;
if (!adi.isMachineProvisioned(-2)) {
stderr.write("Machine requires provisioning... ");
ProvisioningSession provisioningSession = new ProvisioningSession(adi, device);
provisioningSession.provision(-2);
stderr.writeln("done !");
}
// Faites ce que vous voulez avec adi !
}
```

## Soutien

Vous pouvez me soutenir en faisant un don avec GitHub Sponsor.
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,55 @@ cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release
ninja
```

## libprovision usage

The Provision API tries to be stay close to the AuthKit API, but written in D.

```d
import std.digest: toHexString;
import file = std.file;
import std.path: expandTilde, buildPath;
import std.random: rndGen;
import std.range: take, array;
import std.stdio: stderr, write, writeln;
import std.uni: toUpper;
import std.uuid: randomUUID;
import provision.adi;
void main() {
string configuration_folder = expandTilde("~/.config/Provision/");
if (!file.exists(configuration_folder)) {
file.mkdir(configuration_folder);
}
ADI adi = new ADI("lib/" ~ architectureIdentifier);
adi.provisioningPath = configuration_folder;
Device device = new Device(configuration_folder.buildPath("device.json"));
if (!device.initialized) {
stderr.write("Creating machine... ");
device.serverFriendlyDescription = "<MacBookPro13,2> <macOS;13.1;22C65> <com.apple.AuthKit/1 (com.apple.dt.Xcode/3594.4.19)>";
device.uniqueDeviceIdentifier = randomUUID().toString().toUpper();
device.adiIdentifier = (cast(ubyte[]) rndGen.take(2).array()).toHexString().toLower();
device.localUserUUID = (cast(ubyte[]) rndGen.take(8).array()).toHexString().toUpper();
stderr.writeln("done !");
}
adi.identifier = device.adiIdentifier;
if (!adi.isMachineProvisioned(-2)) {
stderr.write("Machine requires provisioning... ");
ProvisioningSession provisioningSession = new ProvisioningSession(adi, device);
provisioningSession.provision(-2);
stderr.writeln("done !");
}
// Do stuff with adi.
}
```

## Support

Donations are welcome with GitHub Sponsor.
Loading

0 comments on commit 87eadc9

Please sign in to comment.