Skip to content

Commit

Permalink
Make it work with Package.swift
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Mattiello <[email protected]>
  • Loading branch information
JoeMatt committed Sep 16, 2024
1 parent 35df4c1 commit e4ad0b9
Show file tree
Hide file tree
Showing 10 changed files with 2,025 additions and 8 deletions.
34 changes: 34 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "minimuxer",
products: [
.library(
name: "minimuxer",
targets: ["minimuxer"]),
],
targets: [
.target(
name: "minimuxer",
dependencies: ["libminimuxer"]),

.target(
name: "libminimuxer",
dependencies: ["minimuxer-binary"]
),

.binaryTarget(
name: "minimuxer-binary",
url: "https://github.com/SideStore/minimuxer/releases/download/build/minimuxer.xcframework.zip",
checksum: "0c3d526007e93e1570451473303f9d01f43d03847a986e12932de69d21cfe21a"),

.testTarget(
name: "minimuxerTests",
dependencies: ["minimuxer"]
),
],
swiftLanguageModes: [.v5]
)
164 changes: 164 additions & 0 deletions Sources/libminimuxer/SwiftBridgeCore.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
#include <stdint.h>
#include <stdbool.h>
typedef struct RustStr { uint8_t* const start; uintptr_t len; } RustStr;
typedef struct __private__FfiSlice { void* const start; uintptr_t len; } __private__FfiSlice;
void* __swift_bridge__null_pointer(void);


typedef struct __private__OptionU8 { uint8_t val; bool is_some; } __private__OptionU8;
typedef struct __private__OptionI8 { int8_t val; bool is_some; } __private__OptionI8;
typedef struct __private__OptionU16 { uint16_t val; bool is_some; } __private__OptionU16;
typedef struct __private__OptionI16 { int16_t val; bool is_some; } __private__OptionI16;
typedef struct __private__OptionU32 { uint32_t val; bool is_some; } __private__OptionU32;
typedef struct __private__OptionI32 { int32_t val; bool is_some; } __private__OptionI32;
typedef struct __private__OptionU64 { uint64_t val; bool is_some; } __private__OptionU64;
typedef struct __private__OptionI64 { int64_t val; bool is_some; } __private__OptionI64;
typedef struct __private__OptionUsize { uintptr_t val; bool is_some; } __private__OptionUsize;
typedef struct __private__OptionIsize { intptr_t val; bool is_some; } __private__OptionIsize;
typedef struct __private__OptionF32 { float val; bool is_some; } __private__OptionF32;
typedef struct __private__OptionF64 { double val; bool is_some; } __private__OptionF64;
typedef struct __private__OptionBool { bool val; bool is_some; } __private__OptionBool;

void* __swift_bridge__$Vec_u8$new();
void __swift_bridge__$Vec_u8$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_u8$len(void* const vec);
void __swift_bridge__$Vec_u8$push(void* const vec, uint8_t val);
__private__OptionU8 __swift_bridge__$Vec_u8$pop(void* const vec);
__private__OptionU8 __swift_bridge__$Vec_u8$get(void* const vec, uintptr_t index);
__private__OptionU8 __swift_bridge__$Vec_u8$get_mut(void* const vec, uintptr_t index);
uint8_t const * __swift_bridge__$Vec_u8$as_ptr(void* const vec);

void* __swift_bridge__$Vec_u16$new();
void __swift_bridge__$Vec_u16$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_u16$len(void* const vec);
void __swift_bridge__$Vec_u16$push(void* const vec, uint16_t val);
__private__OptionU16 __swift_bridge__$Vec_u16$pop(void* const vec);
__private__OptionU16 __swift_bridge__$Vec_u16$get(void* const vec, uintptr_t index);
__private__OptionU16 __swift_bridge__$Vec_u16$get_mut(void* const vec, uintptr_t index);
uint16_t const * __swift_bridge__$Vec_u16$as_ptr(void* const vec);

