diff --git a/App/Audio/FFSource.swift b/App/Audio/FFSource.swift index 66ca984..88980a2 100644 --- a/App/Audio/FFSource.swift +++ b/App/Audio/FFSource.swift @@ -1,17 +1,36 @@ import AVFoundation /// Decoder for formats Apple doesn't handle (Ogg Vorbis/Opus, WMA, APE, WavPack, Musepack, DSD, trackers…). -/// Backed by FFmpeg when the build links it (MULBERRY_FFMPEG); otherwise nothing opens. +/// Backed by FFmpeg (Native/ffdecode.c) when the build links it (MULBERRY_FFMPEG); otherwise nothing opens. final class FFSource: AudioSource { - static func open(_ url: URL) -> FFSource? { - #if MULBERRY_FFMPEG - return FFSource(url: url) - #else - return nil - #endif + #if MULBERRY_FFMPEG + private let d: OpaquePointer + let frames: AVAudioFramePosition + + private init(_ d: OpaquePointer) { + self.d = d + frames = AVAudioFramePosition(ff_frames(d)) } + deinit { ff_close(d) } + + static func open(_ url: URL) -> FFSource? { + guard let d = ff_open(url.path) else { return nil } + return FFSource(d) + } + + func read(into buffer: AVAudioPCMBuffer) -> Bool { + guard let ch = buffer.floatChannelData else { return false } + let n = ff_read(d, ch[0], ch[1], Int32(buffer.frameCapacity)) + buffer.frameLength = AVAudioFrameCount(max(0, n)) + return n > 0 + } + + func seek(to frame: AVAudioFramePosition) { ff_seek(d, Int64(frame)) } + #else + static func open(_ url: URL) -> FFSource? { nil } var frames: AVAudioFramePosition { 0 } func read(into buffer: AVAudioPCMBuffer) -> Bool { false } func seek(to frame: AVAudioFramePosition) {} + #endif } diff --git a/App/UI/Editors.swift b/App/UI/Editors.swift index 0bb3963..ee80f74 100644 --- a/App/UI/Editors.swift +++ b/App/UI/Editors.swift @@ -1,5 +1,6 @@ import SwiftUI import PhotosUI +import _PhotosUI_SwiftUI /// Tag editor for one or many songs (Android TagEditorActivity). Fields that differ across a selection /// show "Keep" and are left alone unless edited. @@ -30,39 +31,9 @@ struct TagEditorView: View { let p = theme.palette NavigationStack { Form { - Section { - HStack(spacing: 16) { - Group { - if let coverPreview { Image(uiImage: coverPreview).resizable().scaledToFill() } - else if cover == .some(nil) { p.cSurfaceHighest.overlay(Image(systemName: "photo.badge.minus")) } - else { CoverThumb(song: songs.first, size: 96, radius: 16) } - } - .frame(width: 96, height: 96) - .clipShape(RoundedRectangle(cornerRadius: 16, style: .continuous)) - VStack(alignment: .leading, spacing: 10) { - PhotosPicker(selection: $photo, matching: .images) { Label("Choose image", systemImage: "photo") } - Button { lookup = true } label: { Label("Search online", systemImage: "magnifyingglass") } - Button(role: .destructive) { cover = .some(nil); coverPreview = nil } label: { Label("Remove cover", systemImage: "trash") } - } - .font(.system(size: 15)) - } - .listRowBackground(p.cSurfaceC) - } + coverSection Section(songs.count == 1 ? songs[0].fileName : "\(songs.count) songs") { - ForEach($fields) { $f in - VStack(alignment: .leading, spacing: 4) { - Text(f.label).font(.system(size: 12, weight: .medium)).foregroundColor(p.cPrimary) - if f.multiline { - TextEditor(text: Binding(get: { f.value }, set: { f.value = $0; f.touched = true })) - .frame(minHeight: 120) - .scrollContentBackground(.hidden) - } else { - TextField(f.mixed && !f.touched ? "Keep (different values)" : "", text: Binding(get: { f.value }, set: { f.value = $0; f.touched = true })) - .keyboardType(["year", "track", "disc"].contains(f.id) ? .numbersAndPunctuation : .default) - } - } - .listRowBackground(p.cSurfaceC) - } + ForEach($fields) { $f in fieldRow($f) } } if let error { Section { Text(error).foregroundColor(Color(rgb: p.error)) }.listRowBackground(p.cSurfaceC) @@ -101,6 +72,51 @@ struct TagEditorView: View { } } + private var coverSection: some View { + let p = theme.palette + return Section { + HStack(spacing: 16) { + coverImage + .frame(width: 96, height: 96) + .clipShape(RoundedRectangle(cornerRadius: 16, style: .continuous)) + VStack(alignment: .leading, spacing: 10) { + PhotosPicker(selection: $photo, matching: .images) { Label("Choose image", systemImage: "photo") } + Button { lookup = true } label: { Label("Search online", systemImage: "magnifyingglass") } + Button(role: .destructive) { cover = .some(nil); coverPreview = nil } label: { Label("Remove cover", systemImage: "trash") } + } + .font(.system(size: 15)) + } + .listRowBackground(p.cSurfaceC) + } + } + + @ViewBuilder private var coverImage: some View { + if let coverPreview { + Image(uiImage: coverPreview).resizable().scaledToFill() + } else if case .some(.none) = cover { + theme.palette.cSurfaceHighest.overlay(Image(systemName: "photo.badge.minus")) + } else { + CoverThumb(song: songs.first, size: 96, radius: 16) + } + } + + private func fieldRow(_ f: Binding) -> some View { + let p = theme.palette + let field = f.wrappedValue + let text = Binding(get: { f.wrappedValue.value }, set: { f.wrappedValue.value = $0; f.wrappedValue.touched = true }) + let numeric = ["year", "track", "disc"].contains(field.id) + let hint = field.mixed && !field.touched ? "Keep (different values)" : "" + return VStack(alignment: .leading, spacing: 4) { + Text(field.label).font(.system(size: 12, weight: .medium)).foregroundColor(p.cPrimary) + if field.multiline { + TextEditor(text: text).frame(minHeight: 120).scrollContentBackground(.hidden) + } else { + TextField(hint, text: text).keyboardType(numeric ? .numbersAndPunctuation : .default) + } + } + .listRowBackground(p.cSurfaceC) + } + private func load() { func common(_ f: (Song) -> String) -> (String, Bool) { let vals = Set(songs.map(f)) diff --git a/Native/build-ffmpeg.sh b/Native/build-ffmpeg.sh new file mode 100755 index 0000000..aafd79d --- /dev/null +++ b/Native/build-ffmpeg.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Cross-builds an audio-only FFmpeg (static libs) for iOS arm64 with the swift.org toolchain's clang. +# Output: Native/ffmpeg/{include,lib}. Run once; build.sh links it when present. +set -euo pipefail +cd "$(dirname "$0")" + +SRC=${FFMPEG_SRC:-$HOME/.local/opt/dl/ffmpeg/ffmpeg-7.1.1} +TC=${SWIFT:-$HOME/.local/opt/swift/usr/bin} +SDK=${SDK:-$HOME/.local/opt/dl/sdk18/iPhoneOS18.6.sdk} +PREFIX=$PWD/ffmpeg +PHONE_LD=$(cd .. && pwd)/tools/phone-ld +WORK=$PWD/../build/ffmpeg-obj +mkdir -p "$WORK" +cd "$WORK" + +CC="$TC/clang -target arm64-apple-ios17.0 -isysroot $SDK" + +decoders=(mp3 mp3float mp2 mp2float mp1 aac aac_latm ac3 eac3 alac flac vorbis opus wmav1 wmav2 wmapro wmalossless + wmavoice ape wavpack mpc7 mpc8 tta tak shorten als truehd mlp dca atrac3 atrac3p cook ra_144 ra_288 + dsd_lsbf dsd_msbf dsd_lsbf_planar dsd_msbf_planar amrnb amrwb gsm gsm_ms speex qdm2 qdmc nellymoser + adpcm_ima_wav adpcm_ms 'pcm_*') +demuxers=(ogg matroska webm_dash_manifest asf asf_o ape wv mpc mpc8 tta tak shorten dsf iff aiff wav w64 mp3 aac + ac3 eac3 flac mov amr caf truehd mlp dts xwma rm voc au sox) +parsers=(mpegaudio aac aac_latm ac3 flac vorbis opus dca mlp tak gsm amr) + +join() { local IFS=,; echo "$*"; } + +"$SRC/configure" \ + --prefix="$PREFIX" \ + --enable-cross-compile --target-os=darwin --arch=aarch64 \ + --cc="$CC" --ld="$PHONE_LD" \ + --ar="$TC/llvm-ar" --ranlib="$TC/llvm-ranlib" --nm="nm" --strip=true \ + --extra-cflags="-mios-version-min=17.0 -fno-stack-check" \ + --extra-ldflags="-mios-version-min=17.0" \ + --disable-everything --disable-programs --disable-doc --disable-debug \ + --disable-avdevice --disable-avfilter --disable-swscale --disable-network \ + --disable-autodetect --enable-pic --enable-static --disable-shared \ + --enable-avformat --enable-avcodec --enable-swresample \ + --enable-protocol=file \ + --enable-decoder="$(join "${decoders[@]}")" \ + --enable-demuxer="$(join "${demuxers[@]}")" \ + --enable-parser="$(join "${parsers[@]}")" + +# configure finds the symbol prefix with nm, and GNU nm can't read Mach-O: Darwin uses "_". +sed -i -e 's/^#define EXTERN_PREFIX ""/#define EXTERN_PREFIX "_"/' -e 's/^#define EXTERN_ASM *$/#define EXTERN_ASM _/' config.h +grep -q 'EXTERN_PREFIX "_"' config.h + +make -j"${JOBS:-3}" +make install +ls -la "$PREFIX/lib" diff --git a/Native/compat.c b/Native/compat.c new file mode 100644 index 0000000..6f0db64 --- /dev/null +++ b/Native/compat.c @@ -0,0 +1,31 @@ +// Runtime helpers that Xcode's compiler-rt normally provides (absent from the Linux toolchain). +#include +#include +#include + +static int32_t os_major = -1, os_minor, os_patch; + +static void load_version(void) { + char buf[32] = {0}; + size_t n = sizeof buf - 1; + os_major = 0; + if (sysctlbyname("kern.osproductversion", buf, &n, NULL, 0) != 0) return; + char *p = buf; + os_major = (int32_t)strtol(p, &p, 10); + if (*p == '.') os_minor = (int32_t)strtol(p + 1, &p, 10); + if (*p == '.') os_patch = (int32_t)strtol(p + 1, &p, 10); +} + +/// Backs `if #available(...)` / `@available` checks. Platform is ignored: this binary only runs on iOS. +int32_t __isPlatformVersionAtLeast(uint32_t platform, uint32_t major, uint32_t minor, uint32_t subminor) { + (void)platform; + if (os_major < 0) load_version(); + if (os_major != (int32_t)major) return os_major > (int32_t)major; + if (os_minor != (int32_t)minor) return os_minor > (int32_t)minor; + return os_patch >= (int32_t)subminor; +} + +/// Older form used by `__builtin_available` in C. +int32_t __isOSVersionAtLeast(int32_t major, int32_t minor, int32_t subminor) { + return __isPlatformVersionAtLeast(2, (uint32_t)major, (uint32_t)minor, (uint32_t)subminor); +} diff --git a/Native/ffdecode.c b/Native/ffdecode.c new file mode 100644 index 0000000..e974c96 --- /dev/null +++ b/Native/ffdecode.c @@ -0,0 +1,187 @@ +#include "ffdecode.h" +#include +#include +#include +#include +#include +#include +#include + +#define OUT_RATE 48000 + +struct ff_dec { + AVFormatContext *fmt; + AVCodecContext *codec; + SwrContext *swr; + AVPacket *pkt; + AVFrame *frame; + int stream; + int eof; + /* converted samples not yet handed out */ + float *bufL, *bufR; + int bufLen, bufPos, bufCap; + /* frames to drop after a seek so we land exactly */ + int64_t skip; +}; + +static int setup_swr(ff_dec *d) { + AVChannelLayout out = AV_CHANNEL_LAYOUT_STEREO; + if (d->swr) swr_free(&d->swr); + AVChannelLayout in; + if (d->codec->ch_layout.nb_channels > 0) av_channel_layout_copy(&in, &d->codec->ch_layout); + else av_channel_layout_default(&in, 2); + int r = swr_alloc_set_opts2(&d->swr, &out, AV_SAMPLE_FMT_FLTP, OUT_RATE, + &in, d->codec->sample_fmt, d->codec->sample_rate, 0, NULL); + av_channel_layout_uninit(&in); + if (r < 0) return r; + return swr_init(d->swr); +} + +ff_dec *ff_open(const char *path) { + ff_dec *d = calloc(1, sizeof *d); + if (!d) return NULL; + if (avformat_open_input(&d->fmt, path, NULL, NULL) < 0) goto fail; + if (avformat_find_stream_info(d->fmt, NULL) < 0) goto fail; + const AVCodec *dec = NULL; + d->stream = av_find_best_stream(d->fmt, AVMEDIA_TYPE_AUDIO, -1, -1, &dec, 0); + if (d->stream < 0 || !dec) goto fail; + d->codec = avcodec_alloc_context3(dec); + if (!d->codec) goto fail; + if (avcodec_parameters_to_context(d->codec, d->fmt->streams[d->stream]->codecpar) < 0) goto fail; + if (avcodec_open2(d->codec, dec, NULL) < 0) goto fail; + if (setup_swr(d) < 0) goto fail; + d->pkt = av_packet_alloc(); + d->frame = av_frame_alloc(); + if (!d->pkt || !d->frame) goto fail; + for (unsigned i = 0; i < d->fmt->nb_streams; i++) + if ((int)i != d->stream) d->fmt->streams[i]->discard = AVDISCARD_ALL; + return d; +fail: + ff_close(d); + return NULL; +} + +int64_t ff_frames(ff_dec *d) { + AVStream *st = d->fmt->streams[d->stream]; + if (st->duration > 0 && st->time_base.den) + return av_rescale_q(st->duration, st->time_base, (AVRational){1, OUT_RATE}); + if (d->fmt->duration > 0) return av_rescale(d->fmt->duration, OUT_RATE, AV_TIME_BASE); + return 0; +} + +static int ensure_cap(ff_dec *d, int n) { + if (n <= d->bufCap) return 0; + float *l = realloc(d->bufL, sizeof(float) * n); + if (!l) return -1; + d->bufL = l; + float *r = realloc(d->bufR, sizeof(float) * n); + if (!r) return -1; + d->bufR = r; + d->bufCap = n; + return 0; +} + +/* Decodes the next chunk into the internal buffer. Returns >0 frames, 0 at EOF, <0 on error. */ +static int refill(ff_dec *d) { + for (;;) { + int r = avcodec_receive_frame(d->codec, d->frame); + if (r == 0) { + if (d->frame->sample_rate != d->codec->sample_rate || + av_channel_layout_compare(&d->frame->ch_layout, &d->codec->ch_layout)) { + d->codec->sample_rate = d->frame->sample_rate; + av_channel_layout_uninit(&d->codec->ch_layout); + av_channel_layout_copy(&d->codec->ch_layout, &d->frame->ch_layout); + d->codec->sample_fmt = d->frame->format; + if (setup_swr(d) < 0) return -1; + } + int want = swr_get_out_samples(d->swr, d->frame->nb_samples); + if (ensure_cap(d, want + 64) < 0) return -1; + uint8_t *out[2] = {(uint8_t *)d->bufL, (uint8_t *)d->bufR}; + int n = swr_convert(d->swr, out, d->bufCap, (const uint8_t **)d->frame->extended_data, d->frame->nb_samples); + av_frame_unref(d->frame); + if (n < 0) return n; + d->bufLen = n; d->bufPos = 0; + if (n > 0) return n; + continue; + } + if (r == AVERROR_EOF) { + /* flush the resampler tail */ + if (ensure_cap(d, 4096) < 0) return -1; + uint8_t *out[2] = {(uint8_t *)d->bufL, (uint8_t *)d->bufR}; + int n = swr_convert(d->swr, out, d->bufCap, NULL, 0); + d->bufLen = n > 0 ? n : 0; d->bufPos = 0; + return d->bufLen; + } + if (r != AVERROR(EAGAIN)) return r; + if (d->eof) { avcodec_send_packet(d->codec, NULL); continue; } + r = av_read_frame(d->fmt, d->pkt); + if (r < 0) { + d->eof = 1; + avcodec_send_packet(d->codec, NULL); + continue; + } + if (d->pkt->stream_index == d->stream) avcodec_send_packet(d->codec, d->pkt); + av_packet_unref(d->pkt); + } +} + +int ff_read(ff_dec *d, float *left, float *right, int max) { + int done = 0; + while (done < max) { + if (d->bufPos >= d->bufLen) { + int r = refill(d); + if (r < 0) return done > 0 ? done : r; + if (r == 0) break; + } + int avail = d->bufLen - d->bufPos; + if (d->skip > 0) { + int drop = avail < d->skip ? avail : (int)d->skip; + d->bufPos += drop; d->skip -= drop; + continue; + } + int n = avail < max - done ? avail : max - done; + memcpy(left + done, d->bufL + d->bufPos, sizeof(float) * n); + memcpy(right + done, d->bufR + d->bufPos, sizeof(float) * n); + d->bufPos += n; done += n; + } + return done; +} + +void ff_seek(ff_dec *d, int64_t frame) { + AVStream *st = d->fmt->streams[d->stream]; + int64_t ts = av_rescale_q(frame, (AVRational){1, OUT_RATE}, st->time_base); + if (st->start_time != AV_NOPTS_VALUE) ts += st->start_time; + if (av_seek_frame(d->fmt, d->stream, ts, AVSEEK_FLAG_BACKWARD) < 0) + av_seek_frame(d->fmt, -1, av_rescale(frame, AV_TIME_BASE, OUT_RATE), AVSEEK_FLAG_BACKWARD); + avcodec_flush_buffers(d->codec); + setup_swr(d); + d->eof = 0; + d->bufLen = d->bufPos = 0; + /* Decode forward to the exact frame: find where we landed from the first packet's pts. */ + d->skip = 0; + for (;;) { + int r = av_read_frame(d->fmt, d->pkt); + if (r < 0) { d->eof = 1; break; } + if (d->pkt->stream_index != d->stream) { av_packet_unref(d->pkt); continue; } + if (d->pkt->pts != AV_NOPTS_VALUE) { + int64_t at = d->pkt->pts - (st->start_time != AV_NOPTS_VALUE ? st->start_time : 0); + int64_t landed = av_rescale_q(at, st->time_base, (AVRational){1, OUT_RATE}); + if (frame > landed) d->skip = frame - landed; + } + avcodec_send_packet(d->codec, d->pkt); + av_packet_unref(d->pkt); + break; + } +} + +void ff_close(ff_dec *d) { + if (!d) return; + if (d->swr) swr_free(&d->swr); + if (d->codec) avcodec_free_context(&d->codec); + if (d->fmt) avformat_close_input(&d->fmt); + if (d->pkt) av_packet_free(&d->pkt); + if (d->frame) av_frame_free(&d->frame); + free(d->bufL); + free(d->bufR); + free(d); +} diff --git a/Native/ffdecode.h b/Native/ffdecode.h new file mode 100644 index 0000000..8563166 --- /dev/null +++ b/Native/ffdecode.h @@ -0,0 +1,15 @@ +// Minimal FFmpeg audio decoder for Mulberry: any input -> 48 kHz stereo float (planar). +#pragma once +#include + +typedef struct ff_dec ff_dec; + +/// Opens a file; returns NULL if FFmpeg can't decode it. +ff_dec *ff_open(const char *path); +/// Total length in 48 kHz frames (0 when unknown). +int64_t ff_frames(ff_dec *d); +/// Reads up to `max` frames into left/right; returns frames written, 0 at end, <0 on error. +int ff_read(ff_dec *d, float *left, float *right, int max); +/// Seeks to a 48 kHz frame position. +void ff_seek(ff_dec *d, int64_t frame); +void ff_close(ff_dec *d); diff --git a/Shared/Shapes.swift b/Shared/Shapes.swift index 44132e9..5fc5329 100644 --- a/Shared/Shapes.swift +++ b/Shared/Shapes.swift @@ -57,7 +57,13 @@ enum Shapes { static func smooth(_ a: [Float], _ passes: Int) -> [Float] { var cur = a for _ in 0.. "$log"; then return 0; fi + if grep -q 'symbol(s) not found' "$log"; then + echo " resolving missing SDK symbols on the device…" + tools/resolve-undefined "$log" + tools/phone-ld "$@" && return 0 + fi + cat "$log" >&2 + return 1 +} +LD=link +"$SWIFT/clang" -target "$TARGET" -isysroot "$SDK" -O2 -c Native/compat.c -o "$OUT/obj/compat.o" + +# FFmpeg for the extra formats, when Native/build-ffmpeg.sh has been run. +ff=() +fflibs=() +if [ -f Native/ffmpeg/lib/libavformat.a ]; then + "$SWIFT/clang" -target "$TARGET" -isysroot "$SDK" -O2 -INative/ffmpeg/include -c Native/ffdecode.c -o "$OUT/obj/ffdecode.o" + ff=(-D MULBERRY_FFMPEG -import-objc-header Native/ffdecode.h) + fflibs=("$OUT/obj/ffdecode.o" Native/ffmpeg/lib/libavformat.a Native/ffmpeg/lib/libavcodec.a + Native/ffmpeg/lib/libswresample.a Native/ffmpeg/lib/libavutil.a -lz -lbz2 -liconv + -framework AudioToolbox -framework CoreFoundation -framework CoreMedia -framework CoreVideo -framework Security -framework VideoToolbox) +fi echo "== app" -"$SWIFT/swiftc" "${common[@]}" -module-name Mulberry \ - $(find App Shared -name '*.swift' | sort) \ - -o "$APP/Mulberry" +"$SWIFT/swiftc" "${common[@]}" "${ff[@]}" -module-name Mulberry -c -wmo -num-threads 0 \ + $(find App Shared -name '*.swift' | sort) -o "$OUT/obj/Mulberry.o" +$LD -dead_strip -o "$APP/Mulberry" "$OUT/obj/Mulberry.o" "$OUT/obj/compat.o" "${fflibs[@]}" echo "== widget extension" -"$SWIFT/swiftc" "${common[@]}" -module-name MulberryWidgets -application-extension \ - $(find Widget Shared -name '*.swift' | sort) \ - -o "$APPEX/MulberryWidgets" +"$SWIFT/swiftc" "${common[@]}" -module-name MulberryWidgets -application-extension -c -wmo -num-threads 0 \ + $(find Widget Shared -name '*.swift' | sort) -o "$OUT/obj/MulberryWidgets.o" +$LD -dead_strip -application-extension -o "$APPEX/MulberryWidgets" "$OUT/obj/MulberryWidgets.o" "$OUT/obj/compat.o" echo "== bundle" sed -e "s/@VERSION@/$VERSION/" -e "s/@BUILD@/$BUILD/" Resources/Info.plist > "$APP/Info.plist" diff --git a/tools/patch-tbd.py b/tools/patch-tbd.py new file mode 100644 index 0000000..9f6c705 --- /dev/null +++ b/tools/patch-tbd.py @@ -0,0 +1,39 @@ +"""Adds recorded symbols to .tbd stubs as an extra arm64/arm64e export block (see resolve-undefined). +Usage: patch-tbd.py — prints the SDK-relative paths it changed.""" +import collections +import re +import sys + +lst, sdk = sys.argv[1], sys.argv[2] +by = collections.defaultdict(list) +for line in open(lst): + if '\t' in line: + lib, sym = line.rstrip('\n').split('\t', 1) + by[lib].append(sym) + +for lib, syms in sorted(by.items()): + rel = lib[:-len('.dylib')] + '.tbd' if lib.endswith('.dylib') else lib + '.tbd' + path = sdk + rel + try: + text = open(path).read() + except FileNotFoundError: + print('missing stub ' + rel, file=sys.stderr) + continue + text = re.sub(r' # mulberry-extra\n.*? # mulberry-end\n', '', text, flags=re.S) + objc = sorted({s.split('_$_', 1)[1] for s in syms if s.startswith(('_OBJC_CLASS_$_', '_OBJC_METACLASS_$_'))}) + plain = sorted(s for s in syms if not s.startswith('_OBJC_')) + block = ' # mulberry-extra\n - archs: [ arm64, arm64e ]\n' + if plain: + block += ' symbols: [ ' + ', '.join("'%s'" % s.replace("'", "''") for s in plain) + ' ]\n' + if objc: + block += ' objc-classes: [ ' + ', '.join(objc) + ' ]\n' + block += ' # mulberry-end\n' + text, n = re.subn(r'^exports:[ \t]*\n', lambda m: m.group(0) + block, text, count=1, flags=re.M) + if n == 0: + # Stub without any exports: add the section before the document end marker. + text, n = re.subn(r'^\.\.\.[ \t]*$', lambda m: 'exports:\n' + block + m.group(0), text, count=1, flags=re.M) + if n == 0: + print('cannot patch ' + rel, file=sys.stderr) + continue + open(path, 'w').write(text) + print(rel.lstrip('/')) diff --git a/tools/phone-ld b/tools/phone-ld new file mode 100755 index 0000000..f5042e6 --- /dev/null +++ b/tools/phone-ld @@ -0,0 +1,62 @@ +#!/bin/bash +# Clang-style linker front end that links on the jailbroken iPhone with Procursus ld64. +# Usage like a link-only clang: phone-ld [-o out] [objs/archives] [-lfoo] [-Ldir] [-framework X] [-shared] +# Compile-only invocations (-c) are forwarded to the local clang. +set -euo pipefail + +IPHONE=${IPHONE:-mobile@192.168.1.94} +KEY=${IPHONE_KEY:-$HOME/.ssh/iphone_key} +CLANG=${CLANG:-$HOME/.local/opt/swift/usr/bin/clang} +REMOTE_SDK=${REMOTE_SDK:-/var/mobile/mulberry-build/iPhoneOS18.6.sdk} +MINOS=${MINOS:-17.0} + +for a in "$@"; do + if [ "$a" = "-c" ] || [ "$a" = "-E" ] || [ "$a" = "-S" ]; then exec "$CLANG" "$@"; fi +done + +out=a.out +inputs=() +flags=() +extension=0 +while [ $# -gt 0 ]; do + case "$1" in + -o) out=$2; shift ;; + -l*) flags+=("$1") ;; + -L) shift ;; # SDK paths are remote; local -L dirs are ignored + -L*) ;; + -framework|-weak_framework) flags+=("$1" "$2"); shift ;; + -Xlinker) flags+=("$2"); shift ;; + -Wl,*) IFS=, read -ra w <<< "${1#-Wl,}"; flags+=("${w[@]}") ;; + -application-extension|-fapplication-extension) extension=1 ;; + -dead_strip) flags+=(-dead_strip) ;; + -*) ;; # target/sysroot/optimisation flags: handled below + *.o|*.a|*.tbd) inputs+=("$1") ;; + *) [ -f "$1" ] && inputs+=("$1") ;; + esac + shift +done + +job=/var/mobile/mulberry-build/ld.$$.$RANDOM +ssh_=(ssh -i "$KEY" -o BatchMode=yes -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPersist=60 + -o ControlPath="$HOME/.ssh/cm-phone-ld-%r@%h" "$IPHONE") +"${ssh_[@]}" "mkdir -p $job" +# Ship inputs under unique names (two inputs may share a basename). +stage=$(mktemp -d) +trap 'rm -rf "$stage"' EXIT +names=() +i=0 +for f in "${inputs[@]}"; do + n=$i-$(basename "$f") + ln -s "$(realpath "$f")" "$stage/$n" + names+=("$n") + i=$((i + 1)) +done +tar -chf - -C "$stage" . | "${ssh_[@]}" "cd $job && tar -xf -" +ext=() +[ "$extension" = 1 ] && ext=(-application_extension) +q() { printf "'%s' " "$@"; } +"${ssh_[@]}" "cd $job && ld64 -arch arm64 -platform_version ios $MINOS 18.6 -syslibroot $REMOTE_SDK \ + -L$REMOTE_SDK/usr/lib/swift -rpath /usr/lib/swift ${ext[*]:-} $(q "${names[@]}") $(q "${flags[@]:-}" | sed "s/''//g") \ + -lSystem -lobjc -o out" 1>&2 || { "${ssh_[@]}" "rm -rf $job"; exit 1; } +"${ssh_[@]}" "cat $job/out && rm -rf $job" > "$out" +chmod +x "$out" diff --git a/tools/resolve-undefined b/tools/resolve-undefined new file mode 100755 index 0000000..a90a07d --- /dev/null +++ b/tools/resolve-undefined @@ -0,0 +1,58 @@ +#!/bin/bash +# The repacked iPhoneOS18.6 SDK has incomplete .tbd stubs (Swift overlay symbols are missing). +# Given a failed ld64 log, this asks the iPhone which library really exports each undefined symbol, +# records the answers in tools/sdk-extra-symbols.txt and patches those stubs (locally and in the phone's copy). +# Usage: tools/resolve-undefined build/build.log (no argument: re-apply the recorded list) +set -euo pipefail +cd "$(dirname "$0")/.." + +IPHONE=${IPHONE:-mobile@192.168.1.94} +KEY=${IPHONE_KEY:-$HOME/.ssh/iphone_key} +SWIFT=${SWIFT:-$HOME/.local/opt/swift/usr/bin} +SDK=${SDK:-$HOME/.local/opt/dl/sdk18/iPhoneOS18.6.sdk} +REMOTE=/var/mobile/mulberry-build +LIST=tools/sdk-extra-symbols.txt +touch "$LIST" +ssh_=(ssh -i "$KEY" -o BatchMode=yes -o ConnectTimeout=10 "$IPHONE") +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT + +if [ $# -gt 0 ]; then + syms=$(grep -E '^ "' "$1" | sed -E 's/^ "(.*)", referenced from:/\1/' | sort -u | grep -v '^___isPlatformVersionAtLeast$' || true) + if [ -n "$syms" ]; then + # dlopen every framework and Swift overlay, then dladdr each symbol to find its image. + { + echo '#include ' + echo '#include ' + echo 'int main(void){' + for f in $(ls "$SDK/System/Library/Frameworks" | sed -n 's/\.framework$//p'); do + echo " dlopen(\"/System/Library/Frameworks/$f.framework/$f\", RTLD_LAZY);" + done + for d in "$SDK"/usr/lib/swift/libswift*.tbd; do + echo " dlopen(\"/usr/lib/swift/$(basename "$d" .tbd).dylib\", RTLD_LAZY);" + done + echo ' const char *s[] = {' + for s in $syms; do echo " \"${s#_}\","; done + echo ' };' + echo ' for (unsigned i = 0; i < sizeof s / sizeof *s; i++) {' + echo ' void *p = dlsym(RTLD_DEFAULT, s[i]); Dl_info d = {0};' + echo ' if (p && dladdr(p, &d)) printf("%s\t_%s\n", d.dli_fname, s[i]);' + echo ' else fprintf(stderr, "not on device: %s\n", s[i]);' + echo ' }' + echo ' return 0;' + echo '}' + } > "$work/probe.c" + "$SWIFT/clang" -target arm64-apple-ios17.0 -isysroot "$SDK" -c "$work/probe.c" -o "$work/probe.o" + tools/phone-ld -o "$work/probe" "$work/probe.o" + scp -q -i "$KEY" "$work/probe" "$IPHONE:$REMOTE/probe" + "${ssh_[@]}" "cd $REMOTE && ldid -S probe && ./probe; rm -f probe" >> "$LIST" + sort -u -o "$LIST" "$LIST" + fi +fi + +# Patch the local SDK stubs (idempotent, between marker comments) and copy the changed ones to the phone. +python3 tools/patch-tbd.py "$LIST" "$SDK" > "$work/changed" +if [ -s "$work/changed" ]; then + (cd "$SDK/.." && sed "s|^|$(basename "$SDK")/|" "$work/changed" | tar -cf - -T -) | "${ssh_[@]}" "cd $REMOTE && tar -xf -" +fi +echo "patched $(wc -l < "$work/changed") stub(s) with $(wc -l < "$LIST") symbol(s)" diff --git a/tools/sdk-extra-symbols.txt b/tools/sdk-extra-symbols.txt new file mode 100644 index 0000000..f340457 --- /dev/null +++ b/tools/sdk-extra-symbols.txt @@ -0,0 +1,145 @@ +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents09_SupportsA12DependenciesMp +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A4EnumMp +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A4EnumP8RawValueSY_s25LosslessStringConvertibleTn +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A4EnumPAA0A5ValueTb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A4EnumPAA26StaticDisplayRepresentableTb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A4EnumPAAE28defaultResolverSpecificationQrvgZ +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A4EnumPAAE28defaultResolverSpecificationQrvpZQOMQ +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A4EnumPSYTb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A5ValueMp +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A5ValuePAA07_IntentC0Tb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A5ValuePAA24PersistentlyIdentifiableTb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A5ValuePAA24TypeDisplayRepresentableTb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentMp +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentP04openA7WhenRunSbvgZTq +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentP11descriptionAA0C11DescriptionVSgvgZTq +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentP13PerformResultAC_AA0cE0Tn +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentP14isDiscoverableSbvgZTq +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentP14SummaryContentAC_AA09ParameterD0Tn +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentP16parameterSummary0E7ContentQzvgZTq +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentP20authenticationPolicyAA0c14AuthenticationE0OvgZTq +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentP5title10Foundation23LocalizedStringResourceVvgZTq +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentP7perform13PerformResultQzyYaKFTq +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentPAA09_SupportsA12DependenciesTb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentPAA24PersistentlyIdentifiableTb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentPAAE04openA7WhenRunSbvgZ +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentPAAE11descriptionAA0C11DescriptionVSgvgZ +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentPAAE16parameterSummaryQrvgZ +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentPAAE16parameterSummaryQrvpZQOMQ +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentPAAE20authenticationPolicyAA0c14AuthenticationE0OvgZ +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentPAAE20persistentIdentifierSSvgZ +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents0A6IntentPxycfCTq +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents12IntentDialogVMa +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents12IntentDialogVMn +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents12IntentResultMp +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents12IntentResultPAAE6resultAA0cD9ContainerVys5NeverOA3HGyAIRszrlFZ +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents12_IntentValueMp +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents12_IntentValueP0D4TypeAC_AaBTn +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents12_IntentValueP13SpecificationAC_AA08ResolverE0Tn +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents12_IntentValueP13UnwrappedTypeAC_AaBTn +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents12_IntentValueP28defaultResolverSpecification0G0QzvgZTq +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents12SystemIntentMp +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents12SystemIntentPAA0aD0Tb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents15IntentParameterC12wrappedValuexvg +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents15IntentParameterC12wrappedValuexvs +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents15IntentParameterCA2A0A4Enum9ValueTypeRpzrlE5title11description7default07requestF6Dialog0k14DisambiguationL023inputConnectionBehavior15supportedValuesACyxG10Foundation23LocalizedStringResourceV_AQSg09UnwrappedG0QzSgYtAA0cL0VSgAxA05InputoP0OYtSayAFGtcfC +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents15IntentParameterCMn +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents19AudioPlaybackIntentMp +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents19AudioPlaybackIntentPAA06SystemE0Tb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents21DisplayRepresentationV13stringLiteralACSS_tcfC +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents21DisplayRepresentationVMa +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents21DisplayRepresentationVMn +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents21IntentResultContainerVMn +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents21IntentResultContainerVyxq_q0_q1_GAA0cD0AAMc +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents23InputConnectionBehaviorO7defaultyA2CmFWC +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents23InputConnectionBehaviorOMa +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents24CaseDisplayRepresentableMp +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents24CaseDisplayRepresentableP04caseD15RepresentationsSDyxAA0D14RepresentationVGvgZTq +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents24CaseDisplayRepresentableP10Foundation40CustomLocalizedStringResourceConvertibleTb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents24CaseDisplayRepresentablePAAE23localizedStringResource10Foundation09LocalizedgH0Vvg +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents24CaseDisplayRepresentablePs0C8IterableTb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents24CaseDisplayRepresentablePSHTb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents24PersistentlyIdentifiableMp +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents24PersistentlyIdentifiableP20persistentIdentifierSSvgZTq +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents24PersistentlyIdentifiablePAAE20persistentIdentifierSSvgZ +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents24TypeDisplayRepresentableMp +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents24TypeDisplayRepresentableP04typeD14RepresentationAA0cdG0VvgZTq +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents25TypeDisplayRepresentationV13stringLiteralACSS_tcfC +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents26StaticDisplayRepresentableMp +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents26StaticDisplayRepresentablePAA04CasedE0Tb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s10AppIntents26StaticDisplayRepresentablePAA04TypedE0Tb +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s13PerformResult10AppIntents0C6IntentPTl +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s13Specification10AppIntents12_IntentValuePTl +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s13UnwrappedType10AppIntents12_IntentValuePTl +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s14SummaryContent10AppIntents0C6IntentPTl +/System/Library/Frameworks/AppIntents.framework/AppIntents _$s9ValueType10AppIntents07_IntentA0PTl +/System/Library/Frameworks/_AppIntents_SwiftUI.framework/_AppIntents_SwiftUI _$s7SwiftUI6ButtonV012_AppIntents_aB0E6intent5labelACyxGqd___xyXEtc0dE00D6IntentRd__lufC +/System/Library/Frameworks/AuthenticationServices.framework/AuthenticationServices _OBJC_CLASS_$_ASWebAuthenticationSession +/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics _$sSo12CGContextRefa12CoreGraphicsE4draw_2in8byTilingySo07CGImageB0a_So6CGRectVSbtF +/System/Library/Frameworks/CryptoKit.framework/CryptoKit _$s9CryptoKit12HashFunctionP6update13bufferPointerySW_tFTj +/System/Library/Frameworks/CryptoKit.framework/CryptoKit _$s9CryptoKit12HashFunctionP8finalize6DigestQzyFTj +/System/Library/Frameworks/CryptoKit.framework/CryptoKit _$s9CryptoKit12HashFunctionPxycfCTj +/System/Library/Frameworks/CryptoKit.framework/CryptoKit _$s9CryptoKit8InsecureO3MD5VAA12HashFunctionAAMc +/System/Library/Frameworks/CryptoKit.framework/CryptoKit _$s9CryptoKit8InsecureO3MD5VMa +/System/Library/Frameworks/CryptoKit.framework/CryptoKit _$s9CryptoKit8InsecureO9MD5DigestVMa +/System/Library/Frameworks/CryptoKit.framework/CryptoKit _$s9CryptoKit8InsecureO9MD5DigestVSTAAMc +/System/Library/Frameworks/PhotosUI.framework/PhotosUI _$s8PhotosUI14PHPickerFilterV6imagesACvgZ +/System/Library/Frameworks/PhotosUI.framework/PhotosUI _$s8PhotosUI14PHPickerFilterVMa +/System/Library/Frameworks/PhotosUI.framework/PhotosUI _$s8PhotosUI14PHPickerFilterVMn +/System/Library/Frameworks/_PhotosUI_SwiftUI.framework/_PhotosUI_SwiftUI _$s015_PhotosUI_SwiftB00A10PickerItemV16loadTransferable4typexSgxm_tYaK04CoreG00G0RzlF +/System/Library/Frameworks/_PhotosUI_SwiftUI.framework/_PhotosUI_SwiftUI _$s015_PhotosUI_SwiftB00A10PickerItemV16loadTransferable4typexSgxm_tYaK04CoreG00G0RzlFTu +/System/Library/Frameworks/_PhotosUI_SwiftUI.framework/_PhotosUI_SwiftUI _$s015_PhotosUI_SwiftB00A10PickerItemV28EncodingDisambiguationPolicyV9automaticAEvgZ +/System/Library/Frameworks/_PhotosUI_SwiftUI.framework/_PhotosUI_SwiftUI _$s015_PhotosUI_SwiftB00A10PickerItemV28EncodingDisambiguationPolicyVMa +/System/Library/Frameworks/_PhotosUI_SwiftUI.framework/_PhotosUI_SwiftUI _$s015_PhotosUI_SwiftB00A10PickerItemVMa +/System/Library/Frameworks/_PhotosUI_SwiftUI.framework/_PhotosUI_SwiftUI _$s015_PhotosUI_SwiftB00A10PickerItemVMn +/System/Library/Frameworks/_PhotosUI_SwiftUI.framework/_PhotosUI_SwiftUI _$s015_PhotosUI_SwiftB00A6PickerV9selection8matching21preferredItemEncoding5labelACyxG0cB07BindingVyAA0adH0VSgG_0aB014PHPickerFilterVSgAM0I20DisambiguationPolicyVxyXEtcfC +/System/Library/Frameworks/_PhotosUI_SwiftUI.framework/_PhotosUI_SwiftUI _$s015_PhotosUI_SwiftB00A6PickerVMn +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s5Entry9WidgetKit16TimelineProviderPTl +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI12WidgetBundleP0C3KitE4mainyyFZ +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI17EnvironmentValuesV9WidgetKitE12widgetFamilyAD0eH0Ovg +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI17EnvironmentValuesV9WidgetKitE12widgetFamilyAD0eH0OvpMV +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI19WidgetConfigurationP0C3KitE11descriptionyQrAA18LocalizedStringKeyVF +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI19WidgetConfigurationP0C3KitE11descriptionyQrAA18LocalizedStringKeyVFQOMQ +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI19WidgetConfigurationP0C3KitE17supportedFamiliesyQrSayAD0C6FamilyOGF +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI19WidgetConfigurationP0C3KitE17supportedFamiliesyQrSayAD0C6FamilyOGFQOMQ +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI19WidgetConfigurationP0C3KitE24configurationDisplayNameyQrAA18LocalizedStringKeyVF +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI19WidgetConfigurationP0C3KitE24configurationDisplayNameyQrAA18LocalizedStringKeyVFQOMQ +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI28ContainerBackgroundPlacementV9WidgetKitE6widgetACvgZ +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI4ViewP9WidgetKitE11widgetLabelyQrqd__SyRd__lF +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI4ViewP9WidgetKitE11widgetLabelyQrqd__SyRd__lFQOMQ +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI4ViewP9WidgetKitE9widgetURLyQr10Foundation0G0VSgF +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s7SwiftUI4ViewP9WidgetKitE9widgetURLyQr10Foundation0G0VSgFQOMQ +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit09AccessoryA10BackgroundVACycfC +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit09AccessoryA10BackgroundVMa +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit09AccessoryA10BackgroundVMn +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit0A6CenterC18reloadAllTimelinesyyFTj +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit0A6CenterC6sharedACvgZ +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit0A6CenterCMa +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit0A6FamilyO11systemLargeyA2CmFWC +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit0A6FamilyO11systemSmallyA2CmFWC +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit0A6FamilyO12systemMediumyA2CmFWC +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit0A6FamilyO15accessoryInlineyA2CmFWC +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit0A6FamilyO17accessoryCircularyA2CmFWC +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit0A6FamilyO20accessoryRectangularyA2CmFWC +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit0A6FamilyOMa +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit0A6FamilyOMn +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit13TimelineEntryMp +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit13TimelineEntryP4date10Foundation4DateVvgTq +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit13TimelineEntryP9relevanceAA0cD9RelevanceVSgvgTq +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit13TimelineEntryPAAE9relevanceAA0cD9RelevanceVSgvg +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit16TimelineProviderMp +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit16TimelineProviderP03getC02in10completionyAA0cD7ContextV_yAA0C0Vy5EntryQzGctFTq +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit16TimelineProviderP11getSnapshot2in10completionyAA0cD7ContextV_y5EntryQzctFTq +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit16TimelineProviderP11placeholder2in5EntryQzAA0cD7ContextV_tFTq +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit16TimelineProviderP5EntryAC_AA0cE0Tn +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit16TimelineProviderP9relevanceAA0A9RelevanceVyytGyYaFTq +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit16TimelineProviderPAAE9relevanceAA0A9RelevanceVyytGyYaF +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit16TimelineProviderPAAE9relevanceAA0A9RelevanceVyytGyYaFTu +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit19StaticConfigurationV4kind8provider7contentACyxGSS_qd__x5EntryQyd__ctcAA16TimelineProviderRd__lufC +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit19StaticConfigurationVMn +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit19StaticConfigurationVyxG7SwiftUI0aD0AAMc +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit20TimelineReloadPolicyV5afteryAC10Foundation4DateVFZ +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit20TimelineReloadPolicyV5neverACvgZ +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit20TimelineReloadPolicyVMa +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit8TimelineV7entries6policyACyxGSayxG_AA0C12ReloadPolicyVtcfC +/System/Library/Frameworks/WidgetKit.framework/WidgetKit _$s9WidgetKit8TimelineVMn