void* __swift_bridge__$Vec_u32$new();
void __swift_bridge__$Vec_u32$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_u32$len(void* const vec);
void __swift_bridge__$Vec_u32$push(void* const vec, uint32_t val);
__private__OptionU32 __swift_bridge__$Vec_u32$pop(void* const vec);
__private__OptionU32 __swift_bridge__$Vec_u32$get(void* const vec, uintptr_t index);
__private__OptionU32 __swift_bridge__$Vec_u32$get_mut(void* const vec, uintptr_t index);
uint32_t const * __swift_bridge__$Vec_u32$as_ptr(void* const vec);

void* __swift_bridge__$Vec_u64$new();
void __swift_bridge__$Vec_u64$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_u64$len(void* const vec);
void __swift_bridge__$Vec_u64$push(void* const vec, uint64_t val);
__private__OptionU64 __swift_bridge__$Vec_u64$pop(void* const vec);
__private__OptionU64 __swift_bridge__$Vec_u64$get(void* const vec, uintptr_t index);
__private__OptionU64 __swift_bridge__$Vec_u64$get_mut(void* const vec, uintptr_t index);
uint64_t const * __swift_bridge__$Vec_u64$as_ptr(void* const vec);

void* __swift_bridge__$Vec_usize$new();
void __swift_bridge__$Vec_usize$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_usize$len(void* const vec);
void __swift_bridge__$Vec_usize$push(void* const vec, uintptr_t val);
__private__OptionUsize __swift_bridge__$Vec_usize$pop(void* const vec);
__private__OptionUsize __swift_bridge__$Vec_usize$get(void* const vec, uintptr_t index);
__private__OptionUsize __swift_bridge__$Vec_usize$get_mut(void* const vec, uintptr_t index);
uintptr_t const * __swift_bridge__$Vec_usize$as_ptr(void* const vec);

void* __swift_bridge__$Vec_i8$new();
void __swift_bridge__$Vec_i8$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_i8$len(void* const vec);
void __swift_bridge__$Vec_i8$push(void* const vec, int8_t val);
__private__OptionI8 __swift_bridge__$Vec_i8$pop(void* const vec);
__private__OptionI8 __swift_bridge__$Vec_i8$get(void* const vec, uintptr_t index);
__private__OptionI8 __swift_bridge__$Vec_i8$get_mut(void* const vec, uintptr_t index);
int8_t const * __swift_bridge__$Vec_i8$as_ptr(void* const vec);

void* __swift_bridge__$Vec_i16$new();
void __swift_bridge__$Vec_i16$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_i16$len(void* const vec);
void __swift_bridge__$Vec_i16$push(void* const vec, int16_t val);
__private__OptionI16 __swift_bridge__$Vec_i16$pop(void* const vec);
__private__OptionI16 __swift_bridge__$Vec_i16$get(void* const vec, uintptr_t index);
__private__OptionI16 __swift_bridge__$Vec_i16$get_mut(void* const vec, uintptr_t index);
int16_t const * __swift_bridge__$Vec_i16$as_ptr(void* const vec);

void* __swift_bridge__$Vec_i32$new();
void __swift_bridge__$Vec_i32$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_i32$len(void* const vec);
void __swift_bridge__$Vec_i32$push(void* const vec, int32_t val);
__private__OptionI32 __swift_bridge__$Vec_i32$pop(void* const vec);
__private__OptionI32 __swift_bridge__$Vec_i32$get(void* const vec, uintptr_t index);
__private__OptionI32 __swift_bridge__$Vec_i32$get_mut(void* const vec, uintptr_t index);
int32_t const * __swift_bridge__$Vec_i32$as_ptr(void* const vec);

void* __swift_bridge__$Vec_i64$new();
void __swift_bridge__$Vec_i64$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_i64$len(void* const vec);
void __swift_bridge__$Vec_i64$push(void* const vec, int64_t val);
__private__OptionI64 __swift_bridge__$Vec_i64$pop(void* const vec);
__private__OptionI64 __swift_bridge__$Vec_i64$get(void* const vec, uintptr_t index);
__private__OptionI64 __swift_bridge__$Vec_i64$get_mut(void* const vec, uintptr_t index);
int64_t const * __swift_bridge__$Vec_i64$as_ptr(void* const vec);

void* __swift_bridge__$Vec_isize$new();
void __swift_bridge__$Vec_isize$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_isize$len(void* const vec);
void __swift_bridge__$Vec_isize$push(void* const vec, intptr_t val);
__private__OptionIsize __swift_bridge__$Vec_isize$pop(void* const vec);
__private__OptionIsize __swift_bridge__$Vec_isize$get(void* const vec, uintptr_t index);
__private__OptionIsize __swift_bridge__$Vec_isize$get_mut(void* const vec, uintptr_t index);
intptr_t const * __swift_bridge__$Vec_isize$as_ptr(void* const vec);

void* __swift_bridge__$Vec_bool$new();
void __swift_bridge__$Vec_bool$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_bool$len(void* const vec);
void __swift_bridge__$Vec_bool$push(void* const vec, bool val);
__private__OptionBool __swift_bridge__$Vec_bool$pop(void* const vec);
__private__OptionBool __swift_bridge__$Vec_bool$get(void* const vec, uintptr_t index);
__private__OptionBool __swift_bridge__$Vec_bool$get_mut(void* const vec, uintptr_t index);
bool const * __swift_bridge__$Vec_bool$as_ptr(void* const vec);

void* __swift_bridge__$Vec_f32$new();
void __swift_bridge__$Vec_f32$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_f32$len(void* const vec);
void __swift_bridge__$Vec_f32$push(void* const vec, float val);
__private__OptionF32 __swift_bridge__$Vec_f32$pop(void* const vec);
__private__OptionF32 __swift_bridge__$Vec_f32$get(void* const vec, uintptr_t index);
__private__OptionF32 __swift_bridge__$Vec_f32$get_mut(void* const vec, uintptr_t index);
float const * __swift_bridge__$Vec_f32$as_ptr(void* const vec);

void* __swift_bridge__$Vec_f64$new();
void __swift_bridge__$Vec_f64$_free(void* const vec);
uintptr_t __swift_bridge__$Vec_f64$len(void* const vec);
void __swift_bridge__$Vec_f64$push(void* const vec, double val);
__private__OptionF64 __swift_bridge__$Vec_f64$pop(void* const vec);
__private__OptionF64 __swift_bridge__$Vec_f64$get(void* const vec, uintptr_t index);
__private__OptionF64 __swift_bridge__$Vec_f64$get_mut(void* const vec, uintptr_t index);
double const * __swift_bridge__$Vec_f64$as_ptr(void* const vec);

#include <stdint.h>
typedef struct RustString RustString;
void __swift_bridge__$RustString$_free(void* self);

void* __swift_bridge__$Vec_RustString$new(void);
void __swift_bridge__$Vec_RustString$drop(void* vec_ptr);
void __swift_bridge__$Vec_RustString$push(void* vec_ptr, void* item_ptr);
void* __swift_bridge__$Vec_RustString$pop(void* vec_ptr);
void* __swift_bridge__$Vec_RustString$get(void* vec_ptr, uintptr_t index);
void* __swift_bridge__$Vec_RustString$get_mut(void* vec_ptr, uintptr_t index);
uintptr_t __swift_bridge__$Vec_RustString$len(void* vec_ptr);
void* __swift_bridge__$Vec_RustString$as_ptr(void* vec_ptr);

void* __swift_bridge__$RustString$new(void);
void* __swift_bridge__$RustString$new_with_str(struct RustStr str);
uintptr_t __swift_bridge__$RustString$len(void* self);
struct RustStr __swift_bridge__$RustString$as_str(void* self);
struct RustStr __swift_bridge__$RustString$trim(void* self);
bool __swift_bridge__$RustStr$partial_eq(struct RustStr lhs, struct RustStr rhs);


void __swift_bridge__$call_boxed_fn_once_no_args_no_return(void* boxed_fnonce);
void __swift_bridge__$free_boxed_fn_once_no_args_no_return(void* boxed_fnonce);


struct __private__ResultPtrAndPtr { bool is_ok; void* ok_or_err; };
6 changes: 6 additions & 0 deletions Sources/libminimuxer/include/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module libminimuxer {
header "../SwiftBridgeCore.h"
header "../minimuxer.h"

export *
}
88 changes: 88 additions & 0 deletions Sources/libminimuxer/minimuxer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// File automatically generated by swift-bridge.
#include <stdbool.h>
typedef struct __swift_bridge__$MinimuxerError$FieldOfInstallApp {void* _0;} __swift_bridge__$MinimuxerError$FieldOfInstallApp;
union __swift_bridge__$MinimuxerErrorFields { __swift_bridge__$MinimuxerError$FieldOfInstallApp InstallApp;};
typedef enum __swift_bridge__$MinimuxerErrorTag { __swift_bridge__$MinimuxerError$NoDevice, __swift_bridge__$MinimuxerError$NoConnection, __swift_bridge__$MinimuxerError$PairingFile, __swift_bridge__$MinimuxerError$CreateDebug, __swift_bridge__$MinimuxerError$CreateInstproxy, __swift_bridge__$MinimuxerError$LookupApps, __swift_bridge__$MinimuxerError$FindApp, __swift_bridge__$MinimuxerError$BundlePath, __swift_bridge__$MinimuxerError$MaxPacket, __swift_bridge__$MinimuxerError$WorkingDirectory, __swift_bridge__$MinimuxerError$Argv, __swift_bridge__$MinimuxerError$LaunchSuccess, __swift_bridge__$MinimuxerError$Detach, __swift_bridge__$MinimuxerError$Attach, __swift_bridge__$MinimuxerError$CreateAfc, __swift_bridge__$MinimuxerError$RwAfc, __swift_bridge__$MinimuxerError$InstallApp, __swift_bridge__$MinimuxerError$UninstallApp, __swift_bridge__$MinimuxerError$CreateMisagent, __swift_bridge__$MinimuxerError$ProfileInstall, __swift_bridge__$MinimuxerError$ProfileRemove, } __swift_bridge__$MinimuxerErrorTag;
typedef struct __swift_bridge__$MinimuxerError { __swift_bridge__$MinimuxerErrorTag tag; union __swift_bridge__$MinimuxerErrorFields payload;} __swift_bridge__$MinimuxerError;
typedef struct __swift_bridge__$Option$MinimuxerError { bool is_some; __swift_bridge__$MinimuxerError val; } __swift_bridge__$Option$MinimuxerError;

void* __swift_bridge__$describe_error(struct __swift_bridge__$MinimuxerError error);
bool __swift_bridge__$ready(void);
void __swift_bridge__$set_debug(bool debug);


// File automatically generated by swift-bridge.
#include <stdint.h>
typedef struct RustDirectoryEntry RustDirectoryEntry;
void __swift_bridge__$RustDirectoryEntry$_free(void* self);

void* __swift_bridge__$Vec_RustDirectoryEntry$new(void);
void __swift_bridge__$Vec_RustDirectoryEntry$drop(void* vec_ptr);
void __swift_bridge__$Vec_RustDirectoryEntry$push(void* vec_ptr, void* item_ptr);
void* __swift_bridge__$Vec_RustDirectoryEntry$pop(void* vec_ptr);
void* __swift_bridge__$Vec_RustDirectoryEntry$get(void* vec_ptr, uintptr_t index);
void* __swift_bridge__$Vec_RustDirectoryEntry$get_mut(void* vec_ptr, uintptr_t index);
uintptr_t __swift_bridge__$Vec_RustDirectoryEntry$len(void* vec_ptr);
void* __swift_bridge__$Vec_RustDirectoryEntry$as_ptr(void* vec_ptr);

typedef struct AfcFileManager AfcFileManager;
void __swift_bridge__$AfcFileManager$_free(void* self);

void* __swift_bridge__$Vec_AfcFileManager$new(void);
void __swift_bridge__$Vec_AfcFileManager$drop(void* vec_ptr);
void __swift_bridge__$Vec_AfcFileManager$push(void* vec_ptr, void* item_ptr);
void* __swift_bridge__$Vec_AfcFileManager$pop(void* vec_ptr);
void* __swift_bridge__$Vec_AfcFileManager$get(void* vec_ptr, uintptr_t index);
void* __swift_bridge__$Vec_AfcFileManager$get_mut(void* vec_ptr, uintptr_t index);
uintptr_t __swift_bridge__$Vec_AfcFileManager$len(void* vec_ptr);
void* __swift_bridge__$Vec_AfcFileManager$as_ptr(void* vec_ptr);

struct __swift_bridge__$ResultVoidAndErrors __swift_bridge__$AfcFileManager$remove(void* path);
struct __swift_bridge__$ResultVoidAndErrors __swift_bridge__$AfcFileManager$create_directory(void* path);
struct __swift_bridge__$ResultVoidAndErrors __swift_bridge__$AfcFileManager$write_file(void* to, struct __private__FfiSlice bytes);
struct __swift_bridge__$ResultVoidAndErrors __swift_bridge__$AfcFileManager$copy_file_outside_afc(void* from, void* to);
void* __swift_bridge__$AfcFileManager$contents(void);
void* __swift_bridge__$RustDirectoryEntry$path(void* self);
void* __swift_bridge__$RustDirectoryEntry$parent(void* self);
bool __swift_bridge__$RustDirectoryEntry$is_file(void* self);
struct __private__OptionU32 __swift_bridge__$RustDirectoryEntry$size(void* self);
void* __swift_bridge__$RustDirectoryEntry$children(void* self);
typedef enum __swift_bridge__$ResultVoidAndErrors$Tag {__swift_bridge__$ResultVoidAndErrors$ResultOk, __swift_bridge__$ResultVoidAndErrors$ResultErr} __swift_bridge__$ResultVoidAndErrors$Tag;
union __swift_bridge__$ResultVoidAndErrors$Fields {struct __swift_bridge__$MinimuxerError err;};
typedef struct __swift_bridge__$ResultVoidAndErrors{__swift_bridge__$ResultVoidAndErrors$Tag tag; union __swift_bridge__$ResultVoidAndErrors$Fields payload;} __swift_bridge__$ResultVoidAndErrors;


// File automatically generated by swift-bridge.
void* __swift_bridge__$fetch_udid(void);
bool __swift_bridge__$test_device_connection(void);


// File automatically generated by swift-bridge.
struct __swift_bridge__$ResultVoidAndErrors __swift_bridge__$yeet_app_afc(void* bundle_id, struct __private__FfiSlice ipa_bytes);
struct __swift_bridge__$ResultVoidAndErrors __swift_bridge__$install_ipa(void* bundle_id);
struct __swift_bridge__$ResultVoidAndErrors __swift_bridge__$remove_app(void* bundle_id);


// File automatically generated by swift-bridge.
struct __swift_bridge__$ResultVoidAndErrors __swift_bridge__$debug_app(void* app_id);
struct __swift_bridge__$ResultVoidAndErrors __swift_bridge__$attach_debugger(uint32_t pid);


// File automatically generated by swift-bridge.
void __swift_bridge__$start_auto_mounter(void* docs_path);


// File automatically generated by swift-bridge.
struct __swift_bridge__$ResultVoidAndErrors __swift_bridge__$start(void* pairing_file, void* log_path);
void __swift_bridge__$target_minimuxer_address(void);


// File automatically generated by swift-bridge.
struct __swift_bridge__$ResultVoidAndErrors __swift_bridge__$install_provisioning_profile(struct __private__FfiSlice profile);
struct __swift_bridge__$ResultVoidAndErrors __swift_bridge__$remove_provisioning_profile(void* id);
struct __swift_bridge__$ResultStringAndErrors __swift_bridge__$dump_profiles(void* docs_path);
typedef enum __swift_bridge__$ResultStringAndErrors$Tag {__swift_bridge__$ResultStringAndErrors$ResultOk, __swift_bridge__$ResultStringAndErrors$ResultErr} __swift_bridge__$ResultStringAndErrors$Tag;
union __swift_bridge__$ResultStringAndErrors$Fields {void* ok; struct __swift_bridge__$MinimuxerError err;};
typedef struct __swift_bridge__$ResultStringAndErrors{__swift_bridge__$ResultStringAndErrors$Tag tag; union __swift_bridge__$ResultStringAndErrors$Fields payload;} __swift_bridge__$ResultStringAndErrors;


Loading

0 comments on commit e4ad0b9

Please sign in to comment.