mirror of
https://github.com/faroukbmiled/RyukGram.git
synced 2026-07-25 13:40:53 +02:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 54eafa749b | |||
| 5162a2563a |
@@ -1,10 +0,0 @@
|
||||
CompileFlags:
|
||||
Add: [
|
||||
"-isysroot",
|
||||
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk",
|
||||
"-fmodules",
|
||||
"-fcxx-modules",
|
||||
"-fobjc-arc",
|
||||
"-I/opt/theos/include",
|
||||
"-I/opt/theos/vendor/include"
|
||||
]
|
||||
+2
-2
@@ -1,2 +1,2 @@
|
||||
ko_fi: SoCuul
|
||||
github: SoCuul
|
||||
buy_me_a_coffee: axryuk
|
||||
github: faroukbmiled
|
||||
|
||||
@@ -4,7 +4,7 @@ title: 'bug: '
|
||||
labels:
|
||||
- bug
|
||||
assignees:
|
||||
- SoCuul
|
||||
- faroukbmiled
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
@@ -12,7 +12,7 @@ body:
|
||||
<br>
|
||||
|
||||
>[!TIP]
|
||||
> If you are looking for support with the tweak, make sure to visit the [SCInsta discussions page](https://github.com/SoCuul/SCInsta/discussions) to get help.
|
||||
> If you are looking for support with the tweak, make sure to visit the [RyukGram discussions page](https://github.com/faroukbmiled/RyukGram/discussions) to get help.
|
||||
- type: checkboxes
|
||||
id: before-start
|
||||
attributes:
|
||||
@@ -21,13 +21,13 @@ body:
|
||||
options:
|
||||
- label: >-
|
||||
I have read through the
|
||||
[FAQ](https://github.com/SoCuul/SCInsta/wiki/FAQ)
|
||||
[FAQ](https://github.com/faroukbmiled/RyukGram/wiki/FAQ)
|
||||
required: true
|
||||
- label: I have made sure this issue has not already been reported previously
|
||||
required: true
|
||||
- label: >-
|
||||
I have made sure this issue is present in the latest version of
|
||||
SCInsta
|
||||
RyukGram
|
||||
required: true
|
||||
- label: >-
|
||||
I am confident that this bug presents unintended behaviour within
|
||||
@@ -57,9 +57,9 @@ body:
|
||||
attributes:
|
||||
value: '---'
|
||||
- type: input
|
||||
id: info-scinsta-version
|
||||
id: info-ryukgram-version
|
||||
attributes:
|
||||
label: SCInsta Version
|
||||
label: RyukGram Version
|
||||
description: This can be found at the bottom of the tweak settings
|
||||
placeholder: e.g. v0.7.0
|
||||
validations:
|
||||
@@ -76,7 +76,7 @@ body:
|
||||
id: info-install-type
|
||||
attributes:
|
||||
label: Install Type
|
||||
description: The method used to use to install SCInsta
|
||||
description: The method used to use to install RyukGram
|
||||
options:
|
||||
- Sideloaded
|
||||
- TrollStore
|
||||
|
||||
@@ -4,7 +4,7 @@ title: 'feat: '
|
||||
labels:
|
||||
- enhancement
|
||||
assignees:
|
||||
- SoCuul
|
||||
- faroukbmiled
|
||||
body:
|
||||
- type: checkboxes
|
||||
id: before-start
|
||||
@@ -14,7 +14,7 @@ body:
|
||||
options:
|
||||
- label: >-
|
||||
I have read through the
|
||||
[FAQ](https://github.com/SoCuul/SCInsta/wiki/FAQ)
|
||||
[FAQ](https://github.com/faroukbmiled/RyukGram/wiki/FAQ)
|
||||
required: true
|
||||
- label: I have made sure this feature has not already been already suggested
|
||||
required: true
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: '💬 Browse Q&A'
|
||||
url: https://github.com/SoCuul/SCInsta/wiki/FAQ
|
||||
url: https://github.com/faroukbmiled/RyukGram/wiki/FAQ
|
||||
about: Find answers to the most commonly asked questions
|
||||
- name: '❓ Need Help?'
|
||||
url: https://github.com/SoCuul/SCInsta/discussions
|
||||
about: Visit the SCInsta discussions form to get support
|
||||
url: https://github.com/faroukbmiled/RyukGram/discussions
|
||||
about: Visit the RyukGram discussions form to get support
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
name: Issue assignment
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
auto-assign:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: 'Auto-assign issue'
|
||||
uses: pozil/auto-assign-issue@v1
|
||||
with:
|
||||
assignees: faroukbmiled
|
||||
allowNoAssignees: true
|
||||
@@ -1,18 +0,0 @@
|
||||
name: PR assignment
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened]
|
||||
|
||||
jobs:
|
||||
auto-assign:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: 'Auto-assign PR'
|
||||
uses: pozil/auto-assign-issue@v1
|
||||
with:
|
||||
assignees: faroukbmiled
|
||||
allowNoAssignees: true
|
||||
@@ -0,0 +1,279 @@
|
||||
name: Build sideloaded IPA from Release Assets
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
decrypted_instagram_url:
|
||||
description: "Decrypted Instagram IPA — direct URL"
|
||||
default: ""
|
||||
required: true
|
||||
type: string
|
||||
target:
|
||||
description: "Instagram version (410 needs a 410.x IPA above)"
|
||||
default: "latest"
|
||||
required: false
|
||||
type: choice
|
||||
options:
|
||||
- "latest"
|
||||
- "410"
|
||||
build_sideload:
|
||||
description: "Sideload IPA — with plugins"
|
||||
default: true
|
||||
required: false
|
||||
type: boolean
|
||||
build_noplugins:
|
||||
description: "No-plugins IPA — any sideloader / free account"
|
||||
default: false
|
||||
required: false
|
||||
type: boolean
|
||||
dup_bundle_id:
|
||||
description: "Bundle id (no-plugins only, blank = com.burbn.instagram)"
|
||||
default: ""
|
||||
required: false
|
||||
type: string
|
||||
dup_name:
|
||||
description: "App name on Home Screen (blank = Instagram)"
|
||||
default: ""
|
||||
required: false
|
||||
type: string
|
||||
release_tag:
|
||||
description: "Release tag (blank = latest)"
|
||||
default: ""
|
||||
required: false
|
||||
type: string
|
||||
upload_artifact:
|
||||
description: "Upload the built IPA"
|
||||
default: true
|
||||
required: false
|
||||
type: boolean
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
UPSTREAM_REPO: faroukbmiled/RyukGram
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build RyukGram from Release
|
||||
runs-on: macos-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: Validate selection
|
||||
env:
|
||||
DUP_ID: ${{ inputs.dup_bundle_id }}
|
||||
run: |
|
||||
if [ "${{ inputs.build_sideload }}" != "true" ] && \
|
||||
[ "${{ inputs.build_noplugins }}" != "true" ]; then
|
||||
echo "::error::Select at least one of build_sideload / build_noplugins."
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "$DUP_ID" ] && [ "${{ inputs.build_noplugins }}" != "true" ]; then
|
||||
echo "::error::A dup bundle id needs the no-plugins build. Enable build_noplugins."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Dependencies
|
||||
run: brew install dpkg
|
||||
|
||||
- name: Install IPA tooling (cyan + ipapatch)
|
||||
run: |
|
||||
pip install --force-reinstall https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip
|
||||
mkdir -p "$HOME/.local/bin"
|
||||
curl -fLo "$HOME/.local/bin/ipapatch" https://github.com/asdfzxcvbn/ipapatch/releases/download/v2.1.3/ipapatch.macos-arm64
|
||||
chmod +x "$HOME/.local/bin/ipapatch"
|
||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Resolve release tag
|
||||
id: tag
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
INPUT_TAG: ${{ inputs.release_tag }}
|
||||
INPUT_TARGET: ${{ inputs.target }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -n "$INPUT_TAG" ]; then
|
||||
TAG="$INPUT_TAG"
|
||||
else
|
||||
TAG="$(gh release view --repo "$UPSTREAM_REPO" --json tagName -q .tagName)"
|
||||
fi
|
||||
[ -n "$TAG" ] || { echo "::error::Could not resolve release tag."; exit 1; }
|
||||
VERSION="${TAG#v}"
|
||||
# 410 builds pull the RyukGram-410 deb and tag their output -410.
|
||||
SUF=""; [ "$INPUT_TARGET" = "410" ] && SUF="-410"
|
||||
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||
echo "TAG=${TAG}" >> "$GITHUB_ENV"
|
||||
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
|
||||
echo "SUF=${SUF}" >> "$GITHUB_ENV"
|
||||
echo "Using release tag: ${TAG} (version ${VERSION}${SUF})"
|
||||
|
||||
- name: Download release assets (rootless deb + injection dylibs)
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TARGET: ${{ inputs.target }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p packages release-assets
|
||||
|
||||
# 410 tweak lives in the RyukGram-410 deb; main in RyukGram_. The
|
||||
# plugin dylibs are shared, so both targets pull the same ones.
|
||||
if [ "$TARGET" = "410" ]; then DEBP="RyukGram-410_*_rootless.deb"; else DEBP="RyukGram_*_rootless.deb"; fi
|
||||
gh release download "$TAG" --repo "$UPSTREAM_REPO" --dir release-assets --pattern "$DEBP"
|
||||
DEB="$(ls -t release-assets/$DEBP 2>/dev/null | head -n1 || true)"
|
||||
[ -n "$DEB" ] || { echo "::error::Rootless .deb ($DEBP) not found in release $TAG."; exit 1; }
|
||||
echo "DEB=${DEB}" >> "$GITHUB_ENV"
|
||||
|
||||
if [ "${{ inputs.build_sideload }}" = "true" ]; then
|
||||
gh release download "$TAG" --repo "$UPSTREAM_REPO" --dir release-assets \
|
||||
--pattern "zxPluginsInject_v*.dylib"
|
||||
ZX_DYLIB="$(ls -t release-assets/zxPluginsInject_v*.dylib 2>/dev/null | head -n1 || true)"
|
||||
[ -n "$ZX_DYLIB" ] || { echo "::error::zxPluginsInject dylib not found in release $TAG (enable include_zxinject when releasing)."; exit 1; }
|
||||
echo "ZX_DYLIB=${ZX_DYLIB}" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
if [ "${{ inputs.build_noplugins }}" = "true" ]; then
|
||||
gh release download "$TAG" --repo "$UPSTREAM_REPO" --dir release-assets \
|
||||
--pattern "NoPluginsPatch_v*.dylib"
|
||||
NP_DYLIB="$(ls -t release-assets/NoPluginsPatch_v*.dylib 2>/dev/null | head -n1 || true)"
|
||||
[ -n "$NP_DYLIB" ] || { echo "::error::NoPluginsPatch dylib not found in release $TAG (enable include_noplugins_patch when releasing)."; exit 1; }
|
||||
echo "NP_DYLIB=${NP_DYLIB}" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
ls -la release-assets
|
||||
|
||||
- name: Extract dylib + bundle from rootless deb
|
||||
run: |
|
||||
set -euo pipefail
|
||||
STAGE="$(mktemp -d)"
|
||||
dpkg-deb -x "$DEB" "$STAGE"
|
||||
|
||||
DYLIB_SRC="$(find "$STAGE" -type f -name 'RyukGram.dylib' | head -1)"
|
||||
BUNDLE_SRC="$(find "$STAGE" -type d -name 'RyukGram.bundle' | head -1)"
|
||||
[ -n "$DYLIB_SRC" ] || { echo "::error::RyukGram.dylib not found in deb."; exit 1; }
|
||||
[ -n "$BUNDLE_SRC" ] || { echo "::error::RyukGram.bundle not found in deb."; exit 1; }
|
||||
|
||||
cp "$DYLIB_SRC" packages/RyukGram.dylib
|
||||
rm -rf packages/RyukGram.bundle
|
||||
cp -R "$BUNDLE_SRC" packages/RyukGram.bundle
|
||||
|
||||
if [ "${{ inputs.build_sideload }}" = "true" ]; then
|
||||
# Match the @rpath LC that ipapatch writes into target binaries.
|
||||
cp "$ZX_DYLIB" packages/zxPluginsInject.dylib
|
||||
install_name_tool -id "@rpath/zxPluginsInject.dylib" packages/zxPluginsInject.dylib 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if [ "${{ inputs.build_noplugins }}" = "true" ]; then
|
||||
cp "$NP_DYLIB" packages/NoPluginsPatch.dylib
|
||||
fi
|
||||
|
||||
rm -rf "$STAGE"
|
||||
ls -la packages
|
||||
ls -la packages/RyukGram.bundle | head -20
|
||||
|
||||
- name: Prepare Instagram IPA
|
||||
env:
|
||||
Instagram_URL: ${{ inputs.decrypted_instagram_url }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
wget "$Instagram_URL" --no-verbose -O packages/com.burbn.instagram.ipa
|
||||
ls -la packages
|
||||
|
||||
- name: Build sideloaded IPA (cyan + ipapatch with zxPluginsInject)
|
||||
if: ${{ inputs.build_sideload }}
|
||||
env:
|
||||
DUP_NAME: ${{ inputs.dup_name }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -f packages/RyukGram-sideloaded.ipa
|
||||
NAME_ARGS=()
|
||||
[ -n "$DUP_NAME" ] && NAME_ARGS=(-n "$DUP_NAME")
|
||||
cyan \
|
||||
-i packages/com.burbn.instagram.ipa \
|
||||
-o packages/RyukGram-sideloaded.ipa \
|
||||
-f packages/RyukGram.dylib packages/RyukGram.bundle \
|
||||
-c 9 -m 15.0 -du \
|
||||
${NAME_ARGS[@]+"${NAME_ARGS[@]}"}
|
||||
|
||||
# Embed Safari "Open in Instagram" extension before ipapatch
|
||||
# re-signs, so instagram.com links open the app.
|
||||
APPEX_SRC="extensions/OpenInstagramSafariExtension.appex"
|
||||
if [ -d "$APPEX_SRC" ]; then
|
||||
echo "Embedding Safari extension"
|
||||
INJECT_TMP="$(mktemp -d)"
|
||||
unzip -q packages/RyukGram-sideloaded.ipa -d "$INJECT_TMP"
|
||||
APP_DIR="$(find "$INJECT_TMP/Payload" -maxdepth 1 -type d -name '*.app' | head -1)"
|
||||
if [ -n "$APP_DIR" ]; then
|
||||
mkdir -p "$APP_DIR/PlugIns"
|
||||
rm -rf "$APP_DIR/PlugIns/OpenInstagramSafariExtension.appex"
|
||||
cp -R "$APPEX_SRC" "$APP_DIR/PlugIns/"
|
||||
( cd "$INJECT_TMP" && zip -qr -9 ../repacked.ipa Payload )
|
||||
mv "$INJECT_TMP/../repacked.ipa" packages/RyukGram-sideloaded.ipa
|
||||
fi
|
||||
rm -rf "$INJECT_TMP"
|
||||
fi
|
||||
|
||||
echo "Running ipapatch (zxPluginsInject LC injection)"
|
||||
ipapatch \
|
||||
--input packages/RyukGram-sideloaded.ipa \
|
||||
--inplace --noconfirm \
|
||||
--dylib packages/zxPluginsInject.dylib
|
||||
|
||||
mv packages/RyukGram-sideloaded.ipa "packages/RyukGram_sideloaded_v${VERSION}${SUF}.ipa"
|
||||
ls -la packages
|
||||
|
||||
- name: Build no-plugins IPA (cyan + NoPluginsPatch, appex stripped)
|
||||
if: ${{ inputs.build_noplugins }}
|
||||
env:
|
||||
DUP_ID: ${{ inputs.dup_bundle_id }}
|
||||
DUP_NAME: ${{ inputs.dup_name }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -f packages/RyukGram-noplugins.ipa
|
||||
DUP_ARGS=()
|
||||
[ -n "$DUP_ID" ] && DUP_ARGS+=(-b "$DUP_ID")
|
||||
[ -n "$DUP_NAME" ] && DUP_ARGS+=(-n "$DUP_NAME")
|
||||
cyan \
|
||||
-i packages/com.burbn.instagram.ipa \
|
||||
-o packages/RyukGram-noplugins.ipa \
|
||||
-f packages/RyukGram.dylib packages/NoPluginsPatch.dylib packages/RyukGram.bundle \
|
||||
-c 9 -m 15.0 -du \
|
||||
${DUP_ARGS[@]+"${DUP_ARGS[@]}"}
|
||||
|
||||
# No-plugins: strip every app extension (no ipapatch, no Safari ext).
|
||||
INJECT_TMP="$(mktemp -d)"
|
||||
unzip -q packages/RyukGram-noplugins.ipa -d "$INJECT_TMP"
|
||||
APP_DIR="$(find "$INJECT_TMP/Payload" -maxdepth 1 -type d -name '*.app' | head -1)"
|
||||
if [ -n "$APP_DIR" ]; then
|
||||
find "$APP_DIR" -type d -name '*.appex' -prune -exec rm -rf {} +
|
||||
( cd "$INJECT_TMP" && zip -qr -9 ../repacked.ipa Payload )
|
||||
mv "$INJECT_TMP/../repacked.ipa" packages/RyukGram-noplugins.ipa
|
||||
fi
|
||||
rm -rf "$INJECT_TMP"
|
||||
|
||||
OUT="RyukGram_noplugins_v${VERSION}${SUF}.ipa"
|
||||
[ -n "$DUP_ID" ] && OUT="RyukGram_noplugins_dup_v${VERSION}${SUF}.ipa"
|
||||
mv packages/RyukGram-noplugins.ipa "packages/${OUT}"
|
||||
ls -la packages
|
||||
|
||||
- name: Upload sideload IPA artifact
|
||||
if: ${{ inputs.upload_artifact && inputs.build_sideload }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: RyukGram_sideloaded_v${{ steps.tag.outputs.version }}
|
||||
path: packages/RyukGram_sideloaded_v*.ipa
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload no-plugins IPA artifact
|
||||
if: ${{ inputs.upload_artifact && inputs.build_noplugins }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: RyukGram_noplugins_v${{ steps.tag.outputs.version }}
|
||||
path: packages/RyukGram_noplugins*.ipa
|
||||
if-no-files-found: error
|
||||
@@ -1,133 +0,0 @@
|
||||
# Inspired heavily by the following workflows
|
||||
# https://github.com/arichornlover/uYouEnhanced/blob/main/.github/workflows/buildapp.yml
|
||||
# https://github.com/ISnackable/YTCubePlus/blob/main/.github/workflows/Build.yml
|
||||
# https://github.com/BandarHL/BHTwitter/actions/workflows/build.yml
|
||||
|
||||
name: Build and Package RyukGram
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
decrypted_instagram_url:
|
||||
description: "The direct URL to the decrypted Instagram IPA"
|
||||
default: ""
|
||||
required: true
|
||||
type: string
|
||||
upload_artifact:
|
||||
description: "Upload Artifact"
|
||||
default: true
|
||||
required: false
|
||||
type: boolean
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
build:
|
||||
name: Build RyukGram
|
||||
runs-on: macos-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout Main
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: main
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Dependencies
|
||||
run: brew install ldid dpkg make
|
||||
|
||||
- name: Set PATH environment variable
|
||||
run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
|
||||
|
||||
- name: Setup Theos
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: theos/theos
|
||||
ref: master
|
||||
path: ${{ github.workspace }}/theos
|
||||
submodules: recursive
|
||||
|
||||
- name: SDK Caching
|
||||
id: SDK
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: iPhoneOS16.2.sdk
|
||||
with:
|
||||
path: ${{ github.workspace }}/theos/sdks/
|
||||
key: ${{ env.cache-name }}
|
||||
restore-keys: ${{ env.cache-name }}
|
||||
|
||||
- name: Download iOS SDK
|
||||
if: steps.SDK.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/xybp888/iOS-SDKs/
|
||||
cd iOS-SDKs
|
||||
git sparse-checkout set --no-cone iPhoneOS16.2.sdk
|
||||
git checkout
|
||||
mv *.sdk $THEOS/sdks
|
||||
env:
|
||||
THEOS: ${{ github.workspace }}/theos
|
||||
|
||||
- name: Prepare Instagram IPA
|
||||
run: |
|
||||
cd main
|
||||
mkdir -p packages
|
||||
wget "$Instagram_URL" --no-verbose -O packages/com.burbn.instagram.ipa
|
||||
ls -la packages
|
||||
env:
|
||||
THEOS: ${{ github.workspace }}/theos
|
||||
Instagram_URL: ${{ inputs.decrypted_instagram_url }}
|
||||
|
||||
- name: Get Version
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(awk '/Version:/ {print $2}' main/control)
|
||||
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
|
||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build RyukGram tweak for sideloading (as IPA)
|
||||
run: |
|
||||
pip install --force-reinstall https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip
|
||||
|
||||
cd main
|
||||
curl -Lo ipapatch https://github.com/asdfzxcvbn/ipapatch/releases/download/v2.1.3/ipapatch.macos-arm64
|
||||
chmod +x ipapatch
|
||||
export PATH=.:$PATH
|
||||
ls -la
|
||||
|
||||
./build.sh sideload
|
||||
ls -la packages
|
||||
env:
|
||||
THEOS: ${{ github.workspace }}/theos
|
||||
|
||||
- name: Rename IPA to include version info
|
||||
run: |
|
||||
cd main/packages
|
||||
mv "$(ls -t | head -n1)" "RyukGram_sideloaded_v${VERSION}.ipa"
|
||||
|
||||
- name: Pass package name to upload action
|
||||
id: package_name
|
||||
run: |
|
||||
echo "package=$(ls -t main/packages | head -n1)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Upload Artifact
|
||||
if: ${{ inputs.upload_artifact }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: RyukGram_sideloaded_v${{ steps.version.outputs.version }}
|
||||
path: ${{ github.workspace }}/main/packages/${{ steps.package_name.outputs.package }}
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2.0.6
|
||||
with:
|
||||
name: RyukGram_sideloaded_v${{ steps.version.outputs.version }}
|
||||
files: ${{ github.workspace }}/main/packages/RyukGram_sideloaded_v*.ipa
|
||||
draft: true
|
||||
|
||||
- name: Output Release URL
|
||||
run: |
|
||||
echo "::notice::Release available at: https://github.com/${{ github.repository }}/releases"
|
||||
@@ -1,92 +0,0 @@
|
||||
name: Build RyukGram tweak for Rootless
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'dev'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
build:
|
||||
name: Build RyukGram Rootless
|
||||
runs-on: macos-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout Main
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: main
|
||||
|
||||
- name: Install Dependencies
|
||||
run: brew install ldid dpkg make
|
||||
|
||||
- name: Set PATH environment variable
|
||||
run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
|
||||
|
||||
- name: Setup Theos
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: theos/theos
|
||||
ref: master
|
||||
path: ${{ github.workspace }}/theos
|
||||
submodules: recursive
|
||||
|
||||
- name: SDK Caching
|
||||
id: SDK
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: iPhoneOS16.2.sdk
|
||||
with:
|
||||
path: ${{ github.workspace }}/theos/sdks/
|
||||
key: ${{ env.cache-name }}
|
||||
restore-keys: ${{ env.cache-name }}
|
||||
|
||||
- name: Download iOS SDK
|
||||
if: steps.SDK.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/xybp888/iOS-SDKs/
|
||||
cd iOS-SDKs
|
||||
git sparse-checkout set --no-cone iPhoneOS16.2.sdk
|
||||
git checkout
|
||||
mv *.sdk $THEOS/sdks
|
||||
env:
|
||||
THEOS: ${{ github.workspace }}/theos
|
||||
|
||||
- name: Get Version
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(awk '/Version:/ {print $2}' main/control)
|
||||
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
|
||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build RyukGram tweak for Rootless
|
||||
run: |
|
||||
cd main
|
||||
ls -la
|
||||
./build.sh rootless
|
||||
ls -la packages
|
||||
env:
|
||||
THEOS: ${{ github.workspace }}/theos
|
||||
|
||||
- name: Rename deb to include version info
|
||||
run: |
|
||||
cd main/packages
|
||||
mv "$(ls -t | head -n1)" "com.faroukbmiled.ryukgram_${VERSION}+debug-rootless.deb"
|
||||
|
||||
- name: Pass package name to upload action
|
||||
id: package_name
|
||||
run: |
|
||||
echo "package=$(ls -t main/packages | head -n1)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.package_name.outputs.package }}
|
||||
path: ${{ github.workspace }}/main/packages/${{ steps.package_name.outputs.package }}
|
||||
if-no-files-found: error
|
||||
@@ -1,70 +0,0 @@
|
||||
name: Delete old workflow runs
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
days:
|
||||
description: 'Days-worth of runs to keep for each workflow'
|
||||
required: true
|
||||
default: '7'
|
||||
minimum_runs:
|
||||
description: 'Minimum runs to keep for each workflow'
|
||||
required: true
|
||||
default: '5'
|
||||
delete_workflow_pattern:
|
||||
description: 'Name or filename of the workflow (if not set, all workflows are targeted)'
|
||||
required: false
|
||||
default: 'Build and Package SCInsta'
|
||||
delete_workflow_by_state_pattern:
|
||||
description: 'Filter workflows by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually'
|
||||
required: true
|
||||
default: "ALL"
|
||||
type: choice
|
||||
options:
|
||||
- "ALL"
|
||||
- active
|
||||
- deleted
|
||||
- disabled_inactivity
|
||||
- disabled_manually
|
||||
delete_run_by_conclusion_pattern:
|
||||
description: 'Remove runs based on conclusion: action_required, cancelled, failure, skipped, success'
|
||||
required: true
|
||||
default: "ALL"
|
||||
type: choice
|
||||
options:
|
||||
- "ALL"
|
||||
- "Unsuccessful: action_required,cancelled,failure,skipped"
|
||||
- action_required
|
||||
- cancelled
|
||||
- failure
|
||||
- skipped
|
||||
- success
|
||||
dry_run:
|
||||
description: 'Logs simulated changes, no deletions are performed'
|
||||
required: false
|
||||
|
||||
# schedule:
|
||||
# - cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
del_runs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Delete workflow runs
|
||||
uses: Mattraks/delete-workflow-runs@v2
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
repository: ${{ github.repository }}
|
||||
retain_days: ${{ github.event.inputs.days }}
|
||||
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}
|
||||
delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }}
|
||||
delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }}
|
||||
delete_run_by_conclusion_pattern: >-
|
||||
${{
|
||||
startsWith(github.event.inputs.delete_run_by_conclusion_pattern, 'Unsuccessful:')
|
||||
&& 'action_required,cancelled,failure,skipped'
|
||||
|| github.event.inputs.delete_run_by_conclusion_pattern
|
||||
}}
|
||||
dry_run: ${{ github.event.inputs.dry_run }}
|
||||
@@ -1,143 +0,0 @@
|
||||
name: Build and Release RyukGram
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build RyukGram
|
||||
runs-on: macos-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Dependencies
|
||||
run: brew install ldid dpkg make
|
||||
|
||||
- name: Set PATH
|
||||
run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
|
||||
|
||||
- name: Setup Theos
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: theos/theos
|
||||
ref: master
|
||||
path: ${{ github.workspace }}/theos
|
||||
submodules: recursive
|
||||
|
||||
- name: SDK Caching
|
||||
id: SDK
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: iPhoneOS16.2.sdk
|
||||
with:
|
||||
path: ${{ github.workspace }}/theos/sdks/
|
||||
key: ${{ env.cache-name }}
|
||||
restore-keys: ${{ env.cache-name }}
|
||||
|
||||
- name: Download iOS SDK
|
||||
if: steps.SDK.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/xybp888/iOS-SDKs/
|
||||
cd iOS-SDKs
|
||||
git sparse-checkout set --no-cone iPhoneOS16.2.sdk
|
||||
git checkout
|
||||
mv *.sdk $THEOS/sdks
|
||||
env:
|
||||
THEOS: ${{ github.workspace }}/theos
|
||||
|
||||
- name: Get Version
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(awk '/Version:/ {print $2}' control)
|
||||
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
|
||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build dylib
|
||||
run: |
|
||||
export THEOS="${{ github.workspace }}/theos"
|
||||
./build.sh dylib
|
||||
ls -la packages/
|
||||
|
||||
- name: Build rootless deb
|
||||
run: |
|
||||
export THEOS="${{ github.workspace }}/theos"
|
||||
./build.sh rootless
|
||||
cd packages
|
||||
mv "$(ls -t *.deb | head -n1)" "RyukGram_${VERSION}_rootless.deb"
|
||||
ls -la
|
||||
|
||||
- name: Upload dylib artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: RyukGram_v${{ steps.version.outputs.version }}_dylib
|
||||
path: packages/RyukGram.dylib
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload deb artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: RyukGram_v${{ steps.version.outputs.version }}_rootless
|
||||
path: packages/RyukGram_${{ env.VERSION }}_rootless.deb
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Check if release
|
||||
id: check_release
|
||||
run: |
|
||||
COMMIT_MSG=$(git log -1 --pretty=%B)
|
||||
if [[ "$COMMIT_MSG" == *"[release]"* ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
||||
echo "should_release=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "should_release=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Generate release notes
|
||||
if: steps.check_release.outputs.should_release == 'true'
|
||||
id: notes
|
||||
run: |
|
||||
PENDING_FILE="PENDING_CHANGES.md"
|
||||
PREV_TAG=$(git tag --sort=-creatordate | grep -v "v${VERSION}$" | head -n1 || true)
|
||||
|
||||
{
|
||||
echo "## Changelog"
|
||||
echo ""
|
||||
if [ -f "$PENDING_FILE" ]; then
|
||||
# Drop the copy-as-commit header lines (HTML comment + [release] token)
|
||||
# so they don't appear in the published release body.
|
||||
sed -e '/^<!--/,/-->$/d' -e '/^\[release\]/d' "$PENDING_FILE"
|
||||
fi
|
||||
echo ""
|
||||
if [ -n "$PREV_TAG" ]; then
|
||||
echo "**Full changelog:** [\`${PREV_TAG}\`...\`v${VERSION}\`](https://github.com/${{ github.repository }}/compare/${PREV_TAG}...v${VERSION})"
|
||||
else
|
||||
echo "**[All commits](https://github.com/${{ github.repository }}/commits/main)**"
|
||||
fi
|
||||
} > /tmp/release_notes.md
|
||||
|
||||
- name: Create Release
|
||||
if: steps.check_release.outputs.should_release == 'true'
|
||||
id: create_release
|
||||
run: |
|
||||
# Strip [release] from commit subject for the release title
|
||||
SUBJECT=$(git log -1 --pretty=%s | sed 's/\[release\]//g' | xargs)
|
||||
TITLE="${SUBJECT:-RyukGram v${VERSION}}"
|
||||
gh release create "v${VERSION}" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--title "$TITLE" \
|
||||
--notes-file /tmp/release_notes.md \
|
||||
packages/RyukGram.dylib \
|
||||
"packages/RyukGram_${VERSION}_rootless.deb"
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
+15
-5
@@ -33,12 +33,22 @@ livecontainer
|
||||
src/**/wip.x
|
||||
src/**/wip.xm
|
||||
|
||||
.claude
|
||||
CLAUDE.md
|
||||
upstream-scinsta
|
||||
*.ipa
|
||||
*.dylib
|
||||
deploy.sh
|
||||
PENDING_CHANGES.md
|
||||
PENDING_CHANGES.md.bk
|
||||
wrapper/
|
||||
scripts/*.py
|
||||
scripts/__pycache__/
|
||||
|
||||
# FFmpegKit frameworks
|
||||
modules/ffmpegkit/
|
||||
|
||||
# External reference tweaks
|
||||
exp_flags/
|
||||
|
||||
# Source packaging
|
||||
zip-src.sh
|
||||
RyukGram-src-*.zip
|
||||
RYG*.md
|
||||
*.zip
|
||||
*_diff.txt
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "modules/FLEXing"]
|
||||
path = modules/FLEXing
|
||||
url = https://github.com/SoCuul/FLEXing
|
||||
Vendored
-19
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"editor.tabSize": 4,
|
||||
"editor.insertSpaces": true,
|
||||
"editor.trimAutoWhitespace": true,
|
||||
"editor.formatOnSave": false,
|
||||
"files.associations": {
|
||||
"*.x": "logos",
|
||||
"*.xi": "logos",
|
||||
"*.xm": "logos",
|
||||
"*.xmi": "logos",
|
||||
"*.m": "objective-c",
|
||||
"*.h": "objective-c"
|
||||
},
|
||||
|
||||
"search.exclude": {
|
||||
"modules/": true,
|
||||
"dumps/": true
|
||||
}
|
||||
}
|
||||
Vendored
-27
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"SCIUtils: Bool Pref": {
|
||||
"prefix": "scibool",
|
||||
"body": [
|
||||
"if ([SCIUtils getBoolPref:@\"${1:key}\"]) $0"
|
||||
]
|
||||
},
|
||||
"SCIUtils: String Pref": {
|
||||
"prefix": "scistring",
|
||||
"body": [
|
||||
"if ([[SCIUtils getStringPref:@\"${1:key}\"] isEqualToString:@\"${2:string}\"]) $0"
|
||||
]
|
||||
},
|
||||
|
||||
"SCIUtils: Log": {
|
||||
"prefix": "scilog",
|
||||
"body": [
|
||||
"SCILog($0);"
|
||||
]
|
||||
},
|
||||
"SCIUtils: Log Id": {
|
||||
"prefix": "scilogid",
|
||||
"body": [
|
||||
"SCILogId(@\"${1:prefix}\", $0);"
|
||||
]
|
||||
}
|
||||
}
|
||||
Vendored
-59
@@ -1,59 +0,0 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Compile tweak and deploy to LiveContainer",
|
||||
"type": "shell",
|
||||
"command": "./build-dev.sh",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "dedicated",
|
||||
"clear": true
|
||||
},
|
||||
"icon": {
|
||||
"color": "terminal.ansiCyan",
|
||||
"id": "run-all"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Build SCInsta and deploy with IPA",
|
||||
"type": "shell",
|
||||
"command": "./build-dev.sh true",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
},
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "dedicated",
|
||||
"clear": true
|
||||
},
|
||||
"icon": {
|
||||
"id": "package"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Launch pymobiledevice3 device tunnel (for quick dev builds)",
|
||||
"type": "shell",
|
||||
"command": "sudo pymobiledevice3 remote tunneld",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
},
|
||||
"presentation": {
|
||||
"reveal": "silent",
|
||||
"panel": "dedicated",
|
||||
"clear": true
|
||||
},
|
||||
"icon": {
|
||||
"color": "terminal.ansiYellow",
|
||||
"id": "debug-connected"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,674 +1,56 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
RyukGram — Proprietary Software License
|
||||
Copyright (c) Ryuk. All rights reserved.
|
||||
|
||||
1. Definitions
|
||||
"Software" means RyukGram, including the compiled tweak, its bundled
|
||||
resources, and any accompanying materials distributed by the author.
|
||||
"Author" means Ryuk, the copyright holder.
|
||||
|
||||
2. Grant
|
||||
The Author grants you a personal, non-exclusive, non-transferable,
|
||||
revocable license to download and install the compiled Software on
|
||||
devices you own or control, solely for your own personal, non-commercial
|
||||
use.
|
||||
|
||||
3. Restrictions
|
||||
You may NOT, in whole or in part:
|
||||
(a) copy, redistribute, sublicense, sell, rent, lease, or otherwise make
|
||||
the Software available to any third party;
|
||||
(b) modify, adapt, translate, or create derivative works of the Software;
|
||||
(c) decompile, disassemble, reverse-engineer, or otherwise attempt to
|
||||
derive the source code, except to the limited extent this restriction
|
||||
is prohibited by applicable law;
|
||||
(d) remove, alter, or obscure any copyright, attribution, or proprietary
|
||||
notice contained in the Software;
|
||||
(e) use the Software, or any portion of it, to build, train, or assist a
|
||||
competing product.
|
||||
|
||||
4. Contributions
|
||||
Translation files and other materials contributed to the project's public
|
||||
repository are licensed to the Author under these same terms and may be
|
||||
incorporated into current and future versions of the Software.
|
||||
|
||||
5. Ownership
|
||||
The Software is licensed, not sold. The Author retains all right, title,
|
||||
and interest in and to the Software, including all intellectual property
|
||||
rights. No rights are granted except as expressly set out here.
|
||||
|
||||
6. No Warranty
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
|
||||
7. Limitation of Liability
|
||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING
|
||||
FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR ITS USE.
|
||||
|
||||
8. Termination
|
||||
This license terminates automatically if you breach any of its terms. On
|
||||
termination you must stop using and delete all copies of the Software.
|
||||
|
||||
9. Trademarks
|
||||
Instagram is a trademark of its respective owner. RyukGram is an
|
||||
independent project and is not affiliated with, endorsed by, or sponsored
|
||||
by Instagram or Meta. RyukGram was inspired by, but shares no source code
|
||||
with, other Instagram tweaks.
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
TARGET := iphone:clang:16.2
|
||||
INSTALL_TARGET_PROCESSES = Instagram
|
||||
ARCHS = arm64
|
||||
|
||||
include $(THEOS)/makefiles/common.mk
|
||||
|
||||
TWEAK_NAME = RyukGram
|
||||
|
||||
$(TWEAK_NAME)_FILES = $(shell find src -type f \( -iname \*.x -o -iname \*.xm -o -iname \*.m \)) $(wildcard modules/JGProgressHUD/*.m) modules/fishhook/fishhook.c
|
||||
$(TWEAK_NAME)_FRAMEWORKS = UIKit Foundation CoreGraphics Photos CoreServices SystemConfiguration SafariServices Security QuartzCore AVFoundation UniformTypeIdentifiers
|
||||
$(TWEAK_NAME)_PRIVATE_FRAMEWORKS = Preferences
|
||||
$(TWEAK_NAME)_CFLAGS = -fobjc-arc -Wno-unsupported-availability-guard -Wno-unused-value -Wno-deprecated-declarations -Wno-nullability-completeness -Wno-unused-function -Wno-incompatible-pointer-types
|
||||
$(TWEAK_NAME)_LOGOSFLAGS = --c warnings=none
|
||||
|
||||
CCFLAGS += -std=c++11
|
||||
|
||||
include $(THEOS_MAKE_PATH)/tweak.mk
|
||||
|
||||
# Build FLEXing for sideloading (not building in dev-mode)
|
||||
ifdef SIDELOAD
|
||||
$(TWEAK_NAME)_SUBPROJECTS += modules/flexing
|
||||
endif
|
||||
@@ -0,0 +1,110 @@
|
||||
[release] RyukGram v1.3.3
|
||||
|
||||
Updated for Instagram 439.0.0.
|
||||
|
||||
### ✨ Highlights
|
||||
- **Call recording** — record voice and video calls, with auto-record, smart video grids and a per-person browser to play them back
|
||||
- **Activity notifications** — one log for who read your messages plus who came online, went offline or started typing, per person, with an accurate green dot
|
||||
- **Grid feed** — turn your home feed into a tappable grid of thumbnails with stats and author overlays, per account
|
||||
- **Stories archive** — saves every story you post before it expires, with its media and full viewer list, per account
|
||||
- **Story viewers list** — a searchable, filterable, sortable and pinnable "who viewed my story", with each viewer's reaction shown
|
||||
- **Instagram Plus** — turn on some Instagram's paid subscriber features inside the app
|
||||
- **Custom button icons** — pick any Instagram icon or iOS symbol for the action and home-shortcut buttons
|
||||
|
||||
### 🆕 New features
|
||||
|
||||
#### Messages
|
||||
- Activity notifications and Activity log — records who read your messages plus who came online, went offline or started typing, as a per-person timeline. Set each event to log silently, notify you, or both, and hold anyone to customise or mute them. A new accurate active-status option turns the green dot off the moment someone leaves. Filter by type and date, swipe or multi-select to delete, and lock the log behind your passcode
|
||||
- A dot in the DMs inbox to turn your active status on or off without opening settings
|
||||
- Keep deleted messages can now also keep the ones you unsend yourself, shown faded in chat and added to the deleted log
|
||||
- Mark chats seen locally — with read-receipt blocking on, opened chats look read on your device while the sender still gets no receipt; the eye button turns orange until you really mark seen
|
||||
- Hold the account name at the top of Direct to show or hide your hidden chats, with an optional passcode/Face ID lock
|
||||
- Messages-only mode is now its own menu, can turn on automatically during a daily window, and adds a notifications shortcut plus an optional home-shortcut button in the inbox header
|
||||
- Adding someone to a list (read-receipt blocking, hidden or locked chats, chat backgrounds, story viewer pins) now opens a picker of recent DMs with username search, instead of typing it in blind
|
||||
- The DM Draw feature can now send an image as your doodle — from the gallery, Photos, your Instagram or iOS stickers, or a pasted image — with an editor to crop, resize and remove the background
|
||||
- Custom chat backgrounds can now be videos or GIFs, framed with pan-zoom and trim, with the same opacity, blur and dim controls, and re-editable later
|
||||
- Hide suggested accounts and channels in Direct messages search
|
||||
|
||||
#### Stories
|
||||
- Stories archive saves every story you post before it expires, with its media and full viewer list, per account. Browse by date in a grid, see who viewed, liked or reacted, with filter, sort, pinned viewers, an unread badge, optional alerts and its own backup and storage entry
|
||||
- The "who viewed my story" list is now searchable — filter (mutuals, following, follows you, verified, reacted, pinned), sort, and pin anyone to the top. Shows avatars, verified badges and each viewer's reaction, loads every viewer, and can switch back to Instagram's own list. Pick which one opens first
|
||||
- Marked-seen indicator — stories you already marked as seen hide the eye button or fill it green for 48 hours, per account
|
||||
- New "Save image (no music)" story download option for photo stories that have Instagram music on them
|
||||
- Story tray long-press "Profile picture" now also works in Instagram's new subscriber story preview menu
|
||||
|
||||
#### Reels
|
||||
- New reels playback menu — hold the ⋯ or audio button for speed, seek (skip back/forward by a custom amount) and auto-scroll controls
|
||||
- Auto-scroll reels is back — Instagram default or RyukGram mode that keeps advancing after you swipe back
|
||||
- Filter reels by engagement — set a minimum for likes, comments, views or reposts and reels below it never show, plus an option to hide reels whose author hides their counts. Only the Reels tab is filtered by default, so reels you open from a post, profile or share stay untouched
|
||||
- Show when a reel was reposted — an optional date on the "reposted this reel" header
|
||||
|
||||
#### Feed & Explore
|
||||
- New Grid feed — turn your home feed into a grid of post thumbnails showing likes, comments, views, shares and the author. Pinch to change columns, pull to refresh, tap a post to open it, or hold for a menu to like, follow, view profile, expand, share or copy the link. Choose which stats show, square or taller tiles, and how you switch back to Instagram's feed. Loads instantly, works per account and remembers where you left off
|
||||
- Search and explore grids now show stat pills on posts and reels — views, likes, comments, shares, reposts and date — with a page to pick which appear, reorder them and toggle them
|
||||
- New date format options — swap Instagram's relative timestamps on posts, notes, comments, stories and DMs for a fixed date, a preset like dd/MM/yyyy, or your own template, with a relative-time threshold
|
||||
- New "Block surveys" toggle — hides Instagram's in-app surveys and feedback prompts, including the "Interested in this post?" cards
|
||||
- Confirm feed refresh — an optional alert before a pull-to-refresh reloads the home feed
|
||||
- Refresh stories only — pull-to-refresh reloads just the stories tray and leaves the feed where it is
|
||||
|
||||
#### Instants
|
||||
- Instants download now works on videos too — expand, save, share and download-all all handle video instants
|
||||
- Send a video from your gallery as an Instant — frame it square, trim any 7 seconds on a scrollable timeline, then hold to record
|
||||
- Confirm before capturing an Instant — an optional alert on a photo tap or held video, plus a confirm before tapping to switch Instants
|
||||
- Auto close the Instants viewer once you've seen them all
|
||||
|
||||
#### Downloads & Gallery
|
||||
- Download manager got a rebuild — thumbnails for finished media, live size, speed and time left, a filter row, and swipe a row to cancel, retry or remove
|
||||
- Downloads now stay listed after you close the app and can be downloaded again from the history — kept from 12 hours up to forever, and cleared or exported from Backup and Storage
|
||||
- Download quality picker has an advanced view — download a video with no audio, or pick any of its audio tracks
|
||||
- Gallery — import your own photos, videos and files from the ••• menu, saved under an Imported filter
|
||||
- Gallery browsing got more controls — combine a sort with images, videos or favorites first, filter by date, pick 2 to 5 columns, and long-press a user section to select all their media
|
||||
- The gallery now uses Instagram icons throughout, grid tiles show a date chip, and long-pressing an item shows its date, source and size
|
||||
|
||||
#### Profile
|
||||
- Profile card details now also show comment, share and repost counts, with a page to pick which stats appear, reorder them and toggle them
|
||||
- Followers and Following lists get a filter and sort button on Instagram's search bar — mutuals, following, follows you or verified, sorted by name or relationship
|
||||
- Profile Analyzer's badge now shows gains and losses — a green +N when a list grew, a red −N when it shrank
|
||||
- Profile Analyzer is out of beta
|
||||
|
||||
#### Interface & notifications
|
||||
- Action button and home-shortcut icons are now fully customisable — a searchable browser for any Instagram icon or iOS symbol, per button or shared, including Instagram's colourful pet stickers
|
||||
- Tab bar icon order is now a live tab bar preview — drag to reorder, drag one up to hide, tap a hidden icon to add it back
|
||||
- Story and disappearing-media overlay buttons can be repositioned by dragging them on a preview
|
||||
- The notification pill can be placed anywhere on a phone preview, not just top or bottom
|
||||
- Notifications mirrored to the iOS notification centre can now also show as system banners while you're using the app
|
||||
- The home shortcut button shows a red dot for new deleted messages, read receipts or call recordings, with a count next to each in its menu
|
||||
- Favorite GIFs long-press menu can now copy a GIF's link
|
||||
|
||||
#### Privacy & backup
|
||||
- Device ID masking now also hides the vendor ID and machine ID, can block Apple device attestation, and can reset fresh while keeping masking on. A Device ID button on the login screen gives the same controls while signed out
|
||||
- Follow requests tracker shows a badge for updates you haven't opened yet
|
||||
- Backup's "Feature data" now opens a list where you tick exactly which stores to export, import or reset, instead of all-or-nothing
|
||||
- Backups can be locked with a password when exporting (AES-256), asked for only when you restore them
|
||||
|
||||
#### General
|
||||
- Change Instagram's own interface language from the tweak — a picker with a full language list, including Arabic even if your device isn't set to it; restart to apply
|
||||
- New Instagram Plus menu in General — turns on Instagram's paid subscriber features inside the app, including story and message peek, fonts, the app icon picker and custom story lists, with a master on/off and reset
|
||||
- Tweak settings shows an occasional donate prompt after long-term use, easily dismissed or hidden for good
|
||||
|
||||
### 🛠 Fixes
|
||||
- Tapping someone in any RyukGram list now opens their profile inside RyukGram, so Back returns to the list instead of Instagram's home
|
||||
- Your gallery carries over to this update, with a one-time prompt to restore items saved by an older version, and gallery backups now import and export every item
|
||||
- The home shortcut button now shows on iPad
|
||||
- Custom chat background now fills behind the message input on Instagram 437 instead of leaving a black strip
|
||||
- Follow requests tracker no longer counts tapping "Following" on an already-followed account as a new request
|
||||
- Follow requests tracker no longer wrongly shows received requests as withdrawn, and loads pending requests reliably
|
||||
- Detailed color picker no longer crashes in the story drawing editor on Instagram 434
|
||||
- OLED theme no longer turns the RyukGram settings screens fully black
|
||||
- OLED theme no longer blacks out grey buttons like Follow/Following on profiles
|
||||
- Downloading reels or videos with newer Instagram audio (xHE-AAC) no longer fails
|
||||
- Feed scrolling is smoother, especially with the OLED theme enabled
|
||||
- Favorite GIFs now send and appear reliably in Direct messages
|
||||
- Deleted messages log now saves photos and videos at full quality instead of a low-res thumbnail
|
||||
- Deleted messages log no longer crashes when you pull to refresh right after leaving a chat
|
||||
- Reroute native Save now shows Instagram's Save and long-press Save on DM media even where Instagram hid them, including in vanish mode
|
||||
- Settings that need a restart now take effect after one restart instead of sometimes needing two
|
||||
- Auto-clear cache now runs reliably on the chosen interval and finishes even if you close Instagram mid-clear
|
||||
- Saving or sharing media now always uses a clean name (like username_stories_date) instead of the internal temporary filename
|
||||
- Reels action button stays visible on HDR reels, following Instagram's own tint like the like button does
|
||||
- No more crash when switching to the Reels tab on some accounts
|
||||
- Bulk saving Instants now labels each save with the account that posted it, even with several people's Instants on screen
|
||||
@@ -1,193 +1,279 @@
|
||||
<div align="center">
|
||||
|
||||
# RyukGram
|
||||
A feature-rich iOS tweak for Instagram, forked from [SCInsta](https://github.com/SoCuul/SCInsta) with additional features and fixes.\
|
||||
`Version v1.1.4` | `Tested on Instagram 424.0.0`
|
||||
|
||||
**The Instagram tweak for iOS power users.**
|
||||
|
||||
`v1.3.3` · Instagram 439.0.0 | Instagram 410.1.0
|
||||
|
||||
<sub>The Instagram 410 build is for older devices and trails the main build on newer features.</sub>
|
||||
|
||||
<p>
|
||||
<a href="https://github.com/faroukbmiled/RyukGram/releases/latest"><img src="https://img.shields.io/badge/Download-Latest%20release-7C3AED?style=for-the-badge&labelColor=1F2430" alt="Latest release" height="32"></a>
|
||||
<a href="https://t.me/ryukgram"><img src="https://img.shields.io/badge/Telegram-Channel-2AABEE?style=for-the-badge&labelColor=1F2430" alt="Telegram" height="32"></a>
|
||||
<a href="https://buymeacoffee.com/axryuk"><img src="https://img.shields.io/badge/Donate-Support%20the%20project-E5484D?style=for-the-badge&labelColor=1F2430" alt="Donate" height="32"></a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="https://github.com/faroukbmiled/RyukGram/issues">Issues</a>
|
||||
·
|
||||
<a href="#translating">Translate</a>
|
||||
·
|
||||
<a href="#features">Features</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
> [!NOTE]
|
||||
> To modify RyukGram's settings, check out [this section below](#opening-tweak-settings) for help
|
||||
> RyukGram is [closed source](#credits) for now and will open up again later. Builds and translations stay current here.
|
||||
|
||||
## Install
|
||||
|
||||
### Add it in one tap
|
||||
|
||||
<div align="center">
|
||||
|
||||
<a href="https://store.ryuksign.com"><img src="https://img.shields.io/badge/Add%20RyukGram-store.ryuksign.com-7C3AED?style=for-the-badge&labelColor=1F2430" alt="Add RyukGram" height="36"></a>
|
||||
|
||||
</div>
|
||||
|
||||
Open it on your phone and everything is one tap away. Add it once and updates arrive on their own.
|
||||
|
||||
- **Sideload.** Adds the source to **Feather** or **RyukSign**, **SideStore**, or **AltStore**. Pick the **plugins** build normally, or **no plugins** if you sign with a free Apple account, since free accounts cannot sign the bundled extensions.
|
||||
- **Jailbreak.** Adds the repo to **Sileo** or **Zebra**, then installs the build that matches your setup. To paste it by hand the repo is `https://source.ryuksign.com/apt/`.
|
||||
|
||||
### Build your own IPA
|
||||
|
||||
Instagram itself cannot be bundled here, so you bring the Instagram IPA and the build slots RyukGram into it.
|
||||
|
||||
**With GitHub Actions, no Mac needed.** Fork this repo, open the **Actions** tab, and run **Build sideloaded IPA from Release Assets**. Give it your Instagram IPA and it hands back a patched IPA ready to sign and install. Turn on the no-plugins option if you sign with a free account.
|
||||
|
||||
**Or by hand** with a tool like cyan, injecting into your own Instagram IPA:
|
||||
- Regular build. Inject `zxPluginsInject.dylib` into the app and its plugins. The normal one, with the bundled extensions.
|
||||
- No-plugins build. Inject `NoPluginsPatch.dylib` instead. For a plugin free sideload, or a free account where extensions cannot be signed.
|
||||
|
||||
### Download the .deb
|
||||
|
||||
Prefer the file? Both builds are on the [latest release](https://github.com/faroukbmiled/RyukGram/releases/latest).
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th align="left">File</th>
|
||||
<th align="left">Build</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>RyukGram_x.x.x_rootless.deb</code></td>
|
||||
<td>Rootless</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>RyukGram_x.x.x_rootful.deb</code></td>
|
||||
<td>Rootful</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
The rootless .deb also carries the dylib and bundle the sideload builds use.
|
||||
|
||||
### TrollStore
|
||||
|
||||
Download `RyukGram_trollfools.zip` from the [latest release](https://github.com/faroukbmiled/RyukGram/releases/latest) and inject it into Instagram with TrollFools.
|
||||
|
||||
---
|
||||
|
||||
# Installation
|
||||
>[!IMPORTANT]
|
||||
> Which type of device are you planning on installing this tweak on?
|
||||
> - Jailbroken/TrollStore device -> [Download pre-built tweak](https://github.com/faroukbmiled/RyukGram/releases/latest)
|
||||
> - Standard iOS device -> Sideload the dylib using Feather or similar
|
||||
Once it is running, open the settings by holding the button at the top of your profile, or the home button in the tab bar. Screenshots are [below](#opening-settings).
|
||||
|
||||
# Features
|
||||
> Features marked with **\*** are new or improved in RyukGram
|
||||
## Features
|
||||
|
||||
### General
|
||||
- Hide ads
|
||||
- Hide Meta AI
|
||||
- Copy description
|
||||
- Copy comment text from long-press menu **\***
|
||||
- Download GIF comments **\***
|
||||
- Profile copy button **\***
|
||||
- Replace domain in shared links — rewrite copied/shared links for embeds in Discord, Telegram, etc. with preset or custom domains **\***
|
||||
- Strip tracking params from shared links (igsh, utm) **\***
|
||||
- Open links in external browser **\***
|
||||
- Strip tracking from browser links **\***
|
||||
- Do not save recent searches
|
||||
- Use detailed (native) color picker
|
||||
- Enable liquid glass buttons
|
||||
- Enable teen app icons
|
||||
- IG Notes:
|
||||
- Hide notes tray
|
||||
- Hide friends map
|
||||
- Enable note theming
|
||||
- Custom note themes
|
||||
- Focus/Distractions
|
||||
- No suggested users
|
||||
- No suggested chats
|
||||
- Hide trending searches
|
||||
- Hide explore posts grid
|
||||
- Hide ads, Meta AI, and like, comment and share counts
|
||||
- Hide the TestFlight popup and turn off app haptics
|
||||
- Copy captions, comment text, and profile info
|
||||
- Download, copy, or expand image and GIF comments
|
||||
- Send any Giphy link as a comment GIF, and pin the ones you favorite
|
||||
- Download audio from the reels audio page
|
||||
- Clean shared links for embeds and strip their tracking
|
||||
- Open links in an external browser or straight from the clipboard
|
||||
- Native color picker and teen app icons
|
||||
- Liquid glass controls, with a force off switch and tab bar behavior
|
||||
- Instagram Plus turns on Instagram's own paid features
|
||||
- Notes tweaks: hide the tray, hide the friends map, custom themes
|
||||
- Drop suggestions, trending, the explore grid, sensitive covers, and surveys
|
||||
- Stat pills on search and explore, with a page to pick and reorder them
|
||||
- Anonymous live viewing and toggleable live comments
|
||||
- Redact RyukGram's own buttons in screenshots and recordings
|
||||
|
||||
### Feed
|
||||
- Hide stories tray
|
||||
- Hide entire feed
|
||||
- No suggested posts
|
||||
- No suggested for you (accounts)
|
||||
- No suggested reels
|
||||
- No suggested threads posts
|
||||
- Disable video autoplay
|
||||
- Hide repost button in feed **\***
|
||||
- Grid feed turns your home feed into thumbnails, each with its stats and author
|
||||
- Pick which stats show and their order, tile shape, columns by pinch, and the date format
|
||||
- Hold a tile to preview it, or to like, follow, expand, share, or copy the link
|
||||
- Switch back to Instagram's feed from the header heart or a floating button you place
|
||||
- Hide the stories tray, suggested stories, and highlights
|
||||
- View a profile picture from a story tray long press
|
||||
- Hide the whole feed, or just suggested posts, accounts, reels, and threads
|
||||
- Turn off video autoplay
|
||||
- Long press any media to open it full screen, muted if you want
|
||||
- Custom date format with your own template and relative times
|
||||
- Turn off background and home button refresh
|
||||
- Confirm before a pull to refresh, or refresh only the stories tray
|
||||
- Hide the feed repost button
|
||||
|
||||
### Reels
|
||||
- Modify tap controls
|
||||
- Always show progress scrubber
|
||||
- Disable auto-unmuting reels (properly blocks mute switch, volume buttons, and announcer broadcasts) **\***
|
||||
- Confirm reel refresh
|
||||
- Unlock password-locked reels **\***
|
||||
- Hide reels header
|
||||
- Hide repost button in reels **\***
|
||||
- Hide reels blend button
|
||||
- Disable scrolling reels
|
||||
- Prevent doom scrolling (limit maximum viewable reels)
|
||||
- Enhanced Pause/Play mode (when Pause/Play tap control is set): **\***
|
||||
- Mute toggle auto-hidden, only play/pause icon visible
|
||||
- Audio forced on in reels tab
|
||||
- Play indicator properly hidden when video plays (fixes IG bug after hold/zoom)
|
||||
- Playback toggle synced with overlay during hold/zoom
|
||||
- Works across IG A/B test variants
|
||||
- Custom tap controls and an auto scroll mode
|
||||
- Playback menu for speed, seek, and auto scroll
|
||||
- Always visible scrubber, no auto unmute, and refresh confirmation
|
||||
- Unlock password locked reels
|
||||
- Hide the header, repost button, friend avatars, and promo pills
|
||||
- Swipe left to open the author's profile
|
||||
- Show the repost date
|
||||
- Disable scrolling and cap how many reels you can watch in a row
|
||||
- Filter the reels feed by minimum likes, comments, views, or reposts
|
||||
- Enhanced pause and play mode
|
||||
|
||||
### Action buttons
|
||||
- Context aware menus on feed, reels, stories, DMs, and profiles
|
||||
- Configurable default tap, and a searchable browser of Instagram and system icons
|
||||
- Carousel and multi story bulk download
|
||||
- Save a photo post with its music as a video
|
||||
- Save a photo story as just the image
|
||||
- Repost through Instagram's own flow
|
||||
- Full screen viewer with zoom and swipe
|
||||
- Drag to arrange your overlay buttons on a live preview
|
||||
|
||||
### Profile
|
||||
- Zoom or save the profile picture
|
||||
- View highlight covers from a long press
|
||||
- Action button for info, the picture, and follower stats
|
||||
- Follow indicator that shows who follows you back
|
||||
- Copy notes, fake your stats, and reveal full counts
|
||||
- Sort and search follower and following lists by mutuals, verified, and more
|
||||
- Follow request tracker that logs every request, even ones cancelled before you answer
|
||||
|
||||
### Profile analyzer
|
||||
- Follower and following scans, with mutuals and non followbacks
|
||||
- New and lost trackers across scans
|
||||
- Change history for name, username, bio, and picture
|
||||
- Inline and batch follow, unfollow, and remove
|
||||
- A log of every profile you open, with filters
|
||||
- Per check toggles, with a badge for gains and losses since your last look
|
||||
|
||||
### Saving
|
||||
- Download feed posts (photo + video)
|
||||
- Download reels
|
||||
- Download stories
|
||||
- Save profile picture
|
||||
- Download buttons on media — tap a button directly on feed posts, reels sidebar, and story overlay **\***
|
||||
- Download method — choose between download button or long-press gesture **\***
|
||||
- Download highlight cover from profile long-press menu **\***
|
||||
- Save action — choose between share sheet or save directly to Photos **\***
|
||||
- Save to RyukGram album — optional toggle that routes downloads (and share-sheet "Save to Photos" picks) into a dedicated "RyukGram" album in Photos **\***
|
||||
- Download confirmation — optional confirmation dialog before downloading **\***
|
||||
- Non-blocking download HUD — pill-style progress at the top, tap to cancel **\***
|
||||
- Debug fallback — if IG updates break downloads, shows diagnostic info instead of crashing **\***
|
||||
- *Customize finger count for long-press*
|
||||
- *Customize hold time for long-press*
|
||||
- HD downloads up to 1080p, with a quality picker and preview
|
||||
- Audio only and raw photo options
|
||||
- Download manager with live speed, filters, swipe actions, and bulk select
|
||||
- Download history that survives a restart, with redownload and a keep window
|
||||
- Auto retry for downloads that drop offline
|
||||
- Save into a dedicated RyukGram album
|
||||
- Advanced encoding panel for codec, bitrate, resolution, and more
|
||||
- Clean filenames on every save
|
||||
- Optional download confirmation
|
||||
|
||||
### Gallery
|
||||
- A private in app library that every download can mirror into
|
||||
- Images, video, audio, and animated GIFs
|
||||
- Filter by type, source, uploader, date, and favorites, with folders
|
||||
- Sort by date, name, or size, with images, videos, or favorites first
|
||||
- Group by user into sections or folders, from 2 to 5 columns
|
||||
- Long press a user section to select all their media
|
||||
- In app preview carousel
|
||||
- Pull audio and GIFs straight from the gallery
|
||||
- Import your own photos, videos and files into the gallery
|
||||
- Grid tiles show a date chip, long press an item for its date, source and size
|
||||
|
||||
### Stories and messages
|
||||
- Keep deleted messages (preserves unsent messages with visual indicator and notification pill) **\***
|
||||
- Hide trailing action buttons on preserved messages
|
||||
- Warn before clearing on refresh — optional confirmation when pulling to refresh the DMs tab if preserved messages would be cleared **\***
|
||||
- Manually mark messages as seen (button or toggle mode) **\***
|
||||
- Long-press the seen button for quick actions **\***
|
||||
- Auto mark seen on send (marks messages as read when you send any message) **\***
|
||||
- Auto mark seen on typing (marks messages as read the moment you start typing, even when typing status is hidden) **\***
|
||||
- Mark seen on story like **\***
|
||||
- Advance to next story when marking as seen — tapping the eye button auto-skips to the next story **\***
|
||||
- Advance on story like — liking a story auto-skips to the next one **\***
|
||||
- Per-chat read-receipt list with blocking mode — "Block all" (exclude list) or "Block selected only" (include list). Long-press any DM chat to add/remove. Settings page with search, sort, multi-select, and per-entry keep-deleted override **\***
|
||||
- Send audio as file — send audio files as voice messages from the DM plus menu **\***
|
||||
- Download voice messages — adds a Download option to the long-press menu on voice messages, saves as M4A via share sheet **\***
|
||||
- Disable typing status
|
||||
- Unlimited replay of direct stories
|
||||
- Disable view-once limitations
|
||||
- Disable screenshot detection
|
||||
- Disable story seen receipt (blocks network upload, toggleable at runtime without restart) **\***
|
||||
- Keep stories visually unseen — keeps the colorful ring in the tray after viewing **\***
|
||||
- Manual mark story as seen — button on story overlay to selectively mark stories as seen (button or toggle mode) **\***
|
||||
- Long-press the story seen button for quick actions **\***
|
||||
- Per-user story seen-receipt list with blocking mode — "Block all" (exclude list) or "Block selected only" (include list). Manage via 3-dot menu, eye button long-press, or settings list **\***
|
||||
- Story audio mute/unmute toggle — button on the story overlay and 3-dot menu to toggle audio **\***
|
||||
- Stop story auto-advance — stories won't auto-skip when the timer ends **\***
|
||||
- Story download button — download directly from the story overlay **\***
|
||||
- Download disappearing DM media (photos + videos) **\***
|
||||
- Mark disappearing messages as viewed button **\***
|
||||
- Upload audio as voice message — send audio files, extract audio from videos, with built-in trim editor **\***
|
||||
- Disable instants creation
|
||||
- Keep deleted messages, including your own unsends
|
||||
- A full quality log of every unsent message, grouped by chat and searchable
|
||||
- Activity notifications for reads, online, offline, and typing, set per person
|
||||
- An activity log that keeps it all as a timeline, filterable and swipe to delete
|
||||
- Accurate active status so the green dot turns off the moment someone leaves
|
||||
- Manual and automatic mark as seen
|
||||
- Mark chats seen on your device only, the eye button stays orange until you really send it
|
||||
- Stories you already marked seen hide or tint the eye button for 48 hours
|
||||
- Send audio as a file or a voice note, with a trim editor
|
||||
- Send an image as your doodle in Draw, with a crop, resize, and background remover
|
||||
- Download voice messages
|
||||
- Turn off typing status, the vanish swipe, and view once limits
|
||||
- Toggle your activity status from a dot in the DMs inbox
|
||||
- Custom chat backgrounds from an image, video, or GIF, with a built in editor
|
||||
- Filter, sort, search, and pin story viewers, and see who reacted with what
|
||||
- Archive your own stories before they expire, viewer list included, per account
|
||||
- View story mentions and reveal poll and quiz results
|
||||
- Bypass Reveal stickers and pick custom sticker colors
|
||||
- Download disappearing DM media in full quality
|
||||
- Send Instants from your album, with crop and trim editors
|
||||
- Auto close the Instants viewer once you have seen them all
|
||||
- Toggle the Instants switch confirmation from a button in the viewer
|
||||
- Record voice and video calls into an adaptive grid, browsed per person
|
||||
|
||||
### Navigation
|
||||
- Modify tab bar icon order
|
||||
- Modify swiping between tabs
|
||||
- Hiding tabs
|
||||
- Hide feed tab
|
||||
- Hide explore tab
|
||||
- Hide reels tab
|
||||
- Hide create tab
|
||||
### Interface
|
||||
- A universal notification pill you can place anywhere on screen
|
||||
- Mirror toasts to the iOS notification centre, in the background or while the app is open
|
||||
- Reorder and hide tab bar icons on a live tab bar preview
|
||||
- Messages only mode, with a daily schedule and inbox header shortcuts
|
||||
- Force Instagram into any supported language
|
||||
- Home shortcut button with new item badges
|
||||
- Experimental flags
|
||||
|
||||
### Confirm actions
|
||||
- Confirm like: Posts/Stories
|
||||
- Confirm like: Reels
|
||||
- Confirm follow
|
||||
- Confirm repost
|
||||
- Confirm call
|
||||
- Confirm voice messages
|
||||
- Confirm follow requests
|
||||
- Confirm shh mode (disappearing messages)
|
||||
- Confirm posting comment
|
||||
- Confirm changing direct message theme
|
||||
- Confirm sticker interaction
|
||||
- Optional confirmations for likes, follows, reposts, calls, comments, and more
|
||||
|
||||
### Tweak settings **\***
|
||||
- Search bar in the main settings page — recursively finds any setting across nested pages with a breadcrumb to its location
|
||||
- Pause playback when opening settings (toggleable) **\***
|
||||
- Quick-access via long-press on feed tab **\***
|
||||
### Fake location
|
||||
- Override your location across the app, with a map picker and saved presets
|
||||
|
||||
### Backup & Restore **\***
|
||||
- Export RyukGram settings as a JSON file
|
||||
- Import settings from a JSON file
|
||||
- Searchable, collapsible, editable preview before saving or applying
|
||||
### Theme
|
||||
- Off, light, dark, or OLED, applied to Instagram only
|
||||
- OLED chat theme and a matching keyboard theme
|
||||
|
||||
### Security and privacy
|
||||
- Mask the device identifiers Instagram reads, from settings or the login screen
|
||||
- Passcode and biometric lock for settings, chats, logs, recordings, and the app itself
|
||||
- Hidden chats and per account lists
|
||||
- App switcher shroud and hidden previews for locked chats
|
||||
|
||||
### Backup and restore
|
||||
- Export your settings and feature data as JSON or an encrypted bundle
|
||||
- Restore with replace or merge
|
||||
- Scope any export, import, or reset to the accounts you pick
|
||||
- See what RyukGram keeps on your device, by section and account, and clear it
|
||||
|
||||
### Localization
|
||||
- English, Spanish, French, Russian, Korean, Japanese, Arabic, Vietnamese, Chinese, Portuguese, and Turkish
|
||||
- In app language picker, with English as the fallback
|
||||
|
||||
### Optimization
|
||||
- Automatically clears unneeded cache folders, reducing the size of your Instagram installation
|
||||
- Clear the Instagram cache on demand or on a timer
|
||||
- Smoother feed scrolling
|
||||
|
||||
## Known Issues
|
||||
- Preserved unsent messages cannot be removed using "Delete for you". Pull to refresh in the DMs tab clears all preserved messages (with optional confirmation if "Warn before clearing on refresh" is enabled).
|
||||
- "Delete for you" detection uses a ~2 second window after the local action. If a real other-party unsend happens to land in the same window, it may not be preserved. Rare in practice and limited to that specific overlap.
|
||||
## Translating
|
||||
|
||||
# Opening Tweak Settings
|
||||
Want RyukGram in your language? Export the strings from **Settings, Debug, Localization**, translate the right side of each `"key" = "value";` line, and open a pull request with your file at `src/Localization/Resources/<code>.lproj/Localizable.strings`. Keep the format specifiers like `%@` and `%lu` exactly as they are. Missing lines fall back to English, so partial work is welcome. Anything you contribute is licensed to the project under the same terms as RyukGram.
|
||||
|
||||
## Opening settings
|
||||
|
||||
| | |
|
||||
|:-------------------------------------------:|:-------------------------------------------:|
|
||||
| <img src="https://i.imgur.com/uPMcugZ.png"> | <img src="https://i.imgur.com/ctIiL7i.png"> |
|
||||
| <img src="https://i.imgur.com/OnjLpZK.png"> | <img src="https://i.imgur.com/pHIuYTm.jpeg"> |
|
||||
|
||||
# Building from source
|
||||
### Prerequisites
|
||||
- XCode + Command-Line Developer Tools
|
||||
- [Homebrew](https://brew.sh/#install)
|
||||
- [CMake](https://formulae.brew.sh/formula/cmake#default) (`brew install cmake`)
|
||||
- [Theos](https://theos.dev/docs/installation)
|
||||
- [cyan](https://github.com/asdfzxcvbn/pyzule-rw?tab=readme-ov-file#install-instructions) **\*only required for sideloading**
|
||||
- [ipapatch](https://github.com/asdfzxcvbn/ipapatch/releases/latest) **\*only required for sideloading**
|
||||
## Credits
|
||||
|
||||
### Setup
|
||||
1. Install iOS 16.2 frameworks for theos
|
||||
1. [Click to download iOS SDKs](https://github.com/xybp888/iOS-SDKs/archive/refs/heads/master.zip)
|
||||
2. Unzip, then copy the `iPhoneOS16.2.sdk` folder into `~/theos/sdks`
|
||||
2. Clone repo: `git clone --recurse-submodules https://github.com/faroukbmiled/RyukGram`
|
||||
3. **For sideloading**: Download a decrypted Instagram IPA from a trusted source, making sure to rename it to `com.burbn.instagram.ipa`.
|
||||
Then create a folder called `packages` inside of the project folder, and move the Instagram IPA file into it.
|
||||
RyukGram got its start from [SCInsta](https://github.com/SoCuul/SCInsta) by [@SoCuul](https://github.com/SoCuul), and I'm grateful for the foundation it gave the project. That code has since been fully rewritten and none of it remains, so RyukGram is its own separate codebase. It went closed source because earlier releases were being lifted and resold as paid tweaks, which is something I can't keep feeding, and I know some of you valued it staying open. Thanks to @SoCuul and the wider iOS tweak scene for paving the way.
|
||||
|
||||
### Run build script
|
||||
```sh
|
||||
$ chmod +x build.sh
|
||||
$ ./build.sh <sideload/rootless/rootful>
|
||||
```
|
||||
- [**@SoCuul**](https://github.com/SoCuul) for SCInsta, the spark for this project
|
||||
- [**@BandarHL**](https://github.com/BandarHL) for BHInstagram
|
||||
- [**@VAXMG**](https://t.me/ciesIPAs) for OLED theme inspiration
|
||||
- [**@euoradan**](https://t.me/euoradan) for experiment flag research
|
||||
- [**@n3d1117**](https://github.com/n3d1117) for the Following feed
|
||||
- [**BillyCurtis**](https://github.com/BillyCurtis/OpenInstagramSafariExtension) for the Safari extension base
|
||||
- [**@asdfzxcvbn**](https://github.com/asdfzxcvbn) for ipapatch and zxPluginsInject
|
||||
- Furamako, [@ZomkaDEV](https://github.com/ZomkaDEV), [@ch1tmdgus](https://github.com/ch1tmdgus), [@bruuhim](https://github.com/bruuhim), [@jaydenjcpy](https://github.com/jaydenjcpy), [@brunorainha](https://github.com/brunorainha), [@yesnt10](https://github.com/yesnt10), [@tranbinh02](https://github.com/tranbinh02), [@yannouuuu](https://github.com/yannouuuu), and [@willybilly981](https://github.com/willybilly981) for translations
|
||||
|
||||
# Credits
|
||||
- [SCInsta](https://github.com/SoCuul/SCInsta) by [@SoCuul](https://github.com/SoCuul) — original tweak this fork is based on
|
||||
- [@BandarHL](https://github.com/BandarHL) — creator of the original BHInstagram project
|
||||
- [@faroukbmiled](https://github.com/faroukbmiled) — RyukGram modifications and additional features
|
||||
## Support
|
||||
|
||||
If RyukGram earns a spot on your phone, you can keep it going here.
|
||||
|
||||
<div align="center">
|
||||
|
||||
<a href="https://buymeacoffee.com/axryuk"><img src="https://img.shields.io/badge/Donate-Support%20the%20project-E5484D?style=for-the-badge&labelColor=1F2430" alt="Donate" height="32"></a>
|
||||
<a href="https://github.com/faroukbmiled/RyukGram"><img src="https://img.shields.io/badge/Star-the%20repo-6B7280?style=for-the-badge&labelColor=1F2430" alt="Star the repo" height="32"></a>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Filter</key>
|
||||
<dict>
|
||||
<key>Bundles</key>
|
||||
<array>
|
||||
<string>com.burbn.instagram</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
echo 'Note: This script is meant to be used while developing the tweak.'
|
||||
echo ' This does not build "libflex" or "FLEXing", they must be built manually and moved to ./packages'
|
||||
echo
|
||||
|
||||
if [ "$1" == "true" ];
|
||||
then
|
||||
_scinsta_dev_before
|
||||
|
||||
# Build tweak and package into ipa
|
||||
./build.sh sideload --dev
|
||||
|
||||
_scinsta_dev_after
|
||||
else
|
||||
_scinsta_devquick_before
|
||||
|
||||
# Built tweak and deploy to live container
|
||||
make clean
|
||||
make DEV=1
|
||||
|
||||
# Change framework locations to @rpath
|
||||
install_name_tool -change "/Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate" "@rpath/CydiaSubstrate.framework/CydiaSubstrate" ".theos/obj/debug/SCInsta.dylib" 2>/dev/null || true
|
||||
|
||||
_scinsta_devquick_after
|
||||
fi
|
||||
@@ -1,188 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# Auto-detect THEOS if not set
|
||||
if [ -z "$THEOS" ]; then
|
||||
if [ -d "$HOME/theos" ]; then
|
||||
export THEOS="$HOME/theos"
|
||||
else
|
||||
echo -e '\033[1m\033[0;31mTHEOS not set and ~/theos not found.\nSet THEOS or install Theos to ~/theos\033[0m'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
CMAKE_OSX_ARCHITECTURES="arm64e;arm64"
|
||||
CMAKE_OSX_SYSROOT="iphoneos"
|
||||
|
||||
# Build just the dylib (for Feather/manual injection)
|
||||
if [ "$1" == "dylib" ];
|
||||
then
|
||||
|
||||
make clean 2>/dev/null || true
|
||||
rm -rf .theos
|
||||
|
||||
echo -e '\033[1m\033[32mBuilding RyukGram dylib\033[0m'
|
||||
|
||||
make
|
||||
|
||||
mkdir -p packages
|
||||
cp .theos/obj/debug/RyukGram.dylib packages/RyukGram.dylib
|
||||
|
||||
echo -e "\033[1m\033[32mDone!\033[0m\n\nDylib at: $(pwd)/packages/RyukGram.dylib"
|
||||
|
||||
# Build sideloaded IPA
|
||||
elif [ "$1" == "sideload" ];
|
||||
then
|
||||
|
||||
# Check for FLEXing submodule
|
||||
HAS_FLEX=1
|
||||
if [ -z "$(ls -A modules/FLEXing 2>/dev/null)" ]; then
|
||||
echo -e '\033[1m\033[0;33mFLEXing submodule not found — building without FLEX debugger.\033[0m'
|
||||
echo -e '\033[0;33mTo include FLEX, run: git submodule update --init --recursive\033[0m'
|
||||
echo
|
||||
HAS_FLEX=0
|
||||
fi
|
||||
|
||||
# Check if building with dev mode
|
||||
if [ "$2" == "--dev" ];
|
||||
then
|
||||
if [ "$HAS_FLEX" == "0" ]; then
|
||||
echo -e '\033[1m\033[0;31mDev mode requires FLEXing submodule.\033[0m'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Cache pre-built FLEX libs
|
||||
mkdir -p "packages/cache"
|
||||
cp -f ".theos/obj/debug/FLEXing.dylib" "packages/cache/FLEXing.dylib" 2>/dev/null || true
|
||||
cp -f ".theos/obj/debug/libflex.dylib" "packages/cache/libflex.dylib" 2>/dev/null || true
|
||||
|
||||
if [[ ! -f "packages/cache/FLEXing.dylib" || ! -f "packages/cache/libflex.dylib" ]]; then
|
||||
echo -e '\033[1m\033[0;33mCould not find cached pre-built FLEX libs, building prerequisite binaries\033[0m'
|
||||
echo
|
||||
|
||||
./build.sh sideload --buildonly
|
||||
./build-dev.sh true
|
||||
exit
|
||||
fi
|
||||
|
||||
MAKEARGS='DEV=1'
|
||||
FLEXPATH='packages/cache/FLEXing.dylib packages/cache/libflex.dylib'
|
||||
COMPRESSION=0
|
||||
else
|
||||
# Clear cached FLEX libs
|
||||
rm -rf "packages/cache"
|
||||
|
||||
if [ "$HAS_FLEX" == "1" ]; then
|
||||
MAKEARGS='SIDELOAD=1'
|
||||
FLEXPATH='.theos/obj/debug/FLEXing.dylib .theos/obj/debug/libflex.dylib'
|
||||
else
|
||||
MAKEARGS=''
|
||||
FLEXPATH=''
|
||||
fi
|
||||
COMPRESSION=9
|
||||
fi
|
||||
|
||||
# Clean build artifacts
|
||||
make clean 2>/dev/null || true
|
||||
rm -rf .theos
|
||||
|
||||
# Check for decrypted Instagram IPA
|
||||
ipaFile="$(find ./packages/ -name '*com.burbn.instagram*.ipa' -type f -exec basename {} \; 2>/dev/null || true)"
|
||||
if [ -z "${ipaFile}" ]; then
|
||||
echo -e '\033[1m\033[0;31m./packages/com.burbn.instagram.ipa not found.\nPlease put a decrypted Instagram IPA in its path.\033[0m'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for cyan and ipapatch before building (skip check for --buildonly)
|
||||
if [ "$2" != "--buildonly" ]; then
|
||||
if ! command -v cyan &> /dev/null; then
|
||||
echo -e '\033[1m\033[0;31mcyan not found. Install it with:\033[0m'
|
||||
echo ' pip install --force-reinstall https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip'
|
||||
echo
|
||||
echo -e '\033[0;33mUse ./build.sh sideload --buildonly to just compile without creating the IPA.\033[0m'
|
||||
echo -e '\033[0;33mOr use ./build.sh dylib to build the dylib for Feather injection.\033[0m'
|
||||
exit 1
|
||||
fi
|
||||
if ! command -v ipapatch &> /dev/null; then
|
||||
echo -e '\033[1m\033[0;31mipapatch not found. Install it from:\033[0m'
|
||||
echo ' https://github.com/asdfzxcvbn/ipapatch/releases/latest'
|
||||
echo
|
||||
echo -e '\033[0;33mUse ./build.sh sideload --buildonly to just compile without creating the IPA.\033[0m'
|
||||
echo -e '\033[0;33mOr use ./build.sh dylib to build the dylib for Feather injection.\033[0m'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e '\033[1m\033[32mBuilding RyukGram tweak for sideloading (as IPA)\033[0m'
|
||||
|
||||
make $MAKEARGS
|
||||
|
||||
# Copy dylib to packages
|
||||
mkdir -p packages
|
||||
cp .theos/obj/debug/RyukGram.dylib packages/RyukGram.dylib
|
||||
|
||||
# Only build libs (for future use in dev build mode)
|
||||
if [ "$2" == "--buildonly" ];
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
TWEAKPATH=".theos/obj/debug/RyukGram.dylib"
|
||||
if [ "$2" == "--devquick" ];
|
||||
then
|
||||
# Exclude RyukGram.dylib from IPA for livecontainer quick builds
|
||||
TWEAKPATH=""
|
||||
fi
|
||||
|
||||
# Create IPA file
|
||||
echo -e '\033[1m\033[32mCreating the IPA file...\033[0m'
|
||||
rm -f packages/RyukGram-sideloaded.ipa
|
||||
cyan -i "packages/${ipaFile}" -o packages/RyukGram-sideloaded.ipa -f $TWEAKPATH $FLEXPATH -c $COMPRESSION -m 15.0 -du
|
||||
|
||||
# Patch IPA for sideloading
|
||||
ipapatch --input "packages/RyukGram-sideloaded.ipa" --inplace --noconfirm
|
||||
|
||||
echo -e "\033[1m\033[32mDone, enjoy RyukGram!\033[0m\n\nYou can find the ipa file at: $(pwd)/packages"
|
||||
|
||||
# Build rootless .deb
|
||||
elif [ "$1" == "rootless" ];
|
||||
then
|
||||
|
||||
make clean 2>/dev/null || true
|
||||
rm -rf .theos
|
||||
|
||||
echo -e '\033[1m\033[32mBuilding RyukGram tweak for rootless\033[0m'
|
||||
|
||||
export THEOS_PACKAGE_SCHEME=rootless
|
||||
make package
|
||||
|
||||
echo -e "\033[1m\033[32mDone, enjoy RyukGram!\033[0m\n\nYou can find the deb file at: $(pwd)/packages"
|
||||
|
||||
# Build rootful .deb
|
||||
elif [ "$1" == "rootful" ];
|
||||
then
|
||||
|
||||
make clean 2>/dev/null || true
|
||||
rm -rf .theos
|
||||
|
||||
echo -e '\033[1m\033[32mBuilding RyukGram tweak for rootful\033[0m'
|
||||
|
||||
unset THEOS_PACKAGE_SCHEME
|
||||
make package
|
||||
|
||||
echo -e "\033[1m\033[32mDone, enjoy RyukGram!\033[0m\n\nYou can find the deb file at: $(pwd)/packages"
|
||||
|
||||
else
|
||||
echo '+----------------------+'
|
||||
echo '|RyukGram Build Script |'
|
||||
echo '+----------------------+'
|
||||
echo
|
||||
echo 'Usage: ./build.sh <dylib/sideload/rootless/rootful>'
|
||||
echo
|
||||
echo ' dylib - Build the dylib only (for Feather/manual injection)'
|
||||
echo ' sideload - Build a patched IPA (requires cyan + ipapatch + decrypted IPA)'
|
||||
echo ' rootless - Build a rootless .deb package'
|
||||
echo ' rootful - Build a rootful .deb package'
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,10 +0,0 @@
|
||||
Package: com.faroukbmiled.ryukgram
|
||||
Name: RyukGram
|
||||
Version: 1.1.5.1
|
||||
Architecture: iphoneos-arm
|
||||
Description: A feature-rich tweak for Instagram on iOS, based on SCInsta
|
||||
Homepage: https://github.com/faroukbmiled/RyukGram
|
||||
Maintainer: Ryuk
|
||||
Author: Ryuk
|
||||
Section: Tweaks
|
||||
Depends: mobilesubstrate
|
||||
Submodule modules/FLEXing deleted from 339eba9d99
@@ -1,78 +0,0 @@
|
||||
//
|
||||
// JGProgressHUD-Defines.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 28.04.15.
|
||||
// Copyright (c) 2015 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
Positions of the HUD.
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, JGProgressHUDPosition) {
|
||||
/** Center position. */
|
||||
JGProgressHUDPositionCenter = 0,
|
||||
/** Top left position. */
|
||||
JGProgressHUDPositionTopLeft,
|
||||
/** Top center position. */
|
||||
JGProgressHUDPositionTopCenter,
|
||||
/** Top right position. */
|
||||
JGProgressHUDPositionTopRight,
|
||||
/** Center left position. */
|
||||
JGProgressHUDPositionCenterLeft,
|
||||
/** Center right position. */
|
||||
JGProgressHUDPositionCenterRight,
|
||||
/** Bottom left position. */
|
||||
JGProgressHUDPositionBottomLeft,
|
||||
/** Bottom center position. */
|
||||
JGProgressHUDPositionBottomCenter,
|
||||
/** Bottom right position. */
|
||||
JGProgressHUDPositionBottomRight
|
||||
};
|
||||
|
||||
/**
|
||||
Appearance styles of the HUD.
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, JGProgressHUDStyle) {
|
||||
/** Extra light HUD with dark elements. */
|
||||
JGProgressHUDStyleExtraLight = 0,
|
||||
/** Light HUD with dark elemets. */
|
||||
JGProgressHUDStyleLight,
|
||||
/** Dark HUD with light elements. */
|
||||
JGProgressHUDStyleDark,
|
||||
};
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
/**
|
||||
Interaction types.
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, JGProgressHUDInteractionType) {
|
||||
/** Block all touches. No interaction behin the HUD is possible. */
|
||||
JGProgressHUDInteractionTypeBlockAllTouches = 0,
|
||||
/** Block touches on the HUD view. */
|
||||
JGProgressHUDInteractionTypeBlockTouchesOnHUDView,
|
||||
/** Block no touches. */
|
||||
JGProgressHUDInteractionTypeBlockNoTouches
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
Parallax Modes.
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, JGProgressHUDParallaxMode) {
|
||||
/** Follows the device setting for parallax. If "Reduce Motion" is enabled, no parallax effect is added to the HUD, if "Reduce Motion" is disabled the HUD will have a parallax effect. This behaviour is only supported on iOS 8 and higher. */
|
||||
JGProgressHUDParallaxModeDevice = 0,
|
||||
/** Always adds a parallax effect to the HUD. Parallax is only supported on iOS 7 and higher. */
|
||||
JGProgressHUDParallaxModeAlwaysOn,
|
||||
/** Never adds a parallax effect to the HUD. */
|
||||
JGProgressHUDParallaxModeAlwaysOff
|
||||
};
|
||||
|
||||
#ifndef fequal
|
||||
/**
|
||||
Macro for safe floating point comparison (for internal use in JGProgressHUD).
|
||||
*/
|
||||
#define fequal(a,b) (fabs((a) - (b)) < FLT_EPSILON)
|
||||
#endif
|
||||
@@ -1,310 +0,0 @@
|
||||
//
|
||||
// JGProgressHUD.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 20.7.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
|
||||
#import "JGProgressHUD-Defines.h"
|
||||
#import "JGProgressHUDShadow.h"
|
||||
#import "JGProgressHUDAnimation.h"
|
||||
#import "JGProgressHUDFadeAnimation.h"
|
||||
#import "JGProgressHUDFadeZoomAnimation.h"
|
||||
#import "JGProgressHUDIndicatorView.h"
|
||||
#import "JGProgressHUDErrorIndicatorView.h"
|
||||
#import "JGProgressHUDSuccessIndicatorView.h"
|
||||
#import "JGProgressHUDRingIndicatorView.h"
|
||||
#import "JGProgressHUDPieIndicatorView.h"
|
||||
#import "JGProgressHUDIndeterminateIndicatorView.h"
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
@protocol JGProgressHUDDelegate;
|
||||
|
||||
/**
|
||||
A HUD to indicate progress, success, error, warnings or other notifications to the user.
|
||||
@discussion @c JGProgressHUD respects its @c layoutMargins when positioning the HUD view. Additionally, on iOS 11 if @c insetsLayoutMarginsFromSafeArea is set to @c YES (default) the @c layoutMargins additionally contain the @c safeAreaInsets.
|
||||
@note Remember to call every method from the main thread! UIKit => main thread!
|
||||
@attention You may not add JGProgressHUD to a view which has an alpha value < 1.0 or to a view which is a subview of a view with an alpha value < 1.0.
|
||||
*/
|
||||
@interface JGProgressHUD : UIView
|
||||
|
||||
/**
|
||||
Designated initializer.
|
||||
@param style The appearance style of the HUD.
|
||||
*/
|
||||
- (instancetype __nonnull)initWithStyle:(JGProgressHUDStyle)style;
|
||||
|
||||
/**
|
||||
Convenience initializer.
|
||||
@param style The appearance style of the HUD.
|
||||
*/
|
||||
+ (instancetype __nonnull)progressHUDWithStyle:(JGProgressHUDStyle)style;
|
||||
|
||||
/**
|
||||
Convenience initializer. The HUD will dynamically change its style based on whether dark mode is enabled or not. When dark mode is on, the style will be JGProgressHUDStyleDark, when dark mode is off the style will be JGProgressHUDStyleExtraLight.
|
||||
*/
|
||||
- (instancetype __nonnull)initWithAutomaticStyle;
|
||||
|
||||
/**
|
||||
Convenience initializer. The HUD will dynamically change its style based on whether dark mode is enabled or not. When dark mode is on, the style will be JGProgressHUDStyleDark, when dark mode is off the style will be JGProgressHUDStyleExtraLight.
|
||||
*/
|
||||
+ (instancetype __nonnull)progressHUDWithAutomaticStyle;
|
||||
|
||||
/**
|
||||
The appearance style of the HUD.
|
||||
@b Default: JGProgressHUDStyleExtraLight.
|
||||
*/
|
||||
@property (nonatomic, assign) JGProgressHUDStyle style;
|
||||
|
||||
/** The view in which the HUD is presented. */
|
||||
@property (nonatomic, weak, readonly, nullable) UIView *targetView;
|
||||
|
||||
/**
|
||||
The delegate of the HUD.
|
||||
@sa JGProgressHUDDelegate.
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) id <JGProgressHUDDelegate> delegate;
|
||||
|
||||
/** The actual HUD view visible on screen. You may add animations to this view. */
|
||||
@property (nonatomic, strong, readonly, nonnull) UIView *HUDView;
|
||||
|
||||
/**
|
||||
The content view inside the @c HUDView. If you want to add additional views to the HUD you should add them as subview to the @c contentView.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nonnull) UIView *contentView;
|
||||
|
||||
/**
|
||||
The label used to present text on the HUD. Set the @c text or @c attributedText property of this label to change the displayed text. You may not change the label's @c frame or @c bounds.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nonnull) UILabel *textLabel;
|
||||
|
||||
/**
|
||||
The label used to present detail text on the HUD. Set the @c text or @c attributedText property of this label to change the displayed text. You may not change the label's @c frame or @c bounds.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nonnull) UILabel *detailTextLabel;
|
||||
|
||||
/**
|
||||
The indicator view. You can assign a custom subclass of @c JGProgressHUDIndicatorView to this property or one of the default indicator views (if you do so, you should assign it before showing the HUD). This value is optional.
|
||||
@b Default: JGProgressHUDIndeterminateIndicatorView.
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) JGProgressHUDIndicatorView *indicatorView;
|
||||
|
||||
/**
|
||||
The shadow cast by the @c HUDView. This value is optional. Setting this to @c nil means no shadow is cast by the HUD.
|
||||
@b Default: nil.
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) JGProgressHUDShadow *shadow;
|
||||
|
||||
/**
|
||||
The position of the HUD inside the hosting view's frame, or inside the specified frame.
|
||||
@b Default: JGProgressHUDPositionCenter
|
||||
*/
|
||||
@property (nonatomic, assign) JGProgressHUDPosition position;
|
||||
|
||||
/**
|
||||
The animation used for showing and dismissing the HUD.
|
||||
@b Default: JGProgressHUDFadeAnimation.
|
||||
*/
|
||||
@property (nonatomic, strong, nonnull) JGProgressHUDAnimation *animation;
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
/**
|
||||
Interaction type of the HUD. Determines whether touches should be let through to the views behind the HUD.
|
||||
@sa JGProgressHUDInteractionType.
|
||||
@b Default: JGProgressHUDInteractionTypeBlockAllTouches.
|
||||
*/
|
||||
@property (nonatomic, assign) JGProgressHUDInteractionType interactionType;
|
||||
#endif
|
||||
|
||||
/**
|
||||
Parallax mode for the HUD. This setting determines whether the HUD should have a parallax (@c UIDeviceMotion) effect. This effect is controlled by device motion on iOS and remote touchpad panning gestures on tvOS.
|
||||
@sa JGProgressHUDParallaxMode.
|
||||
@b Default: JGProgressHUDParallaxModeDevice.
|
||||
*/
|
||||
@property (nonatomic, assign) JGProgressHUDParallaxMode parallaxMode;
|
||||
|
||||
#if TARGET_OS_TV
|
||||
/**
|
||||
When this property is set to @c YES the HUD will try to become focused, which prevents interactions with the @c targetView. If set to @c NO the HUD will not become focused and interactions with @c targetView remain possible. Default: @c YES.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL wantsFocus;
|
||||
#endif
|
||||
|
||||
/**
|
||||
If the HUD should always have the same width and height.
|
||||
@b Default: NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL square;
|
||||
|
||||
/**
|
||||
Internally @c JGProgressHUD uses an @c UIVisualEffectView with a @c UIBlurEffect. A second @c UIVisualEffectView can be added on top of that with a @c UIVibrancyEffect which amplifies and adjusts the color of content layered behind the view, allowing content placed inside the contentView to become more vivid. This flag sets whether the @c UIVibrancyEffect should be used. Using the vibrancy effect can sometimes, depending on the contents of the display, result in a weird look (especially on iOS < 9.3).
|
||||
@b Default: NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL vibrancyEnabled;
|
||||
|
||||
/**
|
||||
The radius used for rounding the four corners of the HUD view.
|
||||
@b Default: 10.0.
|
||||
*/
|
||||
@property (nonatomic, assign) CGFloat cornerRadius;
|
||||
|
||||
/**
|
||||
Insets the contents of the HUD.
|
||||
@b Default: (20, 20, 20, 20).
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets contentInsets;
|
||||
|
||||
/**
|
||||
@return Whether the HUD is visible on screen.
|
||||
*/
|
||||
@property (nonatomic, assign, readonly, getter = isVisible) BOOL visible;
|
||||
|
||||
/**
|
||||
The progress to display using the @c progressIndicatorView. A change of this property is not animated. Use the @c setProgress:animated: method for an animated progress change.
|
||||
@b Default: 0.0.
|
||||
*/
|
||||
@property (nonatomic, assign) float progress;
|
||||
|
||||
/**
|
||||
Adjusts the current progress shown by the receiver, optionally animating the change.
|
||||
|
||||
The current progress is represented by a floating-point value between 0.0 and 1.0, inclusive, where 1.0 indicates the completion of the task. The default value is 0.0. Values less than 0.0 and greater than 1.0 are pinned to those limits.
|
||||
@param progress The new progress value.
|
||||
@param animated YES if the change should be animated, NO if the change should happen immediately.
|
||||
*/
|
||||
- (void)setProgress:(float)progress animated:(BOOL)animated;
|
||||
|
||||
/**
|
||||
Specifies a minimum time that the HUD will be on-screen. Useful to prevent the HUD from flashing quickly on the screen when indeterminate tasks complete more quickly than expected.
|
||||
@b Default: 0.0.
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval minimumDisplayTime;
|
||||
|
||||
/**
|
||||
Determines whether Voice Over announcements should be made upon displaying the HUD (if Voice Over is active).
|
||||
@b Default: YES
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL voiceOverEnabled;
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
/**
|
||||
A block to be invoked when the HUD view is tapped.
|
||||
@note The interaction type of the HUD must be @c JGProgressHUDInteractionTypeBlockTouchesOnHUDView or @c JGProgressHUDInteractionTypeBlockAllTouches, otherwise this block won't be fired.
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) void (^tapOnHUDViewBlock)(JGProgressHUD *__nonnull HUD);
|
||||
|
||||
/**
|
||||
A block to be invoked when the area outside of the HUD view is tapped.
|
||||
@note The interaction type of the HUD must be @c JGProgressHUDInteractionTypeBlockAllTouches, otherwise this block won't be fired.
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) void (^tapOutsideBlock)(JGProgressHUD *__nonnull HUD);
|
||||
#endif
|
||||
|
||||
/**
|
||||
Shows the HUD animated. You should preferably show the HUD in a UIViewController's view. The HUD will be repositioned in response to rotation and keyboard show/hide notifications.
|
||||
@param view The view to show the HUD in. The frame of the @c view will be used to calculate the position of the HUD.
|
||||
*/
|
||||
- (void)showInView:(UIView *__nonnull)view;
|
||||
|
||||
/**
|
||||
Shows the HUD. You should preferably show the HUD in a UIViewController's view. The HUD will be repositioned in response to rotation and keyboard show/hide notifications.
|
||||
@param view The view to show the HUD in. The frame of the @c view will be used to calculate the position of the HUD.
|
||||
@param animated If the HUD should show with an animation.
|
||||
*/
|
||||
- (void)showInView:(UIView *__nonnull)view animated:(BOOL)animated;
|
||||
|
||||
/**
|
||||
Shows the HUD after a delay. You should preferably show the HUD in a UIViewController's view. The HUD will be repositioned in response to rotation and keyboard show/hide notifications.
|
||||
You may call @c dismiss to stop the HUD from appearing before the delay has passed.
|
||||
@param view The view to show the HUD in. The frame of the @c view will be used to calculate the position of the HUD.
|
||||
@param animated If the HUD should show with an animation.
|
||||
@param delay The delay until the HUD will be shown.
|
||||
*/
|
||||
- (void)showInView:(UIView *__nonnull)view animated:(BOOL)animated afterDelay:(NSTimeInterval)delay;
|
||||
|
||||
/** Dismisses the HUD animated. If the HUD is currently not visible this method does nothing. */
|
||||
- (void)dismiss;
|
||||
|
||||
/**
|
||||
Dismisses the HUD. If the HUD is currently not visible this method does nothing.
|
||||
@param animated If the HUD should dismiss with an animation.
|
||||
*/
|
||||
- (void)dismissAnimated:(BOOL)animated;
|
||||
|
||||
/**
|
||||
Dismisses the HUD animated after a delay. If the HUD is currently not visible this method does nothing.
|
||||
@param delay The delay until the HUD will be dismissed.
|
||||
*/
|
||||
- (void)dismissAfterDelay:(NSTimeInterval)delay;
|
||||
|
||||
/**
|
||||
Dismisses the HUD after a delay. If the HUD is currently not visible this method does nothing.
|
||||
@param delay The delay until the HUD will be dismissed.
|
||||
@param animated If the HUD should dismiss with an animation.
|
||||
*/
|
||||
- (void)dismissAfterDelay:(NSTimeInterval)delay animated:(BOOL)animated;
|
||||
|
||||
/**
|
||||
Dismisses the HUD after a delay and runs a block upon completion. If the HUD is currently not visible this method does nothing.
|
||||
@param delay The delay until the HUD will be dismissed.
|
||||
@param animated If the HUD should dismiss with an animation.
|
||||
@param dismissCompletion The block to execute after the HUD was dismissed.
|
||||
*/
|
||||
- (void)dismissAfterDelay:(NSTimeInterval)delay animated:(BOOL)animated completion:(void (^_Nullable)(void))dismissCompletion;
|
||||
|
||||
/**
|
||||
Schedules the given block to be executed when this HUD disapears. If the HUD is currently not visible this method does nothing.
|
||||
@param dismissCompletion The block to execute after the HUD was dismissed. Multiple calls to this method cause the different blocks to be executed in FIFO order.
|
||||
*/
|
||||
- (void)performAfterDismiss:(void (^_Nonnull)(void))dismissCompletion;
|
||||
|
||||
@end
|
||||
|
||||
@interface JGProgressHUD (HUDManagement)
|
||||
|
||||
/**
|
||||
@param view The view to return all visible progress HUDs for.
|
||||
@return All visible progress HUDs in the view.
|
||||
*/
|
||||
+ (NSArray<JGProgressHUD *> *__nonnull)allProgressHUDsInView:(UIView *__nonnull)view;
|
||||
|
||||
/**
|
||||
@param view The view to return all visible progress HUDs for.
|
||||
@return All visible progress HUDs in the view and its subviews.
|
||||
*/
|
||||
+ (NSArray<JGProgressHUD *> *__nonnull)allProgressHUDsInViewHierarchy:(UIView *__nonnull)view;
|
||||
|
||||
@end
|
||||
|
||||
@protocol JGProgressHUDDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
Called before the HUD will appear.
|
||||
@param view The view in which the HUD is presented.
|
||||
*/
|
||||
- (void)progressHUD:(JGProgressHUD *__nonnull)progressHUD willPresentInView:(UIView *__nonnull)view;
|
||||
|
||||
/**
|
||||
Called after the HUD appeared.
|
||||
@param view The view in which the HUD is presented.
|
||||
*/
|
||||
- (void)progressHUD:(JGProgressHUD *__nonnull)progressHUD didPresentInView:(UIView *__nonnull)view;
|
||||
|
||||
/**
|
||||
Called before the HUD will disappear.
|
||||
@param view The view in which the HUD is presented and will be dismissed from.
|
||||
*/
|
||||
- (void)progressHUD:(JGProgressHUD *__nonnull)progressHUD willDismissFromView:(UIView *__nonnull)view;
|
||||
|
||||
/**
|
||||
Called after the HUD has disappeared.
|
||||
@param view The view in which the HUD was presented and was be dismissed from.
|
||||
*/
|
||||
- (void)progressHUD:(JGProgressHUD *__nonnull)progressHUD didDismissFromView:(UIView *__nonnull)view;
|
||||
|
||||
@end
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,43 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDAnimation.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 20.7.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class JGProgressHUD;
|
||||
|
||||
/**
|
||||
You may subclass this class to create a custom progress indicator view.
|
||||
*/
|
||||
@interface JGProgressHUDAnimation : NSObject
|
||||
|
||||
/** Convenience initializer. */
|
||||
+ (instancetype __nonnull)animation;
|
||||
|
||||
/** The HUD using this animation. */
|
||||
@property (nonatomic, weak, readonly, nullable) JGProgressHUD *progressHUD;
|
||||
|
||||
/**
|
||||
The @c progressHUD is hidden from screen with @c alpha = 1 and @c hidden = @c YES. Ideally, you should prepare the HUD for presentation, then set @c hidden to @c NO on the @c progressHUD and then perform the animation.
|
||||
@post Call @c animationFinished.
|
||||
*/
|
||||
- (void)show NS_REQUIRES_SUPER;
|
||||
|
||||
/**
|
||||
The @c progressHUD wis visible on screen with @c alpha = 1 and @c hidden = @c NO. You should only perform the animation in this method, the @c progressHUD itself will take care of hiding itself and removing itself from superview.
|
||||
@post Call @c animationFinished.
|
||||
*/
|
||||
- (void)hide NS_REQUIRES_SUPER;
|
||||
|
||||
/**
|
||||
@pre This method should only be called at the end of a @c show or @c hide animaiton.
|
||||
@attention ALWAYS call this method after completing a @c show or @c hide animation.
|
||||
*/
|
||||
- (void)animationFinished NS_REQUIRES_SUPER;
|
||||
|
||||
@end
|
||||
@@ -1,48 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDAnimation.m
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 20.7.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import "JGProgressHUDAnimation.h"
|
||||
#import "JGProgressHUD.h"
|
||||
|
||||
@interface JGProgressHUD (Private)
|
||||
|
||||
- (void)animationDidFinish:(BOOL)presenting;
|
||||
|
||||
@end
|
||||
|
||||
@interface JGProgressHUDAnimation () {
|
||||
BOOL _presenting;
|
||||
}
|
||||
|
||||
@property (nonatomic, weak) JGProgressHUD *progressHUD;
|
||||
|
||||
@end
|
||||
|
||||
@implementation JGProgressHUDAnimation
|
||||
|
||||
#pragma mark - Initializers
|
||||
|
||||
+ (instancetype)animation {
|
||||
return [[self alloc] init];
|
||||
}
|
||||
|
||||
#pragma mark - Public methods
|
||||
|
||||
- (void)show {
|
||||
_presenting = YES;
|
||||
}
|
||||
|
||||
- (void)hide {
|
||||
_presenting = NO;
|
||||
}
|
||||
|
||||
- (void)animationFinished {
|
||||
[self.progressHUD animationDidFinish:_presenting];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,24 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDErrorIndicatorView.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 19.08.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
|
||||
#import "JGProgressHUDImageIndicatorView.h"
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
/**
|
||||
An image indicator showing a cross, representing a failed operation.
|
||||
*/
|
||||
@interface JGProgressHUDErrorIndicatorView : JGProgressHUDImageIndicatorView
|
||||
|
||||
/**
|
||||
Default initializer for this class.
|
||||
*/
|
||||
- (instancetype __nonnull)init;
|
||||
|
||||
@end
|
||||
@@ -1,57 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDErrorIndicatorView.m
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 19.08.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import "JGProgressHUDErrorIndicatorView.h"
|
||||
#import "JGProgressHUD.h"
|
||||
|
||||
static UIBezierPath *errorBezierPath() {
|
||||
static UIBezierPath *path;
|
||||
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
path = [UIBezierPath bezierPath];
|
||||
[path moveToPoint:CGPointMake(3, 3)];
|
||||
[path addLineToPoint:CGPointMake(30, 30)];
|
||||
[path moveToPoint:CGPointMake(30, 3)];
|
||||
[path addLineToPoint:CGPointMake(3, 30)];
|
||||
|
||||
[path setLineWidth:3];
|
||||
[path setLineJoinStyle:kCGLineJoinRound];
|
||||
[path setLineCapStyle:kCGLineCapRound];
|
||||
});
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@implementation JGProgressHUDErrorIndicatorView
|
||||
|
||||
- (instancetype)initWithContentView:(UIView *__unused)contentView {
|
||||
UIBezierPath *path = errorBezierPath();
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(CGSizeMake(33, 33), NO, 0.0);
|
||||
[[UIColor blackColor] setStroke];
|
||||
[path stroke];
|
||||
|
||||
UIImage *img = [UIGraphicsGetImageFromCurrentImageContext() imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
|
||||
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
self = [super initWithImage:img];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
return [self initWithContentView:nil];
|
||||
}
|
||||
|
||||
- (void)updateAccessibility {
|
||||
self.accessibilityLabel = NSLocalizedString(@"Error",);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,33 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDFadeAnimation.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 20.7.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
|
||||
#import "JGProgressHUDAnimation.h"
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
/**
|
||||
A simple fade animation that fades the HUD from alpha @c 0.0 to alpha @c 1.0.
|
||||
*/
|
||||
@interface JGProgressHUDFadeAnimation : JGProgressHUDAnimation
|
||||
|
||||
/**
|
||||
Duration of the animation.
|
||||
|
||||
@b Default: 0.4.
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval duration;
|
||||
|
||||
/**
|
||||
Animation options
|
||||
|
||||
@b Default: UIViewAnimationOptionCurveEaseInOut.
|
||||
*/
|
||||
@property (nonatomic, assign) UIViewAnimationOptions animationOptions;
|
||||
|
||||
@end
|
||||
@@ -1,56 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDFadeAnimation.m
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 20.7.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import "JGProgressHUDFadeAnimation.h"
|
||||
#import "JGProgressHUD.h"
|
||||
|
||||
@implementation JGProgressHUDFadeAnimation
|
||||
|
||||
#pragma mark - Initializers
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.duration = 0.4;
|
||||
self.animationOptions = UIViewAnimationOptionCurveEaseInOut;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setAnimationOptions:(UIViewAnimationOptions)animationOptions {
|
||||
_animationOptions = (animationOptions | UIViewAnimationOptionBeginFromCurrentState);
|
||||
}
|
||||
|
||||
#pragma mark - Showing
|
||||
|
||||
- (void)show {
|
||||
[super show];
|
||||
|
||||
self.progressHUD.alpha = 0.0;
|
||||
self.progressHUD.hidden = NO;
|
||||
|
||||
[UIView animateWithDuration:self.duration delay:0.0 options:self.animationOptions animations:^{
|
||||
self.progressHUD.alpha = 1.0;
|
||||
} completion:^(BOOL __unused finished) {
|
||||
[self animationFinished];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Hiding
|
||||
|
||||
- (void)hide {
|
||||
[super hide];
|
||||
|
||||
[UIView animateWithDuration:self.duration delay:0.0 options:self.animationOptions animations:^{
|
||||
self.progressHUD.alpha = 0.0;
|
||||
} completion:^(BOOL __unused finished) {
|
||||
[self animationFinished];
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,40 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDFadeZoomAnimation.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 20.7.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
|
||||
#import "JGProgressHUDAnimation.h"
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
/**
|
||||
An animation that fades in the HUD and expands the HUD from scale @c (0, 0) to a customizable scale, and finally to scale @c (1, 1), creating a bouncing effect.
|
||||
*/
|
||||
@interface JGProgressHUDFadeZoomAnimation : JGProgressHUDAnimation
|
||||
|
||||
/**
|
||||
Duration of the animation from or to the shrinked state.
|
||||
|
||||
@b Default: 0.2.
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval shrinkAnimationDuaration;
|
||||
|
||||
/**
|
||||
Duration of the animation from or to the expanded state.
|
||||
|
||||
@b Default: 0.1.
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval expandAnimationDuaration;
|
||||
|
||||
/**
|
||||
The scale to apply to the HUD when expanding.
|
||||
|
||||
@b Default: (1.1, 1.1).
|
||||
*/
|
||||
@property (nonatomic, assign) CGSize expandScale;
|
||||
|
||||
@end
|
||||
@@ -1,77 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDFadeZoomAnimation.m
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 20.7.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import "JGProgressHUDFadeZoomAnimation.h"
|
||||
#import "JGProgressHUD.h"
|
||||
|
||||
@implementation JGProgressHUDFadeZoomAnimation
|
||||
|
||||
#pragma mark - Initializers
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.shrinkAnimationDuaration = 0.2;
|
||||
self.expandAnimationDuaration = 0.1;
|
||||
self.expandScale = CGSizeMake(1.1, 1.1);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Showing
|
||||
|
||||
- (void)show {
|
||||
[super show];
|
||||
|
||||
self.progressHUD.alpha = 0.0;
|
||||
self.progressHUD.HUDView.transform = CGAffineTransformMakeScale(0.1, 0.1);
|
||||
|
||||
NSTimeInterval totalDuration = self.expandAnimationDuaration+self.shrinkAnimationDuaration;
|
||||
|
||||
self.progressHUD.hidden = NO;
|
||||
|
||||
[UIView animateWithDuration:totalDuration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut) animations:^{
|
||||
self.progressHUD.alpha = 1.0;
|
||||
} completion:nil];
|
||||
|
||||
[UIView animateWithDuration:self.shrinkAnimationDuaration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionBeginFromCurrentState) animations:^{
|
||||
self.progressHUD.HUDView.transform = CGAffineTransformMakeScale(self.expandScale.width, self.expandScale.height);
|
||||
} completion:^(BOOL __unused _finished) {
|
||||
[UIView animateWithDuration:self.expandAnimationDuaration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState) animations:^{
|
||||
self.progressHUD.HUDView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL __unused __finished) {
|
||||
[self animationFinished];
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Hiding
|
||||
|
||||
- (void)hide {
|
||||
[super hide];
|
||||
|
||||
NSTimeInterval totalDuration = self.expandAnimationDuaration+self.shrinkAnimationDuaration;
|
||||
|
||||
[UIView animateWithDuration:totalDuration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut) animations:^{
|
||||
self.progressHUD.alpha = 0.0;
|
||||
} completion:nil];
|
||||
|
||||
[UIView animateWithDuration:self.expandAnimationDuaration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionBeginFromCurrentState) animations:^{
|
||||
self.progressHUD.HUDView.transform = CGAffineTransformMakeScale(self.expandScale.width, self.expandScale.height);
|
||||
} completion:^(BOOL __unused _finished) {
|
||||
[UIView animateWithDuration:self.shrinkAnimationDuaration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState) animations:^{
|
||||
self.progressHUD.HUDView.transform = CGAffineTransformMakeScale(0.1, 0.1);
|
||||
} completion:^(BOOL __unused __finished) {
|
||||
self.progressHUD.HUDView.transform = CGAffineTransformIdentity;
|
||||
|
||||
[self animationFinished];
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,28 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDImageIndicatorView.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 05.08.15.
|
||||
// Copyright (c) 2015 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
|
||||
#import "JGProgressHUDIndicatorView.h"
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
/**
|
||||
An indicator for displaying custom images. Supports animated images.
|
||||
|
||||
You may subclass this class to create a custom image indicator view.
|
||||
*/
|
||||
@interface JGProgressHUDImageIndicatorView : JGProgressHUDIndicatorView
|
||||
|
||||
/**
|
||||
Initializes the indicator view with an UIImageView showing the @c image.
|
||||
|
||||
@param image The image to show in the indicator view.
|
||||
*/
|
||||
- (instancetype __nonnull)initWithImage:(UIImage *__nonnull)image;
|
||||
|
||||
@end
|
||||
@@ -1,42 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDImageIndicatorView.m
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 05.08.15.
|
||||
// Copyright (c) 2015 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import "JGProgressHUDImageIndicatorView.h"
|
||||
|
||||
@implementation JGProgressHUDImageIndicatorView {
|
||||
BOOL _customizedTintColor;
|
||||
}
|
||||
|
||||
- (instancetype)initWithImage:(UIImage *)image {
|
||||
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
|
||||
|
||||
self = [super initWithContentView:imageView];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setUpForHUDStyle:(JGProgressHUDStyle)style vibrancyEnabled:(BOOL)vibrancyEnabled {
|
||||
[super setUpForHUDStyle:style vibrancyEnabled:vibrancyEnabled];
|
||||
|
||||
if (!_customizedTintColor) {
|
||||
if (style == JGProgressHUDStyleDark) {
|
||||
self.tintColor = [UIColor whiteColor];
|
||||
}
|
||||
else {
|
||||
self.tintColor = [UIColor blackColor];
|
||||
}
|
||||
_customizedTintColor = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setTintColor:(UIColor *)tintColor {
|
||||
[super setTintColor:tintColor];
|
||||
_customizedTintColor = YES;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,25 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDIndeterminateIndicatorView.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 19.07.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
|
||||
#import "JGProgressHUDIndicatorView.h"
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
/**
|
||||
An indeterminate progress indicator showing a @c UIActivityIndicatorView.
|
||||
*/
|
||||
@interface JGProgressHUDIndeterminateIndicatorView : JGProgressHUDIndicatorView
|
||||
|
||||
/**
|
||||
Set the color of the activity indicator view.
|
||||
@param color The color to apply to the activity indicator view.
|
||||
*/
|
||||
- (void)setColor:(UIColor *__nonnull)color;
|
||||
|
||||
@end
|
||||
@@ -1,63 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDIndeterminateIndicatorView.m
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 19.07.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import "JGProgressHUDIndeterminateIndicatorView.h"
|
||||
|
||||
#ifndef __IPHONE_13_0
|
||||
#define __IPHONE_13_0 130000
|
||||
#endif
|
||||
|
||||
@implementation JGProgressHUDIndeterminateIndicatorView
|
||||
|
||||
- (instancetype)init {
|
||||
UIActivityIndicatorView *activityIndicatorView;
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
||||
if (@available(iOS 13, tvOS 13, *)) {
|
||||
activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleLarge];
|
||||
}
|
||||
else {
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
#else
|
||||
activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
|
||||
#endif
|
||||
|
||||
[activityIndicatorView startAnimating];
|
||||
|
||||
self = [super initWithContentView:activityIndicatorView];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithHUDStyle:(JGProgressHUDStyle)style {
|
||||
return [self init];
|
||||
}
|
||||
|
||||
- (void)setUpForHUDStyle:(JGProgressHUDStyle)style vibrancyEnabled:(BOOL)vibrancyEnabled {
|
||||
[super setUpForHUDStyle:style vibrancyEnabled:vibrancyEnabled];
|
||||
|
||||
if (style != JGProgressHUDStyleDark) {
|
||||
self.color = [UIColor blackColor];
|
||||
}
|
||||
else {
|
||||
self.color = [UIColor whiteColor];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setColor:(UIColor *)color {
|
||||
[(UIActivityIndicatorView *)self.contentView setColor:color];
|
||||
}
|
||||
|
||||
- (void)updateAccessibility {
|
||||
self.accessibilityLabel = NSLocalizedString(@"Indeterminate progress",);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,61 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDIndicatorView.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 20.7.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
|
||||
#import "JGProgressHUD-Defines.h"
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
/** You may subclass this class to create a custom progress indicator view. */
|
||||
@interface JGProgressHUDIndicatorView : UIView
|
||||
|
||||
/**
|
||||
Designated initializer for this class.
|
||||
|
||||
@param contentView The content view to place on the container view (the container is the JGProgressHUDIndicatorView).
|
||||
*/
|
||||
- (instancetype __nonnull)initWithContentView:(UIView *__nullable)contentView;
|
||||
|
||||
/** Use this method to set up the indicator view to fit the HUD style and vibrancy setting. This method is called by @c JGProgressHUD when the indicator view is added to the HUD and when the HUD's @c vibrancyEnabled property changes. This method may be called multiple times with different values. The default implementation does nothing. */
|
||||
- (void)setUpForHUDStyle:(JGProgressHUDStyle)style vibrancyEnabled:(BOOL)vibrancyEnabled;
|
||||
|
||||
/** Ranges from 0.0 to 1.0. */
|
||||
@property (nonatomic, assign) float progress;
|
||||
|
||||
/**
|
||||
Adjusts the current progress shown by the receiver, optionally animating the change.
|
||||
|
||||
The current progress is represented by a floating-point value between 0.0 and 1.0, inclusive, where 1.0 indicates the completion of the task. The default value is 0.0. Values less than 0.0 and greater than 1.0 are pinned to those limits.
|
||||
|
||||
@param progress The new progress value.
|
||||
@param animated YES if the change should be animated, NO if the change should happen immediately.
|
||||
*/
|
||||
- (void)setProgress:(float)progress animated:(BOOL)animated;
|
||||
|
||||
/**
|
||||
The content view which displays the progress.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nullable) UIView *contentView;
|
||||
|
||||
/** Schedules an accessibility update on the next run loop. */
|
||||
- (void)setNeedsAccessibilityUpdate;
|
||||
|
||||
/**
|
||||
Runs @c updateAccessibility immediately if an accessibility update has been scheduled (through @c setNeedsAccessibilityUpdate) but has not executed yet.
|
||||
*/
|
||||
- (void)updateAccessibilityIfNeeded;
|
||||
|
||||
/**
|
||||
Override to set custom accessibility properties. This method gets called once when initializing the view and after calling @c setNeedsAccessibilityUpdate.
|
||||
*/
|
||||
- (void)updateAccessibility;
|
||||
|
||||
@end
|
||||
@@ -1,103 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDIndicatorView.m
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 20.7.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import "JGProgressHUDIndicatorView.h"
|
||||
#import "JGProgressHUD.h"
|
||||
|
||||
@interface JGProgressHUDIndicatorView () {
|
||||
BOOL _accessibilityUpdateScheduled;
|
||||
}
|
||||
|
||||
+ (void)runBlock:(void (^)(void))block;
|
||||
|
||||
@end
|
||||
|
||||
static void runOnNextRunLoop(void (^block)(void)) {
|
||||
[[NSRunLoop currentRunLoop] performSelector:@selector(runBlock:) target:[JGProgressHUDIndicatorView class] argument:(id)block order:0 modes:@[NSRunLoopCommonModes]];
|
||||
}
|
||||
|
||||
@implementation JGProgressHUDIndicatorView
|
||||
|
||||
#pragma mark - Initializers
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect __unused)frame {
|
||||
return [self init];
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
return [self initWithContentView:nil];
|
||||
}
|
||||
|
||||
- (instancetype)initWithContentView:(UIView *)contentView {
|
||||
self = [super initWithFrame:(contentView ? contentView.frame : CGRectMake(0.0, 0.0, 50.0, 50.0))];
|
||||
if (self) {
|
||||
self.opaque = NO;
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
|
||||
self.isAccessibilityElement = YES;
|
||||
[self setNeedsAccessibilityUpdate];
|
||||
|
||||
if (contentView) {
|
||||
_contentView = contentView;
|
||||
|
||||
[self addSubview:self.contentView];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Setup
|
||||
|
||||
- (void)setUpForHUDStyle:(JGProgressHUDStyle)style vibrancyEnabled:(BOOL)vibrancyEnabled {}
|
||||
|
||||
#pragma mark - Accessibility
|
||||
|
||||
+ (void)runBlock:(void (^)(void))block {
|
||||
if (block != nil) {
|
||||
block();
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setNeedsAccessibilityUpdate {
|
||||
if (!_accessibilityUpdateScheduled) {
|
||||
_accessibilityUpdateScheduled = YES;
|
||||
|
||||
runOnNextRunLoop(^{
|
||||
[self updateAccessibilityIfNeeded];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateAccessibilityIfNeeded {
|
||||
if (_accessibilityUpdateScheduled) {
|
||||
[self updateAccessibility];
|
||||
_accessibilityUpdateScheduled = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateAccessibility {
|
||||
self.accessibilityLabel = [NSLocalizedString(@"Loading",) stringByAppendingFormat:@" %.f %%", self.progress];
|
||||
}
|
||||
|
||||
#pragma mark - Getters & Setters
|
||||
|
||||
- (void)setProgress:(float)progress {
|
||||
[self setProgress:progress animated:NO];
|
||||
}
|
||||
|
||||
- (void)setProgress:(float)progress animated:(__unused BOOL)animated {
|
||||
if (fequal(self.progress, progress)) {
|
||||
return;
|
||||
}
|
||||
|
||||
_progress = progress;
|
||||
|
||||
[self setNeedsAccessibilityUpdate];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,35 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDPieIndicatorView.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 19.07.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
|
||||
#import "JGProgressHUDIndicatorView.h"
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
/**
|
||||
A pie shaped determinate progress indicator.
|
||||
*/
|
||||
@interface JGProgressHUDPieIndicatorView : JGProgressHUDIndicatorView
|
||||
|
||||
/**
|
||||
Tint color of the Pie.
|
||||
@attention Custom values need to be set after assigning the indicator view to @c JGProgressHUD's @c indicatorView property.
|
||||
|
||||
@b Default: White for JGProgressHUDStyleDark, otherwise black.
|
||||
*/
|
||||
@property (nonatomic, strong, nonnull) UIColor *color;
|
||||
|
||||
/**
|
||||
The background fill color inside the pie.
|
||||
@attention Custom values need to be set after assigning the indicator view to @c JGProgressHUD's @c indicatorView property.
|
||||
|
||||
@b Default: Dark gray for JGProgressHUDStyleDark, otherwise light gray.
|
||||
*/
|
||||
@property (nonatomic, strong, nonnull) UIColor *fillColor;
|
||||
|
||||
@end
|
||||
@@ -1,171 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDPieIndicatorView.m
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 19.07.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import "JGProgressHUDPieIndicatorView.h"
|
||||
|
||||
@interface JGProgressHUDPieIndicatorLayer : CALayer
|
||||
|
||||
@property (nonatomic, assign) float progress;
|
||||
|
||||
@property (nonatomic, weak) UIColor *color;
|
||||
|
||||
@property (nonatomic, weak) UIColor *fillColor;
|
||||
|
||||
@end
|
||||
|
||||
@implementation JGProgressHUDPieIndicatorLayer
|
||||
|
||||
@dynamic progress, color, fillColor;
|
||||
|
||||
+ (BOOL)needsDisplayForKey:(NSString *)key {
|
||||
return ([key isEqualToString:@"progress"] || [key isEqualToString:@"color"] || [key isEqualToString:@"fillColor"] || [super needsDisplayForKey:key]);
|
||||
}
|
||||
|
||||
- (id <CAAction>)actionForKey:(NSString *)key {
|
||||
if ([key isEqualToString:@"progress"]) {
|
||||
CABasicAnimation *progressAnimation = [CABasicAnimation animation];
|
||||
progressAnimation.fromValue = [self.presentationLayer valueForKey:key];
|
||||
|
||||
progressAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
||||
|
||||
return progressAnimation;
|
||||
}
|
||||
|
||||
return [super actionForKey:key];
|
||||
}
|
||||
|
||||
- (void)drawInContext:(CGContextRef)ctx {
|
||||
UIGraphicsPushContext(ctx);
|
||||
|
||||
CGRect rect = self.bounds;
|
||||
|
||||
CGPoint center = CGPointMake(rect.origin.x + (CGFloat)floor(rect.size.width/2.0), rect.origin.y + (CGFloat)floor(rect.size.height/2.0));
|
||||
CGFloat lineWidth = 2.0;
|
||||
CGFloat radius = (CGFloat)floor(MIN(rect.size.width, rect.size.height)/2.0)-lineWidth;
|
||||
|
||||
UIBezierPath *borderPath = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:0.0 endAngle:2.0*(CGFloat)M_PI clockwise:NO];
|
||||
|
||||
[borderPath setLineWidth:lineWidth];
|
||||
|
||||
if (self.fillColor) {
|
||||
[self.fillColor setFill];
|
||||
|
||||
[borderPath fill];
|
||||
}
|
||||
|
||||
[self.color set];
|
||||
|
||||
[borderPath stroke];
|
||||
|
||||
if (self.progress > 0.0) {
|
||||
UIBezierPath *processPath = [UIBezierPath bezierPath];
|
||||
|
||||
[processPath setLineWidth:radius];
|
||||
|
||||
CGFloat startAngle = -((CGFloat)M_PI/2.0);
|
||||
CGFloat endAngle = startAngle + 2.0 * (CGFloat)M_PI * self.progress;
|
||||
|
||||
[processPath addArcWithCenter:center radius:radius/2.0 startAngle:startAngle endAngle:endAngle clockwise:YES];
|
||||
|
||||
[processPath stroke];
|
||||
}
|
||||
|
||||
UIGraphicsPopContext();
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation JGProgressHUDPieIndicatorView
|
||||
|
||||
#pragma mark - Initializers
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super initWithContentView:nil];
|
||||
|
||||
if (self) {
|
||||
self.layer.contentsScale = [UIScreen mainScreen].scale;
|
||||
[self.layer setNeedsDisplay];
|
||||
|
||||
self.color = [UIColor clearColor];
|
||||
self.fillColor = [UIColor clearColor];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithHUDStyle:(JGProgressHUDStyle)style {
|
||||
return [self init];
|
||||
}
|
||||
|
||||
- (instancetype)initWithContentView:(UIView *)contentView {
|
||||
return [self init];
|
||||
}
|
||||
|
||||
#pragma mark - Getters & Setters
|
||||
|
||||
- (void)setColor:(UIColor *)tintColor {
|
||||
if ([tintColor isEqual:self.color]) {
|
||||
return;
|
||||
}
|
||||
|
||||
_color = tintColor;
|
||||
|
||||
[(JGProgressHUDPieIndicatorLayer *)self.layer setColor:self.color];
|
||||
}
|
||||
|
||||
- (void)setFillColor:(UIColor *)fillColor {
|
||||
if ([fillColor isEqual:self.fillColor]) {
|
||||
return;
|
||||
}
|
||||
|
||||
_fillColor = fillColor;
|
||||
|
||||
[(JGProgressHUDPieIndicatorLayer *)self.layer setFillColor:self.fillColor];
|
||||
}
|
||||
|
||||
- (void)setProgress:(float)progress animated:(BOOL)animated {
|
||||
if (fequal(self.progress, progress)) {
|
||||
return;
|
||||
}
|
||||
|
||||
[super setProgress:progress animated:animated];
|
||||
|
||||
[CATransaction begin];
|
||||
[CATransaction setAnimationDuration:(animated ? 0.3 : 0.0)];
|
||||
|
||||
[(JGProgressHUDPieIndicatorLayer *)self.layer setProgress:progress];
|
||||
|
||||
[CATransaction commit];
|
||||
}
|
||||
|
||||
#pragma mark - Overrides
|
||||
|
||||
- (void)setUpForHUDStyle:(JGProgressHUDStyle)style vibrancyEnabled:(BOOL)vibrancyEnabled {
|
||||
[super setUpForHUDStyle:style vibrancyEnabled:vibrancyEnabled];
|
||||
|
||||
if (style == JGProgressHUDStyleDark) {
|
||||
self.color = [UIColor colorWithWhite:1.0 alpha:1.0];
|
||||
self.fillColor = [UIColor colorWithWhite:0.2 alpha:1.0];
|
||||
}
|
||||
else {
|
||||
self.color = [UIColor blackColor];
|
||||
if (style == JGProgressHUDStyleLight) {
|
||||
self.fillColor = [UIColor colorWithWhite:0.85 alpha:1.0];
|
||||
}
|
||||
else {
|
||||
self.fillColor = [UIColor colorWithWhite:0.9 alpha:1.0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ (Class)layerClass {
|
||||
return [JGProgressHUDPieIndicatorLayer class];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,50 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDRingIndicatorView.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 20.7.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
|
||||
#import "JGProgressHUDIndicatorView.h"
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
/**
|
||||
A ring shaped determinate progress indicator.
|
||||
*/
|
||||
@interface JGProgressHUDRingIndicatorView : JGProgressHUDIndicatorView
|
||||
|
||||
/**
|
||||
Background color of the ring.
|
||||
@attention Custom values need to be set after assigning the indicator view to @c JGProgressHUD's @c indicatorView property.
|
||||
|
||||
@b Default: Black for JGProgressHUDStyleDark, light gray otherwise.
|
||||
*/
|
||||
@property (nonatomic, strong, nonnull) UIColor *ringBackgroundColor;
|
||||
|
||||
/**
|
||||
Progress color of the progress ring.
|
||||
@attention Custom values need to be set after assigning the indicator view to @c JGProgressHUD's @c indicatorView property.
|
||||
|
||||
@b Default: White for JGProgressHUDStyleDark, otherwise black.
|
||||
*/
|
||||
@property (nonatomic, strong, nonnull) UIColor *ringColor;
|
||||
|
||||
/**
|
||||
Sets if the progress ring should have a rounded line cap.
|
||||
|
||||
@b Default: NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL roundProgressLine;
|
||||
|
||||
/**
|
||||
Width of the ring.
|
||||
|
||||
@b Default: 3.0.
|
||||
*/
|
||||
@property (nonatomic, assign) CGFloat ringWidth;
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDRingIndicatorView.m
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 20.7.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import "JGProgressHUDRingIndicatorView.h"
|
||||
|
||||
|
||||
@interface JGProgressHUDRingIndicatorLayer : CALayer
|
||||
|
||||
@property (nonatomic, assign) float progress;
|
||||
|
||||
@property (nonatomic, weak) UIColor *ringColor;
|
||||
@property (nonatomic, weak) UIColor *ringBackgroundColor;
|
||||
|
||||
@property (nonatomic, assign) BOOL roundProgressLine;
|
||||
|
||||
@property (nonatomic, assign) CGFloat ringWidth;
|
||||
|
||||
@end
|
||||
|
||||
@implementation JGProgressHUDRingIndicatorLayer
|
||||
|
||||
@dynamic progress, ringBackgroundColor, ringColor, ringWidth, roundProgressLine;
|
||||
|
||||
+ (BOOL)needsDisplayForKey:(NSString *)key {
|
||||
return ([key isEqualToString:@"progress"] || [key isEqualToString:@"ringColor"] || [key isEqualToString:@"ringBackgroundColor"] || [key isEqualToString:@"roundProgressLine"] || [key isEqualToString:@"ringWidth"] || [super needsDisplayForKey:key]);
|
||||
}
|
||||
|
||||
- (id <CAAction>)actionForKey:(NSString *)key {
|
||||
if ([key isEqualToString:@"progress"]) {
|
||||
CABasicAnimation *progressAnimation = [CABasicAnimation animation];
|
||||
progressAnimation.fromValue = [self.presentationLayer valueForKey:key];
|
||||
|
||||
progressAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
||||
|
||||
return progressAnimation;
|
||||
}
|
||||
|
||||
return [super actionForKey:key];
|
||||
}
|
||||
|
||||
- (void)drawInContext:(CGContextRef)ctx {
|
||||
UIGraphicsPushContext(ctx);
|
||||
|
||||
CGRect rect = self.bounds;
|
||||
|
||||
CGPoint center = CGPointMake(rect.origin.x + (CGFloat)floor(rect.size.width/2.0), rect.origin.y + (CGFloat)floor(rect.size.height/2.0));
|
||||
CGFloat lineWidth = self.ringWidth;
|
||||
CGFloat radius = (CGFloat)floor(MIN(rect.size.width, rect.size.height)/2.0) - lineWidth;
|
||||
|
||||
//Background
|
||||
[self.ringBackgroundColor setStroke];
|
||||
|
||||
UIBezierPath *borderPath = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:0.0 endAngle:2.0*(CGFloat)M_PI clockwise:NO];
|
||||
|
||||
[borderPath setLineWidth:lineWidth];
|
||||
[borderPath stroke];
|
||||
|
||||
//Progress
|
||||
[self.ringColor setStroke];
|
||||
|
||||
if (self.progress > 0.0) {
|
||||
UIBezierPath *processPath = [UIBezierPath bezierPath];
|
||||
|
||||
[processPath setLineWidth:lineWidth];
|
||||
[processPath setLineCapStyle:(self.roundProgressLine ? kCGLineCapRound : kCGLineCapSquare)];
|
||||
|
||||
CGFloat startAngle = -((CGFloat)M_PI / 2.0);
|
||||
CGFloat endAngle = startAngle + 2.0 * (CGFloat)M_PI * self.progress;
|
||||
|
||||
[processPath addArcWithCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES];
|
||||
|
||||
[processPath stroke];
|
||||
}
|
||||
|
||||
UIGraphicsPopContext();
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation JGProgressHUDRingIndicatorView
|
||||
|
||||
#pragma mark - Initializers
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super initWithContentView:nil];;
|
||||
|
||||
if (self) {
|
||||
self.layer.contentsScale = [UIScreen mainScreen].scale;
|
||||
[self.layer setNeedsDisplay];
|
||||
|
||||
self.ringWidth = 3.0;
|
||||
self.ringColor = [UIColor clearColor];
|
||||
self.ringBackgroundColor = [UIColor clearColor];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithHUDStyle:(JGProgressHUDStyle)style {
|
||||
return [self init];
|
||||
}
|
||||
|
||||
- (instancetype)initWithContentView:(UIView *)contentView {
|
||||
return [self init];
|
||||
}
|
||||
|
||||
#pragma mark - Getters & Setters
|
||||
|
||||
- (void)setRoundProgressLine:(BOOL)roundProgressLine {
|
||||
if (roundProgressLine == self.roundProgressLine) {
|
||||
return;
|
||||
}
|
||||
|
||||
_roundProgressLine = roundProgressLine;
|
||||
|
||||
[(JGProgressHUDRingIndicatorLayer *)self.layer setRoundProgressLine:self.roundProgressLine];
|
||||
}
|
||||
|
||||
- (void)setRingColor:(UIColor *)tintColor {
|
||||
if ([tintColor isEqual:self.ringColor]) {
|
||||
return;
|
||||
}
|
||||
|
||||
_ringColor = tintColor;
|
||||
|
||||
[(JGProgressHUDRingIndicatorLayer *)self.layer setRingColor:self.ringColor];
|
||||
}
|
||||
|
||||
- (void)setRingBackgroundColor:(UIColor *)backgroundTintColor {
|
||||
if ([backgroundTintColor isEqual:self.ringBackgroundColor]) {
|
||||
return;
|
||||
}
|
||||
|
||||
_ringBackgroundColor = backgroundTintColor;
|
||||
|
||||
[(JGProgressHUDRingIndicatorLayer *)self.layer setRingBackgroundColor:self.ringBackgroundColor];
|
||||
}
|
||||
|
||||
- (void)setRingWidth:(CGFloat)ringWidth {
|
||||
if (fequal(ringWidth, self.ringWidth)) {
|
||||
return;
|
||||
}
|
||||
|
||||
_ringWidth = ringWidth;
|
||||
|
||||
[(JGProgressHUDRingIndicatorLayer *)self.layer setRingWidth:self.ringWidth];
|
||||
}
|
||||
|
||||
- (void)setProgress:(float)progress animated:(BOOL)animated {
|
||||
if (fequal(self.progress, progress)) {
|
||||
return;
|
||||
}
|
||||
|
||||
[super setProgress:progress animated:animated];
|
||||
|
||||
[CATransaction begin];
|
||||
[CATransaction setAnimationDuration:(animated ? 0.3 : 0.0)];
|
||||
|
||||
[(JGProgressHUDRingIndicatorLayer *)self.layer setProgress:self.progress];
|
||||
|
||||
[CATransaction commit];
|
||||
}
|
||||
|
||||
#pragma mark - Overrides
|
||||
|
||||
- (void)setUpForHUDStyle:(JGProgressHUDStyle)style vibrancyEnabled:(BOOL)vibrancyEnabled {
|
||||
[super setUpForHUDStyle:style vibrancyEnabled:vibrancyEnabled];
|
||||
|
||||
if (style == JGProgressHUDStyleDark) {
|
||||
self.ringColor = [UIColor colorWithWhite:1.0 alpha:1.0];
|
||||
self.ringBackgroundColor = [UIColor colorWithWhite:0.0 alpha:1.0];
|
||||
}
|
||||
else {
|
||||
self.ringColor = [UIColor blackColor];
|
||||
if (style == JGProgressHUDStyleLight) {
|
||||
self.ringBackgroundColor = [UIColor colorWithWhite:0.85 alpha:1.0];
|
||||
}
|
||||
else {
|
||||
self.ringBackgroundColor = [UIColor colorWithWhite:0.9 alpha:1.0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ (Class)layerClass {
|
||||
return [JGProgressHUDRingIndicatorLayer class];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,37 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDShadow.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 25.09.17.
|
||||
// Copyright © 2017 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
/**
|
||||
A wrapper representing properties of a shadow.
|
||||
*/
|
||||
@interface JGProgressHUDShadow : NSObject
|
||||
|
||||
- (instancetype __nonnull)initWithColor:(UIColor *__nonnull)color offset:(CGSize)offset radius:(CGFloat)radius opacity:(float)opacity;
|
||||
|
||||
/** Convenience initializer. */
|
||||
+ (instancetype __nonnull)shadowWithColor:(UIColor *__nonnull)color offset:(CGSize)offset radius:(CGFloat)radius opacity:(float)opacity;
|
||||
|
||||
/**
|
||||
The color of the shadow. Colors created from patterns are currently NOT supported.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nonnull) UIColor *color;
|
||||
|
||||
/** The shadow offset. */
|
||||
@property (nonatomic, assign, readonly) CGSize offset;
|
||||
|
||||
/** The blur radius used to create the shadow. */
|
||||
@property (nonatomic, assign, readonly) CGFloat radius;
|
||||
|
||||
/**
|
||||
The opacity of the shadow. Specifying a value outside the [0,1] range will give undefined results.
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) float opacity;
|
||||
|
||||
@end
|
||||
@@ -1,30 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDShadow.m
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 25.09.17.
|
||||
// Copyright © 2017 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import "JGProgressHUDShadow.h"
|
||||
|
||||
@implementation JGProgressHUDShadow
|
||||
|
||||
+ (instancetype)shadowWithColor:(UIColor *)color offset:(CGSize)offset radius:(CGFloat)radius opacity:(float)opacity {
|
||||
return [[self alloc] initWithColor:color offset:offset radius:radius opacity:opacity];
|
||||
}
|
||||
|
||||
- (instancetype)initWithColor:(UIColor *)color offset:(CGSize)offset radius:(CGFloat)radius opacity:(float)opacity {
|
||||
self = [super init];
|
||||
|
||||
if (self) {
|
||||
_color = color;
|
||||
_offset = offset;
|
||||
_radius = radius;
|
||||
_opacity = opacity;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,24 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDSuccessIndicatorView.h
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 19.08.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
|
||||
#import "JGProgressHUDImageIndicatorView.h"
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
/**
|
||||
An image indicator showing a checkmark, representing a failed operation.
|
||||
*/
|
||||
@interface JGProgressHUDSuccessIndicatorView : JGProgressHUDImageIndicatorView
|
||||
|
||||
/**
|
||||
Default initializer for this class.
|
||||
*/
|
||||
- (instancetype __nonnull)init;
|
||||
|
||||
@end
|
||||
@@ -1,56 +0,0 @@
|
||||
//
|
||||
// JGProgressHUDSuccessIndicatorView.m
|
||||
// JGProgressHUD
|
||||
//
|
||||
// Created by Jonas Gessner on 19.08.14.
|
||||
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
|
||||
//
|
||||
|
||||
#import "JGProgressHUDSuccessIndicatorView.h"
|
||||
#import "JGProgressHUD.h"
|
||||
|
||||
static UIBezierPath *successBezierPath() {
|
||||
static UIBezierPath *path;
|
||||
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
path = [UIBezierPath bezierPath];
|
||||
[path moveToPoint:CGPointMake(1.5, 18)];
|
||||
[path addLineToPoint:CGPointMake(11, 28)];
|
||||
[path addLineToPoint:CGPointMake(31.5, 5.5)];
|
||||
|
||||
[path setLineWidth:3];
|
||||
[path setLineJoinStyle:kCGLineJoinRound];
|
||||
[path setLineCapStyle:kCGLineCapRound];
|
||||
});
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@implementation JGProgressHUDSuccessIndicatorView
|
||||
|
||||
- (instancetype)initWithContentView:(UIView *__unused)contentView {
|
||||
UIBezierPath *path = successBezierPath();
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(CGSizeMake(33, 33), NO, 0.0);
|
||||
[[UIColor blackColor] setStroke];
|
||||
[path stroke];
|
||||
|
||||
UIImage *img = [UIGraphicsGetImageFromCurrentImageContext() imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
|
||||
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
self = [super initWithImage:img];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
return [self initWithContentView:nil];
|
||||
}
|
||||
|
||||
- (void)updateAccessibility {
|
||||
self.accessibilityLabel = NSLocalizedString(@"Success",);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,264 +0,0 @@
|
||||
// Copyright (c) 2013, Facebook, Inc.
|
||||
// All rights reserved.
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name Facebook nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "fishhook.h"
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/types.h>
|
||||
#include <mach/mach.h>
|
||||
#include <mach/vm_map.h>
|
||||
#include <mach/vm_region.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#include <mach-o/loader.h>
|
||||
#include <mach-o/nlist.h>
|
||||
|
||||
#ifdef __LP64__
|
||||
typedef struct mach_header_64 mach_header_t;
|
||||
typedef struct segment_command_64 segment_command_t;
|
||||
typedef struct section_64 section_t;
|
||||
typedef struct nlist_64 nlist_t;
|
||||
#define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT_64
|
||||
#else
|
||||
typedef struct mach_header mach_header_t;
|
||||
typedef struct segment_command segment_command_t;
|
||||
typedef struct section section_t;
|
||||
typedef struct nlist nlist_t;
|
||||
#define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT
|
||||
#endif
|
||||
|
||||
#ifndef SEG_DATA_CONST
|
||||
#define SEG_DATA_CONST "__DATA_CONST"
|
||||
#endif
|
||||
|
||||
struct rebindings_entry {
|
||||
struct rebinding *rebindings;
|
||||
size_t rebindings_nel;
|
||||
struct rebindings_entry *next;
|
||||
};
|
||||
|
||||
static struct rebindings_entry *_rebindings_head;
|
||||
|
||||
static int prepend_rebindings(struct rebindings_entry **rebindings_head,
|
||||
struct rebinding rebindings[],
|
||||
size_t nel) {
|
||||
struct rebindings_entry *new_entry = (struct rebindings_entry *) malloc(sizeof(struct rebindings_entry));
|
||||
if (!new_entry) {
|
||||
return -1;
|
||||
}
|
||||
new_entry->rebindings = (struct rebinding *) malloc(sizeof(struct rebinding) * nel);
|
||||
if (!new_entry->rebindings) {
|
||||
free(new_entry);
|
||||
return -1;
|
||||
}
|
||||
memcpy(new_entry->rebindings, rebindings, sizeof(struct rebinding) * nel);
|
||||
new_entry->rebindings_nel = nel;
|
||||
new_entry->next = *rebindings_head;
|
||||
*rebindings_head = new_entry;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int get_protection(void *addr, vm_prot_t *prot, vm_prot_t *max_prot) {
|
||||
mach_port_t task = mach_task_self();
|
||||
vm_size_t size = 0;
|
||||
vm_address_t address = (vm_address_t)addr;
|
||||
memory_object_name_t object;
|
||||
#ifdef __LP64__
|
||||
mach_msg_type_number_t count = VM_REGION_BASIC_INFO_COUNT_64;
|
||||
vm_region_basic_info_data_64_t info;
|
||||
kern_return_t info_ret = vm_region_64(
|
||||
task, &address, &size, VM_REGION_BASIC_INFO_64, (vm_region_info_64_t)&info, &count, &object);
|
||||
#else
|
||||
mach_msg_type_number_t count = VM_REGION_BASIC_INFO_COUNT;
|
||||
vm_region_basic_info_data_t info;
|
||||
kern_return_t info_ret = vm_region(task, &address, &size, VM_REGION_BASIC_INFO, (vm_region_info_t)&info, &count, &object);
|
||||
#endif
|
||||
if (info_ret == KERN_SUCCESS) {
|
||||
if (prot != NULL)
|
||||
*prot = info.protection;
|
||||
|
||||
if (max_prot != NULL)
|
||||
*max_prot = info.max_protection;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void perform_rebinding_with_section(struct rebindings_entry *rebindings,
|
||||
section_t *section,
|
||||
intptr_t slide,
|
||||
nlist_t *symtab,
|
||||
char *strtab,
|
||||
uint32_t *indirect_symtab) {
|
||||
uint32_t *indirect_symbol_indices = indirect_symtab + section->reserved1;
|
||||
void **indirect_symbol_bindings = (void **)((uintptr_t)slide + section->addr);
|
||||
|
||||
for (uint i = 0; i < section->size / sizeof(void *); i++) {
|
||||
uint32_t symtab_index = indirect_symbol_indices[i];
|
||||
if (symtab_index == INDIRECT_SYMBOL_ABS || symtab_index == INDIRECT_SYMBOL_LOCAL ||
|
||||
symtab_index == (INDIRECT_SYMBOL_LOCAL | INDIRECT_SYMBOL_ABS)) {
|
||||
continue;
|
||||
}
|
||||
uint32_t strtab_offset = symtab[symtab_index].n_un.n_strx;
|
||||
char *symbol_name = strtab + strtab_offset;
|
||||
bool symbol_name_longer_than_1 = symbol_name[0] && symbol_name[1];
|
||||
struct rebindings_entry *cur = rebindings;
|
||||
while (cur) {
|
||||
for (uint j = 0; j < cur->rebindings_nel; j++) {
|
||||
if (symbol_name_longer_than_1 && strcmp(&symbol_name[1], cur->rebindings[j].name) == 0) {
|
||||
kern_return_t err;
|
||||
|
||||
if (cur->rebindings[j].replaced != NULL && indirect_symbol_bindings[i] != cur->rebindings[j].replacement)
|
||||
*(cur->rebindings[j].replaced) = indirect_symbol_bindings[i];
|
||||
|
||||
/**
|
||||
* 1. Moved the vm protection modifying codes to here to reduce the
|
||||
* changing scope.
|
||||
* 2. Adding VM_PROT_WRITE mode unconditionally because vm_region
|
||||
* API on some iOS/Mac reports mismatch vm protection attributes.
|
||||
* -- Lianfu Hao Jun 16th, 2021
|
||||
**/
|
||||
err = vm_protect (mach_task_self (), (uintptr_t)indirect_symbol_bindings, section->size, 0, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY);
|
||||
if (err == KERN_SUCCESS) {
|
||||
/**
|
||||
* Once we failed to change the vm protection, we
|
||||
* MUST NOT continue the following write actions!
|
||||
* iOS 15 has corrected the const segments prot.
|
||||
* -- Lionfore Hao Jun 11th, 2021
|
||||
**/
|
||||
indirect_symbol_bindings[i] = cur->rebindings[j].replacement;
|
||||
}
|
||||
goto symbol_loop;
|
||||
}
|
||||
}
|
||||
cur = cur->next;
|
||||
}
|
||||
symbol_loop:;
|
||||
}
|
||||
}
|
||||
|
||||
static void rebind_symbols_for_image(struct rebindings_entry *rebindings,
|
||||
const struct mach_header *header,
|
||||
intptr_t slide) {
|
||||
Dl_info info;
|
||||
if (dladdr(header, &info) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
segment_command_t *cur_seg_cmd;
|
||||
segment_command_t *linkedit_segment = NULL;
|
||||
struct symtab_command* symtab_cmd = NULL;
|
||||
struct dysymtab_command* dysymtab_cmd = NULL;
|
||||
|
||||
uintptr_t cur = (uintptr_t)header + sizeof(mach_header_t);
|
||||
for (uint i = 0; i < header->ncmds; i++, cur += cur_seg_cmd->cmdsize) {
|
||||
cur_seg_cmd = (segment_command_t *)cur;
|
||||
if (cur_seg_cmd->cmd == LC_SEGMENT_ARCH_DEPENDENT) {
|
||||
if (strcmp(cur_seg_cmd->segname, SEG_LINKEDIT) == 0) {
|
||||
linkedit_segment = cur_seg_cmd;
|
||||
}
|
||||
} else if (cur_seg_cmd->cmd == LC_SYMTAB) {
|
||||
symtab_cmd = (struct symtab_command*)cur_seg_cmd;
|
||||
} else if (cur_seg_cmd->cmd == LC_DYSYMTAB) {
|
||||
dysymtab_cmd = (struct dysymtab_command*)cur_seg_cmd;
|
||||
}
|
||||
}
|
||||
|
||||
if (!symtab_cmd || !dysymtab_cmd || !linkedit_segment ||
|
||||
!dysymtab_cmd->nindirectsyms) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find base symbol/string table addresses
|
||||
uintptr_t linkedit_base = (uintptr_t)slide + linkedit_segment->vmaddr - linkedit_segment->fileoff;
|
||||
nlist_t *symtab = (nlist_t *)(linkedit_base + symtab_cmd->symoff);
|
||||
char *strtab = (char *)(linkedit_base + symtab_cmd->stroff);
|
||||
|
||||
// Get indirect symbol table (array of uint32_t indices into symbol table)
|
||||
uint32_t *indirect_symtab = (uint32_t *)(linkedit_base + dysymtab_cmd->indirectsymoff);
|
||||
|
||||
cur = (uintptr_t)header + sizeof(mach_header_t);
|
||||
for (uint i = 0; i < header->ncmds; i++, cur += cur_seg_cmd->cmdsize) {
|
||||
cur_seg_cmd = (segment_command_t *)cur;
|
||||
if (cur_seg_cmd->cmd == LC_SEGMENT_ARCH_DEPENDENT) {
|
||||
if (strcmp(cur_seg_cmd->segname, SEG_DATA) != 0 &&
|
||||
strcmp(cur_seg_cmd->segname, SEG_DATA_CONST) != 0) {
|
||||
continue;
|
||||
}
|
||||
for (uint j = 0; j < cur_seg_cmd->nsects; j++) {
|
||||
section_t *sect =
|
||||
(section_t *)(cur + sizeof(segment_command_t)) + j;
|
||||
if ((sect->flags & SECTION_TYPE) == S_LAZY_SYMBOL_POINTERS) {
|
||||
perform_rebinding_with_section(rebindings, sect, slide, symtab, strtab, indirect_symtab);
|
||||
}
|
||||
if ((sect->flags & SECTION_TYPE) == S_NON_LAZY_SYMBOL_POINTERS) {
|
||||
perform_rebinding_with_section(rebindings, sect, slide, symtab, strtab, indirect_symtab);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void _rebind_symbols_for_image(const struct mach_header *header,
|
||||
intptr_t slide) {
|
||||
rebind_symbols_for_image(_rebindings_head, header, slide);
|
||||
}
|
||||
|
||||
int rebind_symbols_image(void *header,
|
||||
intptr_t slide,
|
||||
struct rebinding rebindings[],
|
||||
size_t rebindings_nel) {
|
||||
struct rebindings_entry *rebindings_head = NULL;
|
||||
int retval = prepend_rebindings(&rebindings_head, rebindings, rebindings_nel);
|
||||
rebind_symbols_for_image(rebindings_head, (const struct mach_header *) header, slide);
|
||||
if (rebindings_head) {
|
||||
free(rebindings_head->rebindings);
|
||||
}
|
||||
free(rebindings_head);
|
||||
return retval;
|
||||
}
|
||||
|
||||
int rebind_symbols(struct rebinding rebindings[], size_t rebindings_nel) {
|
||||
int retval = prepend_rebindings(&_rebindings_head, rebindings, rebindings_nel);
|
||||
if (retval < 0) {
|
||||
return retval;
|
||||
}
|
||||
// If this was the first call, register callback for image additions (which is also invoked for
|
||||
// existing images, otherwise, just run on existing images
|
||||
if (!_rebindings_head->next) {
|
||||
_dyld_register_func_for_add_image(_rebind_symbols_for_image);
|
||||
} else {
|
||||
uint32_t c = _dyld_image_count();
|
||||
for (uint32_t i = 0; i < c; i++) {
|
||||
_rebind_symbols_for_image(_dyld_get_image_header(i), _dyld_get_image_vmaddr_slide(i));
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
// Copyright (c) 2013, Facebook, Inc.
|
||||
// All rights reserved.
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name Facebook nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef fishhook_h
|
||||
#define fishhook_h
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if !defined(FISHHOOK_EXPORT)
|
||||
#define FISHHOOK_VISIBILITY __attribute__((visibility("hidden")))
|
||||
#else
|
||||
#define FISHHOOK_VISIBILITY __attribute__((visibility("default")))
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
/*
|
||||
* A structure representing a particular intended rebinding from a symbol
|
||||
* name to its replacement
|
||||
*/
|
||||
struct rebinding {
|
||||
const char *name;
|
||||
void *replacement;
|
||||
void **replaced;
|
||||
};
|
||||
|
||||
/*
|
||||
* For each rebinding in rebindings, rebinds references to external, indirect
|
||||
* symbols with the specified name to instead point at replacement for each
|
||||
* image in the calling process as well as for all future images that are loaded
|
||||
* by the process. If rebind_functions is called more than once, the symbols to
|
||||
* rebind are added to the existing list of rebindings, and if a given symbol
|
||||
* is rebound more than once, the later rebinding will take precedence.
|
||||
*/
|
||||
FISHHOOK_VISIBILITY
|
||||
int rebind_symbols(struct rebinding rebindings[], size_t rebindings_nel);
|
||||
|
||||
/*
|
||||
* Rebinds as above, but only in the specified image. The header should point
|
||||
* to the mach-o header, the slide should be the slide offset. Others as above.
|
||||
*/
|
||||
FISHHOOK_VISIBILITY
|
||||
int rebind_symbols_image(void *header,
|
||||
intptr_t slide,
|
||||
struct rebinding rebindings[],
|
||||
size_t rebindings_nel);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //fishhook_h
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "../../modules/JGProgressHUD/JGProgressHUD.h"
|
||||
|
||||
#import "../InstagramHeaders.h"
|
||||
#import "../Utils.h"
|
||||
|
||||
#import "Manager.h"
|
||||
|
||||
@interface SCIDownloadPillView : UIView
|
||||
@property (nonatomic, strong) UIProgressView *progressRing;
|
||||
@property (nonatomic, strong) UILabel *textLabel;
|
||||
@property (nonatomic, strong) UILabel *subtitleLabel;
|
||||
@property (nonatomic, strong) UIButton *cancelButton;
|
||||
@property (nonatomic, copy) void (^onCancel)(void);
|
||||
|
||||
- (void)showInView:(UIView *)view;
|
||||
- (void)dismiss;
|
||||
- (void)dismissAfterDelay:(NSTimeInterval)delay;
|
||||
- (void)setProgress:(float)progress;
|
||||
- (void)setText:(NSString *)text;
|
||||
@end
|
||||
|
||||
@interface SCIDownloadDelegate : NSObject <SCIDownloadDelegateProtocol>
|
||||
|
||||
typedef NS_ENUM(NSUInteger, DownloadAction) {
|
||||
share,
|
||||
quickLook,
|
||||
saveToPhotos
|
||||
};
|
||||
@property (nonatomic, readonly) DownloadAction action;
|
||||
@property (nonatomic, readonly) BOOL showProgress;
|
||||
|
||||
@property (nonatomic, strong) SCIDownloadManager *downloadManager;
|
||||
@property (nonatomic, strong) SCIDownloadPillView *pill;
|
||||
|
||||
- (instancetype)initWithAction:(DownloadAction)action showProgress:(BOOL)showProgress;
|
||||
|
||||
- (void)downloadFileWithURL:(NSURL *)url fileExtension:(NSString *)fileExtension hudLabel:(NSString *)hudLabel;
|
||||
|
||||
@end
|
||||
@@ -1,266 +0,0 @@
|
||||
#import "Download.h"
|
||||
#import "../PhotoAlbum.h"
|
||||
#import <Photos/Photos.h>
|
||||
|
||||
#pragma mark - SCIDownloadPillView
|
||||
|
||||
@implementation SCIDownloadPillView
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super initWithFrame:CGRectZero];
|
||||
if (self) {
|
||||
self.backgroundColor = [UIColor colorWithWhite:0.1 alpha:0.92];
|
||||
self.layer.cornerRadius = 20;
|
||||
self.clipsToBounds = YES;
|
||||
self.alpha = 0;
|
||||
|
||||
// Circular progress (using a small CAShapeLayer ring)
|
||||
_progressRing = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
|
||||
_progressRing.progressTintColor = [UIColor systemBlueColor];
|
||||
_progressRing.trackTintColor = [UIColor colorWithWhite:0.3 alpha:1.0];
|
||||
_progressRing.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
_progressRing.layer.cornerRadius = 2;
|
||||
_progressRing.clipsToBounds = YES;
|
||||
[self addSubview:_progressRing];
|
||||
|
||||
// Text
|
||||
_textLabel = [[UILabel alloc] init];
|
||||
_textLabel.text = @"Downloading 0%";
|
||||
_textLabel.textColor = [UIColor whiteColor];
|
||||
_textLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold];
|
||||
_textLabel.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[self addSubview:_textLabel];
|
||||
|
||||
// Subtitle
|
||||
_subtitleLabel = [[UILabel alloc] init];
|
||||
_subtitleLabel.text = @"Tap to cancel";
|
||||
_subtitleLabel.textColor = [UIColor colorWithWhite:0.6 alpha:1.0];
|
||||
_subtitleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightRegular];
|
||||
_subtitleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_subtitleLabel.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[self addSubview:_subtitleLabel];
|
||||
|
||||
// Tap gesture for cancel
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap)];
|
||||
[self addGestureRecognizer:tap];
|
||||
|
||||
// Layout: [progress bar]
|
||||
// [text centered]
|
||||
// [subtitle centered]
|
||||
[NSLayoutConstraint activateConstraints:@[
|
||||
[_progressRing.topAnchor constraintEqualToAnchor:self.topAnchor constant:12],
|
||||
[_progressRing.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:16],
|
||||
[_progressRing.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-16],
|
||||
[_progressRing.heightAnchor constraintEqualToConstant:4],
|
||||
|
||||
[_textLabel.topAnchor constraintEqualToAnchor:_progressRing.bottomAnchor constant:6],
|
||||
[_textLabel.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
|
||||
|
||||
[_subtitleLabel.topAnchor constraintEqualToAnchor:_textLabel.bottomAnchor constant:2],
|
||||
[_subtitleLabel.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
|
||||
[_subtitleLabel.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-10],
|
||||
]];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)handleTap {
|
||||
if (self.onCancel) self.onCancel();
|
||||
}
|
||||
|
||||
- (void)showInView:(UIView *)view {
|
||||
[self removeFromSuperview];
|
||||
self.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[view addSubview:self];
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[
|
||||
[self.topAnchor constraintEqualToAnchor:view.safeAreaLayoutGuide.topAnchor constant:4],
|
||||
[self.centerXAnchor constraintEqualToAnchor:view.centerXAnchor],
|
||||
[self.widthAnchor constraintGreaterThanOrEqualToConstant:160],
|
||||
[self.widthAnchor constraintLessThanOrEqualToConstant:220],
|
||||
]];
|
||||
|
||||
[UIView animateWithDuration:0.25 animations:^{
|
||||
self.alpha = 1;
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)dismiss {
|
||||
[UIView animateWithDuration:0.2 animations:^{
|
||||
self.alpha = 0;
|
||||
} completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)dismissAfterDelay:(NSTimeInterval)delay {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self dismiss];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)setProgress:(float)progress {
|
||||
[self.progressRing setProgress:progress animated:YES];
|
||||
}
|
||||
|
||||
- (void)setText:(NSString *)text {
|
||||
self.textLabel.text = text;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#pragma mark - SCIDownloadDelegate
|
||||
|
||||
@implementation SCIDownloadDelegate
|
||||
|
||||
- (instancetype)initWithAction:(DownloadAction)action showProgress:(BOOL)showProgress {
|
||||
self = [super init];
|
||||
|
||||
if (self) {
|
||||
_action = action;
|
||||
_showProgress = showProgress;
|
||||
self.downloadManager = [[SCIDownloadManager alloc] initWithDelegate:self];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)downloadFileWithURL:(NSURL *)url fileExtension:(NSString *)fileExtension hudLabel:(NSString *)hudLabel {
|
||||
// Dismiss any existing pill
|
||||
[self.pill dismiss];
|
||||
|
||||
self.pill = [[SCIDownloadPillView alloc] init];
|
||||
|
||||
if (hudLabel) {
|
||||
[self.pill setText:hudLabel];
|
||||
}
|
||||
|
||||
if (!self.showProgress) {
|
||||
self.pill.progressRing.hidden = YES;
|
||||
self.pill.subtitleLabel.text = nil;
|
||||
}
|
||||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
self.pill.onCancel = ^{
|
||||
[weakSelf.downloadManager cancelDownload];
|
||||
};
|
||||
|
||||
// Show on keyWindow so it survives VC transitions (e.g. leaving stories)
|
||||
UIView *hostView = [UIApplication sharedApplication].keyWindow;
|
||||
if (!hostView) hostView = topMostController().view;
|
||||
if (!hostView) {
|
||||
NSLog(@"[SCInsta] Download: No valid view");
|
||||
return;
|
||||
}
|
||||
[self.pill showInView:hostView];
|
||||
|
||||
NSLog(@"[SCInsta] Download: Will start download for url \"%@\" with file extension: \".%@\"", url, fileExtension);
|
||||
[self.downloadManager downloadFileWithURL:url fileExtension:fileExtension];
|
||||
}
|
||||
|
||||
- (void)downloadDidStart {
|
||||
NSLog(@"[SCInsta] Download: Download started");
|
||||
}
|
||||
|
||||
- (void)downloadDidCancel {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.pill setText:@"Cancelled"];
|
||||
self.pill.subtitleLabel.text = nil;
|
||||
self.pill.progressRing.hidden = YES;
|
||||
[self.pill dismissAfterDelay:0.8];
|
||||
});
|
||||
NSLog(@"[SCInsta] Download: Download cancelled");
|
||||
}
|
||||
|
||||
- (void)downloadDidProgress:(float)progress {
|
||||
if (self.showProgress) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.pill setProgress:progress];
|
||||
[self.pill setText:[NSString stringWithFormat:@"Downloading %d%%", (int)(progress * 100)]];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (void)downloadDidFinishWithError:(NSError *)error {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (error && error.code != NSURLErrorCancelled) {
|
||||
NSLog(@"[SCInsta] Download: Download failed with error: \"%@\"", error);
|
||||
[self.pill setText:@"Download failed"];
|
||||
self.pill.subtitleLabel.text = error.localizedDescription;
|
||||
self.pill.progressRing.hidden = YES;
|
||||
[self.pill dismissAfterDelay:3.0];
|
||||
} else if (!error) {
|
||||
// nil error without fileURL callback — dismiss stale pill
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
if (self.pill.superview) [self.pill dismissAfterDelay:0];
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (void)downloadDidFinishWithFileURL:(NSURL *)fileURL {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.pill dismiss];
|
||||
|
||||
NSLog(@"[SCInsta] Download: Finished with url: \"%@\"", [fileURL absoluteString]);
|
||||
|
||||
switch (self.action) {
|
||||
case share:
|
||||
[SCIUtils showShareVC:fileURL];
|
||||
break;
|
||||
|
||||
case quickLook:
|
||||
[SCIUtils showQuickLookVC:@[fileURL]];
|
||||
break;
|
||||
|
||||
case saveToPhotos: {
|
||||
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
|
||||
if (status != PHAuthorizationStatusAuthorized) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[SCIUtils showErrorHUDWithDescription:@"Photo library access denied"];
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
BOOL useAlbum = [SCIUtils getBoolPref:@"save_to_ryukgram_album"];
|
||||
void (^onDone)(BOOL, NSError *) = ^(BOOL success, NSError *error) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (success) {
|
||||
SCIDownloadPillView *donePill = [[SCIDownloadPillView alloc] init];
|
||||
donePill.progressRing.hidden = YES;
|
||||
donePill.subtitleLabel.text = nil;
|
||||
[donePill setText:useAlbum ? @"Saved to RyukGram" : @"Saved to Photos"];
|
||||
UIView *hostView = topMostController().view;
|
||||
if (hostView) {
|
||||
[donePill showInView:hostView];
|
||||
[donePill dismissAfterDelay:1.5];
|
||||
}
|
||||
} else {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Failed to save to Photos"];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (useAlbum) {
|
||||
[SCIPhotoAlbum saveFileToAlbum:fileURL completion:onDone];
|
||||
} else {
|
||||
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
|
||||
NSString *ext = [[fileURL pathExtension] lowercaseString];
|
||||
BOOL isVideo = [@[@"mp4", @"mov", @"m4v"] containsObject:ext];
|
||||
PHAssetCreationRequest *req = [PHAssetCreationRequest creationRequestForAsset];
|
||||
PHAssetResourceCreationOptions *opts = [[PHAssetResourceCreationOptions alloc] init];
|
||||
opts.shouldMoveFile = YES;
|
||||
[req addResourceWithType:(isVideo ? PHAssetResourceTypeVideo : PHAssetResourceTypePhoto)
|
||||
fileURL:fileURL options:opts];
|
||||
req.creationDate = [NSDate date];
|
||||
} completionHandler:onDone];
|
||||
}
|
||||
}];
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,32 +0,0 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@protocol SCIDownloadDelegateProtocol <NSObject>
|
||||
|
||||
// Methods
|
||||
- (void)downloadDidStart;
|
||||
- (void)downloadDidCancel;
|
||||
- (void)downloadDidProgress:(float)progress;
|
||||
- (void)downloadDidFinishWithError:(NSError *)error;
|
||||
- (void)downloadDidFinishWithFileURL:(NSURL *)fileURL;
|
||||
|
||||
@end
|
||||
|
||||
@interface SCIDownloadManager : NSObject <NSURLSessionDownloadDelegate>
|
||||
|
||||
// Properties
|
||||
@property (nonatomic, weak) id<SCIDownloadDelegateProtocol> delegate;
|
||||
@property (nonatomic, strong) NSURLSession *session;
|
||||
@property (nonatomic, strong) NSURLSessionDownloadTask *task;
|
||||
@property (nonatomic, strong) NSString *fileExtension;
|
||||
|
||||
// Methods
|
||||
- (instancetype)initWithDelegate:(id<SCIDownloadDelegateProtocol>)downloadDelegate;
|
||||
|
||||
- (void)downloadFileWithURL:(NSURL *)url fileExtension:(NSString *)fileExtension;
|
||||
|
||||
- (void)cancelDownload;
|
||||
|
||||
- (NSURL *)moveFileToCacheDir:(NSURL *)oldPath;
|
||||
|
||||
@end
|
||||
@@ -1,75 +0,0 @@
|
||||
#import "Manager.h"
|
||||
|
||||
@implementation SCIDownloadManager
|
||||
|
||||
- (instancetype)initWithDelegate:(id<SCIDownloadDelegateProtocol>)downloadDelegate {
|
||||
self = [super init];
|
||||
|
||||
if (self) {
|
||||
self.delegate = downloadDelegate;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)downloadFileWithURL:(NSURL *)url fileExtension:(NSString *)fileExtension {
|
||||
// Properties
|
||||
self.session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:self delegateQueue:nil];
|
||||
self.task = [self.session downloadTaskWithURL:url];
|
||||
|
||||
// Default to jpg if no other reasonable length extension is provided
|
||||
self.fileExtension = [fileExtension length] >= 3 ? fileExtension : @"jpg";
|
||||
|
||||
[self.task resume];
|
||||
[self.delegate downloadDidStart];
|
||||
}
|
||||
|
||||
- (void)cancelDownload {
|
||||
[self.task cancel];
|
||||
[self.delegate downloadDidCancel];
|
||||
}
|
||||
|
||||
// URLSession methods
|
||||
- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite {
|
||||
NSLog(@"Task wrote %lld bytes of %lld bytes", bytesWritten, totalBytesExpectedToWrite);
|
||||
|
||||
float progress = (float)totalBytesWritten / (float)totalBytesExpectedToWrite;
|
||||
|
||||
[self.delegate downloadDidProgress:progress];
|
||||
}
|
||||
|
||||
- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location {
|
||||
// Move downloaded file to cache directory
|
||||
NSURL *finalLocation = [self moveFileToCacheDir:location];
|
||||
|
||||
[self.delegate downloadDidFinishWithFileURL:finalLocation];
|
||||
}
|
||||
|
||||
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error {
|
||||
NSLog(@"Task completed with error: %@", error);
|
||||
|
||||
[self.delegate downloadDidFinishWithError:error];
|
||||
}
|
||||
|
||||
// Rename downloaded file & move from documents dir -> cache dir
|
||||
- (NSURL *)moveFileToCacheDir:(NSURL *)oldPath {
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
|
||||
NSString *cacheDirectoryPath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;
|
||||
NSURL *newPath = [[NSURL fileURLWithPath:cacheDirectoryPath] URLByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", NSUUID.UUID.UUIDString, self.fileExtension]];
|
||||
|
||||
NSLog(@"[SCInsta] Download Handler: Moving file from: %@ to: %@", oldPath.absoluteString, newPath.absoluteString);
|
||||
|
||||
// Move file to cache directory
|
||||
NSError *fileMoveError;
|
||||
[fileManager moveItemAtURL:oldPath toURL:newPath error:&fileMoveError];
|
||||
|
||||
if (fileMoveError) {
|
||||
NSLog(@"[SCInsta] Download Handler: Error while moving file: %@", oldPath.absoluteString);
|
||||
NSLog(@"[SCInsta] Download Handler: %@", fileMoveError);
|
||||
}
|
||||
|
||||
return newPath;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,25 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
%hook IGDirectThreadCallButtonsCoordinator
|
||||
// Voice Call
|
||||
- (void)_didTapAudioButton:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"call_confirm"]) {
|
||||
NSLog(@"[SCInsta] Call confirm triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
|
||||
// Video Call
|
||||
- (void)_didTapVideoButton:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"call_confirm"]) {
|
||||
NSLog(@"[SCInsta] Call confirm triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
@@ -1,35 +0,0 @@
|
||||
#import "../../InstagramHeaders.h"
|
||||
#import "../../Utils.h"
|
||||
|
||||
%hook IGDirectThreadThemePickerViewController
|
||||
- (void)themeNewPickerSectionController:(id)arg1 didSelectTheme:(id)arg2 atIndex:(NSInteger)arg3 {
|
||||
if ([SCIUtils getBoolPref:@"change_direct_theme_confirm"]) {
|
||||
NSLog(@"[SCInsta] Confirm change direct theme triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
- (void)themePickerSectionController:(id)arg1 didSelectThemeId:(id)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"change_direct_theme_confirm"]) {
|
||||
NSLog(@"[SCInsta] Confirm change direct theme triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
%hook IGDirectThreadThemeKitSwift.IGDirectThreadThemePreviewController
|
||||
- (void)primaryButtonTapped {
|
||||
if ([SCIUtils getBoolPref:@"change_direct_theme_confirm"]) {
|
||||
NSLog(@"[SCInsta] Confirm change direct theme triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
@@ -1,38 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
// Legacy hook (for non ai voices interface)
|
||||
%hook IGDirectThreadViewController
|
||||
- (void)voiceRecordViewController:(id)arg1 didRecordAudioClipWithURL:(id)arg2 waveform:(id)arg3 duration:(CGFloat)arg4 entryPoint:(NSInteger)arg5 {
|
||||
if ([SCIUtils getBoolPref:@"voice_message_confirm"]) {
|
||||
NSLog(@"[SCInsta] DM audio message confirm triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Workaround until I can figure out how to stop long press recording from automatically sending
|
||||
%hook IGDirectComposer
|
||||
- (void)_didLongPressVoiceMessage:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"voice_message_confirm"]) {
|
||||
return;
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Demangled name: IGDirectAIVoiceUIKit.CompactBarContentView
|
||||
%hook _TtC20IGDirectAIVoiceUIKitP33_5754F7617E0D924F9A84EFA352BBD29A21CompactBarContentView
|
||||
- (void)didTapSend {
|
||||
if ([SCIUtils getBoolPref:@"voice_message_confirm"]) {
|
||||
NSLog(@"[SCInsta] DM audio message confirm triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
@@ -1,103 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
#define CONFIRMFOLLOW(orig) \
|
||||
if ([SCIUtils getBoolPref:@"follow_confirm"]) { \
|
||||
NSLog(@"[SCInsta] Confirm follow triggered"); \
|
||||
\
|
||||
[SCIUtils showConfirmation:^(void) { orig; }]; \
|
||||
} \
|
||||
else { \
|
||||
return orig; \
|
||||
} \
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
// Follow button on profile page
|
||||
%hook IGFollowController
|
||||
- (void)_didPressFollowButton {
|
||||
// Get user follow status (check if already following user)
|
||||
NSInteger UserFollowStatus = self.user.followStatus;
|
||||
|
||||
// Only show confirm dialog if user is not following
|
||||
if (UserFollowStatus == 2) {
|
||||
CONFIRMFOLLOW(%orig);
|
||||
}
|
||||
else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Follow button on discover people page
|
||||
%hook IGDiscoverPeopleButtonGroupView
|
||||
- (void)_onFollowButtonTapped:(id)arg1 {
|
||||
CONFIRMFOLLOW(%orig);
|
||||
}
|
||||
- (void)_onFollowingButtonTapped:(id)arg1 {
|
||||
CONFIRMFOLLOW(%orig);
|
||||
}
|
||||
%end
|
||||
|
||||
// Suggested for you (home feed & profile) follow button
|
||||
%hook IGHScrollAYMFCell
|
||||
- (void)_didTapAYMFActionButton {
|
||||
CONFIRMFOLLOW(%orig);
|
||||
}
|
||||
%end
|
||||
%hook IGHScrollAYMFActionButton
|
||||
- (void)_didTapTextActionButton {
|
||||
CONFIRMFOLLOW(%orig);
|
||||
}
|
||||
%end
|
||||
|
||||
// Follow button on reels
|
||||
%hook IGUnifiedVideoFollowButton
|
||||
- (void)_hackilyHandleOurOwnButtonTaps:(id)arg1 event:(id)arg2 {
|
||||
CONFIRMFOLLOW(%orig);
|
||||
}
|
||||
%end
|
||||
|
||||
// Follow text on profile (when collapsed into top bar)
|
||||
%hook IGProfileViewController
|
||||
- (void)navigationItemsControllerDidTapHeaderFollowButton:(id)arg1 {
|
||||
CONFIRMFOLLOW(%orig);
|
||||
}
|
||||
%end
|
||||
|
||||
// Follow button on suggested friends (in story section)
|
||||
%hook IGStorySectionController
|
||||
- (void)followButtonTapped:(id)arg1 cell:(id)arg2 {
|
||||
CONFIRMFOLLOW(%orig);
|
||||
}
|
||||
%end
|
||||
|
||||
// Follow all button in group chats (3+ members) people view
|
||||
static void (*orig_listSectionController)(id, SEL, id, id);
|
||||
|
||||
static void hooked_listSectionController(id self, SEL _cmd, id arg1, id arg2) {
|
||||
if ([SCIUtils getBoolPref:@"follow_confirm"]) {
|
||||
|
||||
[SCIUtils showConfirmation:^{
|
||||
orig_listSectionController(self, _cmd, arg1, arg2);
|
||||
}];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
orig_listSectionController(self, _cmd, arg1, arg2);
|
||||
}
|
||||
|
||||
%ctor {
|
||||
Class cls = objc_getClass("IGDirectDetailMembersKit.IGDirectThreadDetailsMembersListViewController");
|
||||
if (!cls) return;
|
||||
|
||||
MSHookMessageEx(
|
||||
cls,
|
||||
@selector(listSectionController:didTapHeaderButtonWithViewModel:),
|
||||
(IMP)hooked_listSectionController,
|
||||
(IMP *)&orig_listSectionController
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
%hook IGPendingRequestView
|
||||
- (void)_onApproveButtonTapped {
|
||||
if ([SCIUtils getBoolPref:@"follow_request_confirm"]) {
|
||||
NSLog(@"[SCInsta] Confirm follow request triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
- (void)_onIgnoreButtonTapped {
|
||||
if ([SCIUtils getBoolPref:@"follow_request_confirm"]) {
|
||||
NSLog(@"[SCInsta] Confirm follow request triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
@@ -1,150 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
// Confirmation handlers
|
||||
|
||||
#define CONFIRMPOSTLIKE(orig) \
|
||||
if ([SCIUtils getBoolPref:@"like_confirm"]) { \
|
||||
NSLog(@"[SCInsta] Confirm post like triggered"); \
|
||||
\
|
||||
[SCIUtils showConfirmation:^(void) { orig; }]; \
|
||||
} \
|
||||
else { \
|
||||
return orig; \
|
||||
} \
|
||||
|
||||
#define CONFIRMREELSLIKE(orig) \
|
||||
if ([SCIUtils getBoolPref:@"like_confirm_reels"]) { \
|
||||
NSLog(@"[SCInsta] Confirm reels like triggered"); \
|
||||
\
|
||||
[SCIUtils showConfirmation:^(void) { orig; }]; \
|
||||
} \
|
||||
else { \
|
||||
return orig; \
|
||||
} \
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
// Liking posts
|
||||
%hook IGUFIButtonBarView
|
||||
- (void)_onLikeButtonPressed:(id)arg1 {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
%end
|
||||
%hook IGFeedPhotoView
|
||||
- (void)_onDoubleTap:(id)arg1 {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
%end
|
||||
%hook IGVideoPlayerOverlayContainerView
|
||||
- (void)_handleDoubleTapGesture:(id)arg1 {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
%end
|
||||
|
||||
// Liking reels
|
||||
%hook IGSundialViewerVideoCell
|
||||
- (void)controlsOverlayControllerDidTapLikeButton:(id)arg1 {
|
||||
CONFIRMREELSLIKE(%orig);
|
||||
}
|
||||
- (void)controlsOverlayControllerDidLongPressLikeButton:(id)arg1 gestureRecognizer:(id)arg2 {
|
||||
CONFIRMREELSLIKE(%orig);
|
||||
}
|
||||
- (void)gestureController:(id)arg1 didObserveDoubleTap:(id)arg2 {
|
||||
CONFIRMREELSLIKE(%orig);
|
||||
}
|
||||
%end
|
||||
%hook IGSundialViewerPhotoCell
|
||||
- (void)controlsOverlayControllerDidTapLikeButton:(id)arg1 {
|
||||
CONFIRMREELSLIKE(%orig);
|
||||
}
|
||||
- (void)gestureController:(id)arg1 didObserveDoubleTap:(id)arg2 {
|
||||
CONFIRMREELSLIKE(%orig);
|
||||
}
|
||||
%end
|
||||
%hook IGSundialViewerCarouselCell
|
||||
- (void)controlsOverlayControllerDidTapLikeButton:(id)arg1 {
|
||||
CONFIRMREELSLIKE(%orig);
|
||||
}
|
||||
- (void)gestureController:(id)arg1 didObserveDoubleTap:(id)arg2 {
|
||||
CONFIRMREELSLIKE(%orig);
|
||||
}
|
||||
%end
|
||||
|
||||
// Liking comments
|
||||
%hook IGCommentCellController
|
||||
- (void)commentCell:(id)arg1 didTapLikeButton:(id)arg2 {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
- (void)commentCell:(id)arg1 didTapLikedByButtonForUser:(id)arg2 {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
- (void)commentCellDidLongPressOnLikeButton:(id)arg1 {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
- (void)commentCellDidEndLongPressOnLikeButton:(id)arg1 {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
- (void)commentCellDidDoubleTap:(id)arg1 {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
%end
|
||||
%hook IGFeedItemPreviewCommentCell
|
||||
- (void)_didTapLikeButton {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
%end
|
||||
|
||||
// Liking stories
|
||||
%hook IGStoryFullscreenDefaultFooterView
|
||||
- (void)_handleLikeTapped {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
- (void)_likeTapped {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
- (void)inputView:(id)arg1 didTapLikeButton:(id)arg2 {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
|
||||
// For some stupid reason they removed the "liketapped" methods on newer Instagram versions
|
||||
// Now we have to do a shitty workaround instead :(
|
||||
// Works 99% of the time, but sometimes clicks get through directly to the like button (somehow)
|
||||
- (void)layoutSubviews {
|
||||
%orig;
|
||||
|
||||
if (![SCIUtils getBoolPref:@"like_confirm"]) return;
|
||||
|
||||
UIButton *likeButton = [self valueForKey:@"likeButton"];
|
||||
if (!likeButton) return;
|
||||
|
||||
// 129115 = L(12) I(9) K(11) E(5)
|
||||
static NSInteger kOverlayTag = 129115;
|
||||
if ([likeButton viewWithTag:kOverlayTag]) return;
|
||||
|
||||
UIButton *overlay = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
overlay.tag = kOverlayTag;
|
||||
overlay.frame = likeButton.bounds;
|
||||
overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
||||
[overlay addTarget:self action:@selector(overlayTapped:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[likeButton addSubview:overlay];
|
||||
}
|
||||
|
||||
%new - (void)overlayTapped:(UIButton *)overlay {
|
||||
UIButton *likeButton = (UIButton *)overlay.superview;
|
||||
|
||||
[SCIUtils showConfirmation:^{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[likeButton sendActionsForControlEvents:UIControlEventTouchUpInside];
|
||||
});
|
||||
}];
|
||||
}
|
||||
%end
|
||||
|
||||
// DM like button (seems to be hidden)
|
||||
%hook IGDirectThreadViewController
|
||||
- (void)_didTapLikeButton {
|
||||
CONFIRMPOSTLIKE(%orig);
|
||||
}
|
||||
%end
|
||||
@@ -1,13 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
%hook IGCommentComposer.IGCommentComposerController
|
||||
- (void)onSendButtonTap {
|
||||
if ([SCIUtils getBoolPref:@"post_comment_confirm"]) {
|
||||
NSLog(@"[SCInsta] Confirm post comment triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
@@ -1,33 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
%hook IGDirectThreadViewController
|
||||
- (void)swipeableScrollManagerDidEndDraggingAboveSwipeThreshold:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"shh_mode_confirm"]) {
|
||||
NSLog(@"[SCInsta] Confirm shh mode triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)shhModeTransitionButtonDidTap:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"shh_mode_confirm"]) {
|
||||
NSLog(@"[SCInsta] Confirm shh mode triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)messageListViewControllerDidToggleShhMode:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"shh_mode_confirm"]) {
|
||||
NSLog(@"[SCInsta] Confirm shh mode triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
@@ -1,13 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
%hook IGStoryViewerTapTarget
|
||||
- (void)_didTap:(id)arg1 forEvent:(id)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"sticker_interact_confirm"]) {
|
||||
NSLog(@"[SCInsta] Confirm sticker interact triggered");
|
||||
|
||||
[SCIUtils showConfirmation:^(void) { %orig; }];
|
||||
} else {
|
||||
return %orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
@@ -1,35 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
%hook IGStoryTextEntryControlsOverlayView
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"enable_hidden_texteffectsstyles"]) {
|
||||
|
||||
// Clear previous option values
|
||||
[self.animationTypes removeAllObjects];
|
||||
[self.effectTypes removeAllObjects];
|
||||
|
||||
// Generate new animation values
|
||||
// * Animation effects <= 9 are invalid
|
||||
// * Animations past the maximum count (changing each app update) will crash the app when selected
|
||||
for (int i = 10; i <= 76; i++) {
|
||||
[self.animationTypes addObject:@(i)];
|
||||
}
|
||||
|
||||
// Generate new effect values
|
||||
// * Effects past the maximum count (changing each app update) will gracefully just do nothing
|
||||
for (int i = 0; i <= 84; i++) {
|
||||
[self.effectTypes addObject:@(i)];
|
||||
}
|
||||
|
||||
// Refresh option picker
|
||||
if ([self respondsToSelector:@selector(reloadData)]) {
|
||||
NSLog(@"[SCInsta] Enable all text effects: Reloading data...");
|
||||
[self reloadData];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
%end
|
||||
@@ -1,26 +0,0 @@
|
||||
%hook IGSundialFeedViewController
|
||||
- (_Bool)_isHomecomingEnabled {
|
||||
return true;
|
||||
}
|
||||
- (_Bool)_isHomeComingHomeFeed {
|
||||
return true;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook IGSundialViewerManagedRequestItem
|
||||
- (id)initWithMedia:(id)media launcherSet:(id)set isHomecomingEnabled:(_Bool)enabled {
|
||||
return %orig(media, set, true);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook IGTabBarViewControllerManager
|
||||
- (_Bool)_isHomecomingEnabled {
|
||||
return true;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook IGMainAppSurfaceIntent
|
||||
+ (id)resolvedHomeAppSurfaceIntentWithIsHomecomingEnabled:(_Bool)enabled {
|
||||
return %orig(true);
|
||||
}
|
||||
%end
|
||||
@@ -1,32 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import <objc/runtime.h>
|
||||
#import <substrate.h>
|
||||
|
||||
// IGFeedPlayback.IGFeedPlaybackStrategy gained new init parameters in IG 423+.
|
||||
// Both the 2-arg and 3-arg variants are hooked to force shouldDisableAutoplay=YES.
|
||||
// Hooked via MSHookMessageEx in %ctor since the class has a Swift-mangled name.
|
||||
|
||||
static id (*orig_initStrategy2)(id, SEL, BOOL, BOOL);
|
||||
static id new_initStrategy2(id self, SEL _cmd, BOOL shouldDisable, BOOL shouldClearStale) {
|
||||
if ([SCIUtils getBoolPref:@"disable_feed_autoplay"]) shouldDisable = YES;
|
||||
return orig_initStrategy2(self, _cmd, shouldDisable, shouldClearStale);
|
||||
}
|
||||
|
||||
static id (*orig_initStrategy3)(id, SEL, BOOL, BOOL, BOOL);
|
||||
static id new_initStrategy3(id self, SEL _cmd, BOOL shouldDisable, BOOL shouldClearStale, BOOL bypassForVoiceover) {
|
||||
if ([SCIUtils getBoolPref:@"disable_feed_autoplay"]) shouldDisable = YES;
|
||||
return orig_initStrategy3(self, _cmd, shouldDisable, shouldClearStale, bypassForVoiceover);
|
||||
}
|
||||
|
||||
%ctor {
|
||||
Class cls = objc_getClass("IGFeedPlayback.IGFeedPlaybackStrategy");
|
||||
if (!cls) return;
|
||||
|
||||
SEL sel2 = @selector(initWithShouldDisableAutoplay:shouldClearStaleReservation:);
|
||||
if ([cls instancesRespondToSelector:sel2])
|
||||
MSHookMessageEx(cls, sel2, (IMP)new_initStrategy2, (IMP *)&orig_initStrategy2);
|
||||
|
||||
SEL sel3 = @selector(initWithShouldDisableAutoplay:shouldClearStaleReservation:shouldBypassDisabledAutoplayForVoiceover:);
|
||||
if ([cls instancesRespondToSelector:sel3])
|
||||
MSHookMessageEx(cls, sel3, (IMP)new_initStrategy3, (IMP *)&orig_initStrategy3);
|
||||
}
|
||||
@@ -1,334 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
static NSArray *removeItemsInList(NSArray *list, BOOL isFeed) {
|
||||
NSArray *originalObjs = list;
|
||||
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
|
||||
|
||||
for (id obj in originalObjs) {
|
||||
// Remove suggested posts
|
||||
if (isFeed && [SCIUtils getBoolPref:@"no_suggested_post"]) {
|
||||
|
||||
// Posts
|
||||
if (
|
||||
([obj isKindOfClass:%c(IGMedia)] && [((IGMedia *)obj).explorePostInFeed isEqual:@YES])
|
||||
|| ([obj isKindOfClass:%c(IGFeedGroupHeaderViewModel)] && [[obj title] isEqualToString:@"Suggested Posts"])
|
||||
) {
|
||||
NSLog(@"[SCInsta] Removing suggested posts");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Suggested stories (carousel)
|
||||
if ([obj isKindOfClass:%c(IGInFeedStoriesTrayModel)]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested stories carousel");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Remove suggested reels (carousel)
|
||||
if (isFeed && [SCIUtils getBoolPref:@"no_suggested_reels"]) {
|
||||
if ([obj isKindOfClass:%c(IGFeedScrollableClipsModel)]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested reels carousel");
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove suggested for you (accounts)
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_account"]) {
|
||||
|
||||
// Feed
|
||||
if (isFeed && [obj isKindOfClass:%c(IGHScrollAYMFModel)]) {
|
||||
NSLog(@"[SCInsta] Hiding accounts suggested for you (feed)");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Reels
|
||||
if ([obj isKindOfClass:%c(IGSuggestedUserInReelsModel)]) {
|
||||
NSLog(@"[SCInsta] Hiding accounts suggested for you (reels)");
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove suggested threads posts
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_threads"]) {
|
||||
|
||||
// Feed (carousel)
|
||||
if (isFeed) {
|
||||
if ([obj isKindOfClass:%c(IGBloksFeedUnitModel)] || [obj isKindOfClass:objc_getClass("IGThreadsInFeedModels.IGThreadsInFeedModel")]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested threads posts (carousel)");
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Reels
|
||||
if ([obj isKindOfClass:%c(IGSundialNetegoItem)]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested threads posts (reels)");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Remove story tray
|
||||
if (isFeed && [SCIUtils getBoolPref:@"hide_stories_tray"]) {
|
||||
if ([obj isKindOfClass:%c(IGStoryDataController)]) {
|
||||
NSLog(@"[SCInsta] Hiding stories tray");
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Hide entire feed
|
||||
if (isFeed && [SCIUtils getBoolPref:@"hide_entire_feed"]) {
|
||||
if ([obj isKindOfClass:%c(IGPostCreationManager)] || [obj isKindOfClass:%c(IGMedia)] || [obj isKindOfClass:%c(IGEndOfFeedDemarcatorModel)] || [obj isKindOfClass:%c(IGSpinnerLabelViewModel)]) {
|
||||
NSLog(@"[SCInsta] Hiding entire feed");
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove ads
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
if (
|
||||
([obj isKindOfClass:%c(IGFeedItem)] && ([obj isSponsored] || [obj isSponsoredApp]))
|
||||
|| ([obj isKindOfClass:%c(IGDiscoveryGridItem)] && [[obj model] isKindOfClass:%c(IGAdItem)])
|
||||
|| [obj isKindOfClass:%c(IGAdItem)]
|
||||
) {
|
||||
NSLog(@"[SCInsta] Removing ads");
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
[filteredObjs addObject:obj];
|
||||
}
|
||||
|
||||
return [filteredObjs copy];
|
||||
}
|
||||
|
||||
// Suggested posts/reels
|
||||
%hook IGMainFeedListAdapterDataSource
|
||||
- (NSArray *)objectsForListAdapter:(id)arg1 {
|
||||
NSArray *filteredObjs = removeItemsInList(%orig, YES);
|
||||
|
||||
// Remove loading spinner at end of feed (if 5 or less items in feed)
|
||||
NSUInteger arrayLength = [filteredObjs count];
|
||||
|
||||
if (arrayLength <= 5) {
|
||||
filteredObjs = [filteredObjs filteredArrayUsingPredicate:
|
||||
[NSPredicate predicateWithBlock:^BOOL(id obj, NSDictionary *bindings) {
|
||||
return ![obj isKindOfClass:[%c(IGSpinnerLabelViewModel) class]];
|
||||
}]
|
||||
];
|
||||
}
|
||||
|
||||
return filteredObjs;
|
||||
}
|
||||
%end
|
||||
%hook IGSundialFeedDataSource
|
||||
- (NSArray *)objectsForListAdapter:(id)arg1 {
|
||||
NSArray *filteredList = removeItemsInList(%orig, NO);
|
||||
|
||||
if ([SCIUtils getBoolPref:@"prevent_doom_scrolling"]) {
|
||||
double reelCount = [SCIUtils getDoublePref:@"doom_scrolling_reel_count"];
|
||||
return [filteredList subarrayWithRange:NSMakeRange(0, MIN((NSUInteger)reelCount, filteredList.count))];
|
||||
}
|
||||
|
||||
return filteredList;
|
||||
}
|
||||
%end
|
||||
%hook IGContextualFeedViewController
|
||||
- (NSArray *)objectsForListAdapter:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
return removeItemsInList(%orig, NO);
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
%hook IGVideoFeedViewController
|
||||
- (NSArray *)objectsForListAdapter:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
return removeItemsInList(%orig, NO);
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
%hook IGChainingFeedViewController
|
||||
- (NSArray *)objectsForListAdapter:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
return removeItemsInList(%orig, NO);
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
%hook IGStoryAdPool
|
||||
- (id)initWithUserSession:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
NSLog(@"[SCInsta] Removing ads");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
%hook IGStoryAdsManager
|
||||
- (id)initWithUserSession:(id)arg1 storyViewerLoggingContext:(id)arg2 storyFullscreenSectionLoggingContext:(id)arg3 viewController:(id)arg4 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
NSLog(@"[SCInsta] Removing ads");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
%hook IGStoryAdsFetcher
|
||||
- (id)initWithUserSession:(id)arg1 delegate:(id)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
NSLog(@"[SCInsta] Removing ads");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
// IG 148.0
|
||||
%hook IGStoryAdsResponseParser
|
||||
- (id)parsedObjectFromResponse:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
NSLog(@"[SCInsta] Removing ads");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
- (id)initWithReelStore:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
NSLog(@"[SCInsta] Removing ads");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
%hook IGStoryAdsOptInTextView
|
||||
- (id)initWithBrandedContentStyledString:(id)arg1 sponsoredPostLabel:(id)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
NSLog(@"[SCInsta] Removing ads");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
%hook IGSundialAdsResponseParser
|
||||
- (id)parsedObjectFromResponse:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
NSLog(@"[SCInsta] Removing ads");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
- (id)initWithMediaStore:(id)arg1 userStore:(id)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
NSLog(@"[SCInsta] Removing ads");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
// "Sponsored" posts on discover/search page
|
||||
%hook IGExploreListKitDataSource
|
||||
- (NSArray *)objectsForListAdapter:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
return removeItemsInList(%orig, NO);
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
// Demangled name: IGExploreViewControllerSwift.IGExploreListKitDataSource
|
||||
%hook _TtC28IGExploreViewControllerSwift26IGExploreListKitDataSource
|
||||
- (NSArray *)objectsForListAdapter:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
return removeItemsInList(%orig, NO);
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Hide shopping carousel in reel comments
|
||||
// Demangled name: IGCommentThreadCommerceCarouselPill.IGCommentThreadCommerceCarousel
|
||||
%hook _TtC35IGCommentThreadCommerceCarouselPill31IGCommentThreadCommerceCarousel
|
||||
- (id)initWithFrame:(CGRect)frame pillText:(id)text pillStyle:(NSInteger)style {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig(frame, text, style);
|
||||
}
|
||||
%end
|
||||
|
||||
// Hide suggested search/shopping on reels
|
||||
|
||||
// Demangled name: IGShoppableEverythingCommon.IGRapEntrypointResolver
|
||||
%hook _TtC27IGShoppableEverythingCommon23IGRapEntrypointResolver
|
||||
- (id)initWithLauncherSet:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig(arg1);
|
||||
}
|
||||
%end
|
||||
// Demangled name: IGSundialOrganicCTAContainerView.IGSundialOrganicCTAContainerView
|
||||
%hook _TtC32IGSundialOrganicCTAContainerView32IGSundialOrganicCTAContainerView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_ads"]) {
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
|
||||
// Hide "suggested for you" text at end of feed
|
||||
%hook IGEndOfFeedDemarcatorCellTopOfFeed
|
||||
- (void)configureWithViewConfig:(id)arg1 {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_post"]) {
|
||||
NSLog(@"[SCInsta] Hiding end of feed message");
|
||||
|
||||
// Hide suggested for you text
|
||||
UILabel *_titleLabel = MSHookIvar<UILabel *>(self, "_titleLabel");
|
||||
|
||||
if (_titleLabel != nil) {
|
||||
[_titleLabel setText:@""];
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
%end
|
||||
@@ -1,15 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
// Disable story data source
|
||||
%hook IGMainStoryTrayDataSource
|
||||
- (id)initWithUserSession:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"hide_stories_tray"]) {
|
||||
NSLog(@"[SCInsta] Hiding story tray");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
@@ -1,15 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
// Remove suggested threads posts (carousel, under suggested posts in feed)
|
||||
%hook BKBloksViewHelper
|
||||
- (id)initWithObjectSet:(id)arg1 bloksData:(id)arg2 delegate:(id)arg3 {
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_threads"]) {
|
||||
NSLog(@"[SCInsta] Hiding threads posts");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
@@ -1,102 +0,0 @@
|
||||
// Copy comment text + download GIF from comment long-press menu
|
||||
#import "../../Utils.h"
|
||||
#import "../../Downloader/Download.h"
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <substrate.h>
|
||||
|
||||
static SCIDownloadDelegate *sciGifDl = nil;
|
||||
|
||||
static DownloadAction sciGifDownloadAction(void) {
|
||||
NSString *method = [SCIUtils getStringPref:@"dw_save_action"];
|
||||
return [method isEqualToString:@"photos"] ? saveToPhotos : share;
|
||||
}
|
||||
|
||||
static id (*orig_commentCtxMenu)(id, SEL, id, id, CGPoint);
|
||||
static id new_commentCtxMenu(id self, SEL _cmd, id cv, id indexPath, CGPoint point) {
|
||||
UIContextMenuConfiguration *config = orig_commentCtxMenu(self, _cmd, cv, indexPath, point);
|
||||
if (!config) return config;
|
||||
|
||||
Ivar commentIvar = class_getInstanceVariable([self class], "_longPressedComment");
|
||||
id comment = commentIvar ? object_getIvar(self, commentIvar) : nil;
|
||||
if (!comment) return config;
|
||||
|
||||
NSString *text = nil;
|
||||
@try { text = ((id(*)(id,SEL))objc_msgSend)(comment, @selector(text)); } @catch (__unused id e) {}
|
||||
|
||||
NSString *gifId = nil;
|
||||
@try {
|
||||
SEL sel = NSSelectorFromString(@"gifMediaId");
|
||||
if ([comment respondsToSelector:sel])
|
||||
gifId = ((id(*)(id,SEL))objc_msgSend)(comment, sel);
|
||||
} @catch (__unused id e) {}
|
||||
|
||||
NSString *gifURL = nil;
|
||||
if (gifId.length) {
|
||||
Ivar attIvar = class_getInstanceVariable([comment class], "_commentAttachment");
|
||||
id att = attIvar ? object_getIvar(comment, attIvar) : nil;
|
||||
if (att) {
|
||||
Ivar urlIvar = class_getInstanceVariable([att class], "_image_imageURL");
|
||||
if (urlIvar) {
|
||||
id url = object_getIvar(att, urlIvar);
|
||||
if ([url isKindOfClass:[NSString class]]) gifURL = url;
|
||||
else if ([url isKindOfClass:[NSURL class]]) gifURL = [(NSURL *)url absoluteString];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOL hasText = text.length > 0;
|
||||
BOOL hasGif = gifURL.length > 0;
|
||||
if (!hasText && !hasGif) return config;
|
||||
|
||||
id origProvider = [config valueForKey:@"actionProvider"];
|
||||
id<NSCopying> origIdent = [config valueForKey:@"identifier"];
|
||||
UIContextMenuContentPreviewProvider origPreview = [config valueForKey:@"previewProvider"];
|
||||
|
||||
UIContextMenuActionProvider wrapped = ^UIMenu *(NSArray<UIMenuElement *> *suggested) {
|
||||
UIMenu *base = origProvider ? ((UIMenu *(^)(NSArray *))origProvider)(suggested)
|
||||
: [UIMenu menuWithChildren:suggested];
|
||||
NSMutableArray *extra = [NSMutableArray array];
|
||||
|
||||
if (hasText && [SCIUtils getBoolPref:@"copy_comment"]) {
|
||||
[extra addObject:[UIAction actionWithTitle:@"Copy"
|
||||
image:[UIImage systemImageNamed:@"doc.on.doc"]
|
||||
identifier:nil
|
||||
handler:^(__kindof UIAction *_) {
|
||||
[UIPasteboard generalPasteboard].string = text;
|
||||
}]];
|
||||
}
|
||||
|
||||
if (hasGif && [SCIUtils getBoolPref:@"download_gif_comment"]) {
|
||||
[extra addObject:[UIAction actionWithTitle:@"Download GIF"
|
||||
image:[UIImage systemImageNamed:@"arrow.down.circle"]
|
||||
identifier:nil
|
||||
handler:^(__kindof UIAction *_) {
|
||||
NSURL *url = [NSURL URLWithString:gifURL];
|
||||
if (!url) return;
|
||||
sciGifDl = [[SCIDownloadDelegate alloc] initWithAction:sciGifDownloadAction() showProgress:YES];
|
||||
[sciGifDl downloadFileWithURL:url fileExtension:@"gif" hudLabel:nil];
|
||||
}]];
|
||||
}
|
||||
|
||||
if (!extra.count) return base;
|
||||
NSMutableArray *kids = [base.children mutableCopy] ?: [NSMutableArray array];
|
||||
NSUInteger insertIdx = kids.count > 0 ? kids.count - 1 : 0;
|
||||
UIMenu *ourMenu = [UIMenu menuWithTitle:@"" image:nil identifier:nil
|
||||
options:UIMenuOptionsDisplayInline children:extra];
|
||||
[kids insertObject:ourMenu atIndex:insertIdx];
|
||||
return [base menuByReplacingChildren:kids];
|
||||
};
|
||||
|
||||
return [UIContextMenuConfiguration configurationWithIdentifier:origIdent
|
||||
previewProvider:origPreview
|
||||
actionProvider:wrapped];
|
||||
}
|
||||
|
||||
__attribute__((constructor)) static void _commentActionsInit(void) {
|
||||
Class cls = NSClassFromString(@"IGCommentThreadViewController");
|
||||
if (!cls) return;
|
||||
SEL s = @selector(collectionView:contextMenuConfigurationForItemAtIndexPath:point:);
|
||||
if (class_getInstanceMethod(cls, s))
|
||||
MSHookMessageEx(cls, s, (IMP)new_commentCtxMenu, (IMP *)&orig_commentCtxMenu);
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
#import "../../../modules/JGProgressHUD/JGProgressHUD.h"
|
||||
|
||||
%hook IGCoreTextView
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"copy_description"]) {
|
||||
[self addHandleLongPress];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
%new - (void)addHandleLongPress {
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = 0.5;
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
// Remove hashtags at end of string
|
||||
NSRegularExpression *regex =
|
||||
[NSRegularExpression regularExpressionWithPattern:@"\\s*(?:#[^\\s]+\\s*)+$"
|
||||
options:0
|
||||
error:nil];
|
||||
|
||||
NSString *result = [[regex stringByReplacingMatchesInString:self.text
|
||||
options:0
|
||||
range:NSMakeRange(0, self.text.length)
|
||||
withTemplate:@""]
|
||||
stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
|
||||
NSLog(@"[SCInsta] Copying description");
|
||||
|
||||
// Copy text to system clipboard
|
||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||
pasteboard.string = result;
|
||||
|
||||
// Notify user
|
||||
JGProgressHUD *HUD = [[JGProgressHUD alloc] init];
|
||||
HUD.textLabel.text = @"Copied text to clipboard";
|
||||
HUD.indicatorView = [[JGProgressHUDSuccessIndicatorView alloc] init];
|
||||
|
||||
[HUD showInView:topMostController().view];
|
||||
[HUD dismissAfterDelay:2.0];
|
||||
}
|
||||
%end
|
||||
@@ -1,87 +0,0 @@
|
||||
#import "../../InstagramHeaders.h"
|
||||
#import "../../Utils.h"
|
||||
|
||||
%hook IGStoryEyedropperToggleButton
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"detailed_color_picker"]) {
|
||||
[self addLongPressGestureRecognizer];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
%new - (void)addLongPressGestureRecognizer {
|
||||
if ([self.gestureRecognizers count] == 0) {
|
||||
NSLog(@"[SCInsta] Adding color eyedroppper long press gesture recognizer");
|
||||
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = 0.25;
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
}
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
UIColorPickerViewController *colorPickerController = [[UIColorPickerViewController alloc] init];
|
||||
|
||||
colorPickerController.delegate = (id<UIColorPickerViewControllerDelegate>)self; // cast to suppress warnings
|
||||
colorPickerController.title = @"Select color";
|
||||
colorPickerController.modalPresentationStyle = UIModalPresentationPopover;
|
||||
colorPickerController.supportsAlpha = NO;
|
||||
colorPickerController.selectedColor = self.color;
|
||||
|
||||
UIViewController *presentingVC = [SCIUtils nearestViewControllerForView:self];
|
||||
|
||||
if (presentingVC != nil) {
|
||||
[presentingVC presentViewController:colorPickerController animated:YES completion:nil];
|
||||
}
|
||||
}
|
||||
|
||||
// UIColorPickerViewControllerDelegate Protocol
|
||||
%new - (void)colorPickerViewController:(UIColorPickerViewController *)viewController
|
||||
didSelectColor:(UIColor *)color
|
||||
continuously:(BOOL)continuously
|
||||
{
|
||||
NSLog(@"[SCInsta] Selected text color: %@", color);
|
||||
|
||||
UIColor *opaque = [color colorWithAlphaComponent:1.0];
|
||||
self.color = opaque;
|
||||
|
||||
[self setPushedDown:YES];
|
||||
|
||||
// Trigger change for text color
|
||||
id presentingVC = [SCIUtils nearestViewControllerForView:self];
|
||||
|
||||
if ([presentingVC isKindOfClass:%c(IGStoryTextEntryViewController)]) {
|
||||
[presentingVC textViewControllerDidUpdateWithColor:color colorSource:0];
|
||||
}
|
||||
else if (
|
||||
[presentingVC isKindOfClass:%c(IGStoryCreationDrawingViewController)]
|
||||
|| [presentingVC isKindOfClass:%c(IGDirectThreadViewDrawingViewController)]
|
||||
) {
|
||||
[presentingVC drawingControls:nil didSelectColor:color];
|
||||
}
|
||||
|
||||
};
|
||||
%end
|
||||
|
||||
%hook IGStoryColorPaletteView
|
||||
- (CGFloat)collectionView:(id)view didSelectItemAtIndexPath:(id)index {
|
||||
UIView *colorPickingControls = [self superview];
|
||||
|
||||
if (
|
||||
[colorPickingControls isKindOfClass:%c(IGStoryColorPickingControls)]
|
||||
|| [colorPickingControls isKindOfClass:%c(IGDirectThreadColorPickingControls)]
|
||||
) {
|
||||
IGStoryEyedropperToggleButton *_eyedropperToggleButton = MSHookIvar<IGStoryEyedropperToggleButton *>(colorPickingControls, "_eyedropperToggleButton");
|
||||
|
||||
if (_eyedropperToggleButton != nil) {
|
||||
[_eyedropperToggleButton setPushedDown:NO];
|
||||
}
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
@@ -1,36 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
%hook IGUnifiedVideoCollectionView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"disable_scrolling_reels"]) {
|
||||
NSLog(@"[SCInsta] Disabling scrolling reels");
|
||||
|
||||
self.scrollEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setScrollEnabled:(BOOL)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"disable_scrolling_reels"]) {
|
||||
NSLog(@"[SCInsta] Disabling scrolling reels");
|
||||
|
||||
return %orig(NO);
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Disable auto-scrolling reels
|
||||
%hook _TtC19IGSundialAutoScroll19IGSundialAutoScroll
|
||||
- (void)setIsEnabled:(BOOL)enabled {
|
||||
if ([SCIUtils getBoolPref:@"disable_scrolling_reels"]) {
|
||||
%orig(NO);
|
||||
}
|
||||
else {
|
||||
%orig(enabled);
|
||||
}
|
||||
}
|
||||
%end
|
||||
@@ -1,99 +0,0 @@
|
||||
// Rewrite Instagram share links — replace domain + optionally strip tracking params.
|
||||
// Waits for IG's async clipboard write via changeCount, then rewrites once.
|
||||
|
||||
#import "../../Utils.h"
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <substrate.h>
|
||||
|
||||
static NSString *sciRewriteIGURL(NSString *url) {
|
||||
if (!url.length) return url;
|
||||
|
||||
// Domain replacement
|
||||
if ([SCIUtils getBoolPref:@"embed_links"]) {
|
||||
NSString *domain = [SCIUtils getStringPref:@"embed_link_domain"];
|
||||
if (!domain.length) domain = @"kkinstagram.com";
|
||||
if (![url containsString:domain]) {
|
||||
NSArray *igDomains = @[@"www.instagram.com", @"instagram.com", @"www.instagr.am", @"instagr.am"];
|
||||
for (NSString *d in igDomains) {
|
||||
NSRange r = [url rangeOfString:d];
|
||||
if (r.location != NSNotFound) {
|
||||
NSString *target = [d hasPrefix:@"www."]
|
||||
? [NSString stringWithFormat:@"www.%@", domain] : domain;
|
||||
url = [url stringByReplacingCharactersInRange:r withString:target];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Strip tracking params
|
||||
if ([SCIUtils getBoolPref:@"strip_tracking_params"]) {
|
||||
NSURLComponents *comps = [NSURLComponents componentsWithString:url];
|
||||
if (comps.queryItems.count) {
|
||||
NSArray *strip = @[@"igsh", @"ig_rid", @"utm_source", @"utm_medium", @"utm_campaign"];
|
||||
NSMutableArray *clean = [NSMutableArray array];
|
||||
for (NSURLQueryItem *q in comps.queryItems) {
|
||||
if (![strip containsObject:q.name]) [clean addObject:q];
|
||||
}
|
||||
comps.queryItems = clean.count ? clean : nil;
|
||||
NSString *result = comps.string;
|
||||
if (result) url = result;
|
||||
}
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
static BOOL sciShouldRewrite(void) {
|
||||
return [SCIUtils getBoolPref:@"embed_links"] || [SCIUtils getBoolPref:@"strip_tracking_params"];
|
||||
}
|
||||
|
||||
// Rewrite clipboard once after IG writes
|
||||
static void sciPollAndRewrite(NSInteger countBefore, int polls, double interval) {
|
||||
__block BOOL done = NO;
|
||||
for (int i = 0; i < polls; i++) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((interval + i * interval) * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
if (done) return;
|
||||
if ([UIPasteboard generalPasteboard].changeCount == countBefore) return;
|
||||
NSString *clip = [UIPasteboard generalPasteboard].string;
|
||||
if (!clip || ![clip containsString:@"instagram"]) return;
|
||||
NSString *rewritten = sciRewriteIGURL(clip);
|
||||
if (![rewritten isEqualToString:clip]) {
|
||||
[UIPasteboard generalPasteboard].string = rewritten;
|
||||
done = YES;
|
||||
} else {
|
||||
done = YES;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// ============ Hooks ============
|
||||
|
||||
static void (*orig_copyLink)(id, SEL, id);
|
||||
static void new_copyLink(id self, SEL _cmd, id vc) {
|
||||
if (!sciShouldRewrite()) { orig_copyLink(self, _cmd, vc); return; }
|
||||
NSInteger countBefore = [UIPasteboard generalPasteboard].changeCount;
|
||||
orig_copyLink(self, _cmd, vc);
|
||||
sciPollAndRewrite(countBefore, 30, 0.05);
|
||||
}
|
||||
|
||||
static void (*orig_shareMore)(id, SEL, id);
|
||||
static void new_shareMore(id self, SEL _cmd, id vc) {
|
||||
if (!sciShouldRewrite()) { orig_shareMore(self, _cmd, vc); return; }
|
||||
NSInteger countBefore = [UIPasteboard generalPasteboard].changeCount;
|
||||
orig_shareMore(self, _cmd, vc);
|
||||
sciPollAndRewrite(countBefore, 120, 0.1);
|
||||
}
|
||||
|
||||
__attribute__((constructor)) static void _embedLinksInit(void) {
|
||||
Class cls = NSClassFromString(@"IGExternalShareOptionsViewController");
|
||||
if (!cls) return;
|
||||
SEL copy = NSSelectorFromString(@"_shareToClipboardFromVC:");
|
||||
if (class_getInstanceMethod(cls, copy))
|
||||
MSHookMessageEx(cls, copy, (IMP)new_copyLink, (IMP *)&orig_copyLink);
|
||||
SEL more = NSSelectorFromString(@"_shareToMoreFromVC:");
|
||||
if (class_getInstanceMethod(cls, more))
|
||||
MSHookMessageEx(cls, more, (IMP)new_shareMore, (IMP *)&orig_shareMore);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
%hook IGExploreGridViewController
|
||||
- (void)viewDidLoad {
|
||||
if ([SCIUtils getBoolPref:@"hide_explore_grid"]) {
|
||||
NSLog(@"[SCInsta] Hiding explore grid");
|
||||
|
||||
[[self view] removeFromSuperview];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook IGExploreViewController
|
||||
- (void)viewDidLoad {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_explore_grid"]) {
|
||||
NSLog(@"[SCInsta] Hiding explore grid");
|
||||
|
||||
IGShimmeringGridView *shimmeringGridView = MSHookIvar<IGShimmeringGridView *>(self, "_shimmeringGridView");
|
||||
if (shimmeringGridView != nil) {
|
||||
[shimmeringGridView removeFromSuperview];
|
||||
}
|
||||
}
|
||||
}
|
||||
%end
|
||||
@@ -1,33 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
%hook IGDirectNotesTrayRowCell
|
||||
- (id)listAdapterObjects {
|
||||
NSArray *originalObjs = %orig();
|
||||
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
|
||||
|
||||
for (id obj in originalObjs) {
|
||||
BOOL shouldHide = NO;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_friends_map"]) {
|
||||
|
||||
if ([obj isKindOfClass:%c(IGDirectNotesTrayUserViewModel)]) {
|
||||
|
||||
if ([[obj valueForKey:@"notePk"] isEqualToString:@"friends_map"]) {
|
||||
NSLog(@"[SCInsta] Hiding friends map");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Populate new objs array
|
||||
if (!shouldHide) {
|
||||
[filteredObjs addObject:obj];
|
||||
}
|
||||
}
|
||||
|
||||
return [filteredObjs copy];
|
||||
}
|
||||
%end
|
||||
@@ -1,572 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
// Direct
|
||||
|
||||
// Meta AI button functionality on direct search bar
|
||||
%hook IGDirectInboxViewController
|
||||
- (void)searchBarMetaAIButtonTappedOnSearchBar:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"])
|
||||
{
|
||||
NSLog(@"[SCInsta] Hiding meta ai: direct search bar functionality");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// AI agents in direct new message view
|
||||
%hook IGDirectRecipientGenAIBotsResult
|
||||
- (id)initWithGenAIBots:(id)arg1 lastFetchedTimestamp:(id)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"])
|
||||
{
|
||||
NSLog(@"[SCInsta] Hiding meta ai: direct recipient ai agents");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Meta AI in message composer
|
||||
%hook IGDirectCommandSystemListViewController
|
||||
- (id)objectsForListAdapter:(id)arg1 {
|
||||
NSArray *originalObjs = %orig();
|
||||
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
|
||||
|
||||
for (id obj in originalObjs) {
|
||||
BOOL shouldHide = NO;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
|
||||
if ([obj isKindOfClass:%c(IGDirectCommandSystemViewModel)]) {
|
||||
IGDirectCommandSystemViewModel *typedObj = (IGDirectCommandSystemViewModel *)obj;
|
||||
IGDirectCommandSystemRow *cmdSystemRow = (IGDirectCommandSystemRow *)[typedObj row];
|
||||
|
||||
IGDirectCommandSystemResult *_commandResult_command = MSHookIvar<IGDirectCommandSystemResult *>(cmdSystemRow, "_commandResult_command");
|
||||
|
||||
if (_commandResult_command != nil) {
|
||||
|
||||
// Meta AI
|
||||
if ([[_commandResult_command title] isEqualToString:@"Meta AI"]) {
|
||||
NSLog(@"[SCInsta] Hiding meta ai: direct message composer suggestion");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
|
||||
// Meta AI (Imagine)
|
||||
else if ([[_commandResult_command commandString] hasPrefix:@"/imagine"]) {
|
||||
NSLog(@"[SCInsta] Hiding meta ai: direct message composer /imagine suggestion");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Populate new objs array
|
||||
if (!shouldHide) {
|
||||
[filteredObjs addObject:obj];
|
||||
}
|
||||
}
|
||||
|
||||
return [filteredObjs copy];
|
||||
}
|
||||
%end
|
||||
|
||||
// Suggested AI chats in direct inbox header
|
||||
%hook IGDirectInboxNavigationHeaderView
|
||||
- (id)initWithFrame:(CGRect)arg1
|
||||
title:(id)arg2
|
||||
titleView:(id)arg3
|
||||
directInboxConfig:(IGDirectInboxConfig *)config
|
||||
userSession:(id)arg5
|
||||
loggingDelegate:(id)arg6
|
||||
{
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
NSLog(@"[SCInsta] Hiding meta ai: suggested ai chats in direct inbox header");
|
||||
|
||||
@try {
|
||||
[config setValue:0 forKey:@"shouldShowAIChatsEntrypointButton"];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
NSLog(@"[SCInsta] WARNING: %@\n\nFull object: %@", exception.reason, config);
|
||||
}
|
||||
}
|
||||
|
||||
return %orig(arg1, arg2, arg3, [config copy], arg5, arg6);
|
||||
}
|
||||
%end
|
||||
|
||||
// Meta AI "imagine" in media picker
|
||||
%hook IGDirectMediaPickerViewController
|
||||
- (id)initWithUserSession:(id)arg1
|
||||
config:(IGDirectMediaPickerConfig *)config
|
||||
capabilities:(id)arg3
|
||||
threadMetadata:(id)arg4
|
||||
messageSender:(id)arg5
|
||||
threadAnalyticsLogger:(id)arg6
|
||||
multimodalPerfLogger:(id)arg7
|
||||
localSendSpeedLogger:(id)arg8
|
||||
sendAttributionFactory:(id)arg9
|
||||
{
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
NSLog(@"[SCInsta] Hiding meta ai: imagine tile in media picker");
|
||||
|
||||
@try {
|
||||
IGDirectMediaPickerGalleryConfig *galleryConfig = [config valueForKey:@"galleryConfig"];
|
||||
|
||||
[galleryConfig setValue:0 forKey:@"isImagineEntryPointEnabled"];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
NSLog(@"[SCInsta] WARNING: %@\n\nFull object: %@", exception.reason, config);
|
||||
}
|
||||
}
|
||||
|
||||
return %orig(arg1, [config copy], arg3, arg4, arg5, arg6, arg7, arg8, arg9);
|
||||
}
|
||||
%end
|
||||
|
||||
// Write with meta ai in message composer
|
||||
%hook IGDirectComposer
|
||||
- (id)initWithLayoutSpecProvider:(id)arg1
|
||||
userLauncherSetProviding:(id)arg2
|
||||
config:(IGDirectComposerConfig *)config
|
||||
style:(id)arg4
|
||||
text:(id)arg5
|
||||
{
|
||||
return %orig(arg1, arg2, [self patchConfig:config], arg4, arg5);
|
||||
}
|
||||
|
||||
- (id)initWithLayoutSpecProvider:(id)arg1
|
||||
userLauncherSetProviding:(id)arg2
|
||||
config:(IGDirectComposerConfig *)config
|
||||
style:(id)arg4
|
||||
text:(id)arg5
|
||||
shouldUpdateModeLater:(BOOL)arg6
|
||||
{
|
||||
return %orig(arg1, arg2, [self patchConfig:config], arg4, arg5, arg6);
|
||||
}
|
||||
|
||||
- (void)setConfig:(IGDirectComposerConfig *)config {
|
||||
%orig([self patchConfig:config]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
%new - (IGDirectComposerConfig *)patchConfig:(IGDirectComposerConfig *)config {
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
|
||||
NSLog(@"[SCInsta] Hiding meta ai: reconfiguring direct composer");
|
||||
|
||||
// writeWithAIEnabled
|
||||
@try {
|
||||
[config setValue:0 forKey:@"writeWithAIEnabled"];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
NSLog(@"[SCInsta] WARNING: %@\n\nFull object: %@", exception.reason, config);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return [config copy];
|
||||
}
|
||||
%end
|
||||
|
||||
// Direct sticker tray picker view
|
||||
%hook IGStickerTrayListAdapterDataSource
|
||||
- (id)objectsForListAdapter:(id)arg1 {
|
||||
NSArray *originalObjs = %orig();
|
||||
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
|
||||
|
||||
for (id obj in originalObjs) {
|
||||
BOOL shouldHide = NO;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
|
||||
if ([obj isKindOfClass:%c(IGDirectUnifiedComposerAIStickerModel)]) {
|
||||
NSLog(@"[SCInsta] Hiding meta ai: AI stickers option in sticker view");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Populate new objs array
|
||||
if (!shouldHide) {
|
||||
[filteredObjs addObject:obj];
|
||||
}
|
||||
}
|
||||
|
||||
return [filteredObjs copy];
|
||||
}
|
||||
%end
|
||||
|
||||
// Long press menu on messages
|
||||
// Demangled name: IGDirectMessageMenuConfiguration.IGDirectMessageMenuConfiguration
|
||||
%hook _TtC32IGDirectMessageMenuConfiguration32IGDirectMessageMenuConfiguration
|
||||
+ (id)menuConfigurationWithEligibleOptions:(id)options
|
||||
messageViewModel:(id)arg2
|
||||
contentType:(id)arg3
|
||||
isSticker:(_Bool)arg4
|
||||
isMusicSticker:(_Bool)arg5
|
||||
directNuxManager:(id)arg6
|
||||
sessionUserDefaults:(id)arg7
|
||||
launcherSet:(id)arg8
|
||||
userSession:(id)arg9
|
||||
tapHandler:(id)arg10
|
||||
{
|
||||
// 31: Restyle
|
||||
// 41: Make AI image
|
||||
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT (SELF IN %@)", @[ @(31), @(41) ]];
|
||||
NSArray *newOptions = [options filteredArrayUsingPredicate:predicate];
|
||||
|
||||
return %orig([newOptions copy], arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
|
||||
}
|
||||
%end
|
||||
|
||||
// Expanded in-chat photo UI
|
||||
// Demangled name: IGDirectAggregatedMediaViewerComponentsSwift.IGDirectAggregatedMediaViewerViewControllerTitleViewModelObject
|
||||
%hook _TtC44IGDirectAggregatedMediaViewerComponentsSwift63IGDirectAggregatedMediaViewerViewControllerTitleViewModelObject
|
||||
- (id)initWithAuthorProfileImage:(id)arg1
|
||||
authorUsername:(id)arg2
|
||||
canForward:(_Bool)arg3
|
||||
canSave:(_Bool)arg4
|
||||
canAddToStory:(_Bool)arg5
|
||||
canShowAIRestyle:(_Bool)arg6
|
||||
canUnsend:(_Bool)arg7
|
||||
canReport:(_Bool)arg8
|
||||
displayConfig:(id)arg9
|
||||
isPending:(_Bool)arg10
|
||||
isMoreMenuListStyle:(_Bool)arg11
|
||||
senderIsCurrentUser:(_Bool)arg12
|
||||
shouldHideInfoViews:(_Bool)arg13
|
||||
subtitle:(id)arg14
|
||||
entryPoint:(long long)arg15
|
||||
canTapAuthor:(_Bool)arg16
|
||||
{
|
||||
BOOL showAiRestyle = [SCIUtils getBoolPref:@"hide_meta_ai"] ? false : arg6;
|
||||
|
||||
return %orig(arg1, arg2, arg3, arg4, arg5, showAiRestyle, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16);
|
||||
}
|
||||
%end
|
||||
|
||||
// AI generated DM channel themes
|
||||
%hook IGDirectThreadThemePickerViewController
|
||||
- (id)objectsForListAdapter:(id)arg1 {
|
||||
NSArray *originalObjs = %orig();
|
||||
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
|
||||
|
||||
for (id obj in originalObjs) {
|
||||
BOOL shouldHide = NO;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
|
||||
if (
|
||||
[obj isKindOfClass:%c(IGDirectThreadThemePickerOption)]
|
||||
&& [[obj valueForKey:@"themeId"] isEqualToString:@"direct_ai_theme_creation"]
|
||||
) {
|
||||
NSLog(@"[SCInsta] Hiding meta ai: AI generated DM channel themes");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Populate new objs array
|
||||
if (!shouldHide) {
|
||||
[filteredObjs addObject:obj];
|
||||
}
|
||||
}
|
||||
|
||||
return [filteredObjs copy];
|
||||
}
|
||||
%end
|
||||
|
||||
// "Click to summarize" pill under DM navigation bar
|
||||
%hook IGDirectThreadViewMetaAISummaryFeatureController
|
||||
- (id)initWithUserSession:(id)arg1 mutableStateProvider:(id)arg2 threadViewControllerFeatureDelegate:(id)arg3 presentingViewController:(id)arg4 {
|
||||
return nil;
|
||||
}
|
||||
%end
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Explore
|
||||
|
||||
// Meta AI explore search summary
|
||||
%hook IGDiscoveryListKitGQLDataSource
|
||||
- (id)objectsForListAdapter:(id)arg1 {
|
||||
NSArray *originalObjs = %orig();
|
||||
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
|
||||
|
||||
for (id obj in originalObjs) {
|
||||
BOOL shouldHide = NO;
|
||||
|
||||
// Meta AI summary
|
||||
if ([obj isKindOfClass:%c(IGSearchMetaAIHCMModel)]) {
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
NSLog(@"[SCInsta] Hiding explore meta ai search summary");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Populate new objs array
|
||||
if (!shouldHide) {
|
||||
[filteredObjs addObject:obj];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return [filteredObjs copy];
|
||||
}
|
||||
%end
|
||||
|
||||
// Meta AI search bar ring button
|
||||
%hook IGSearchBarDonutButton
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Reels/Sundial
|
||||
|
||||
// Suggested AI searches in comment section
|
||||
%hook IGCommentThreadAICarousel
|
||||
- (id)initWithLauncherSet:(id)arg1 hasSearchPrefix:(BOOL)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
NSLog(@"[SCInsta] Hiding meta ai: suggested ai searches comment carousel");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook _TtC34IGCommentThreadAICarouselPillSwift30IGCommentThreadAICarouselSwift
|
||||
- (id)initWithLauncherSet:(id)arg1 hasSearchPrefix:(BOOL)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
NSLog(@"[SCInsta] Hiding meta ai: suggested ai searches comment carousel");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Story
|
||||
|
||||
// AI images "add to story" suggestion
|
||||
// Demangled name: IGGalleryDestinationToolbar.IGGalleryDestinationToolbarView
|
||||
%hook _TtC27IGGalleryDestinationToolbar31IGGalleryDestinationToolbarView
|
||||
- (void)setTools:(id)tools {
|
||||
NSArray *newTools = [tools copy];
|
||||
|
||||
NSLog(@"[SCInsta] Hiding meta ai: ai images add to story suggestion");
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT (SELF IN %@)", @[ @(10), @(11) ]];
|
||||
newTools = [tools filteredArrayUsingPredicate:predicate];
|
||||
}
|
||||
|
||||
%orig(newTools);
|
||||
|
||||
return;
|
||||
}
|
||||
%end
|
||||
|
||||
// AI generated fonts in text entry
|
||||
%hook IGCreationTextToolView
|
||||
- (id)initWithMenuConfiguration:(unsigned long long)configuration userSession:(id)session creationEntryPoint:(long long)point isAIFontsEnabled:(_Bool)enabled genAINuxManager:(id)manager showFontBadge:(_Bool)badge {
|
||||
return %orig(configuration, session, point, [SCIUtils getBoolPref:@"hide_meta_ai"] ? false : enabled, manager, badge);
|
||||
}
|
||||
%end
|
||||
|
||||
// Text rewrite in text entry
|
||||
%hook IGStoryTextMentionLocationPickerView
|
||||
- (id)initWithIsTextRewriteEnabled:(_Bool)arg1
|
||||
isImageRewriteEnabled:(_Bool)arg2
|
||||
isStackedToolSelectorEnabled:(_Bool)arg3
|
||||
isMentionLocationVisible:(_Bool)arg4
|
||||
isEnabledForFeedCaption:(_Bool)arg5
|
||||
isFeedEntryPoint:(_Bool)arg6
|
||||
{
|
||||
_Bool isTextRewriteEnabled = [SCIUtils getBoolPref:@"hide_meta_ai"] ? false : arg1;
|
||||
_Bool isImageRewriteEnabled = [SCIUtils getBoolPref:@"hide_meta_ai"] ? false : arg2;
|
||||
|
||||
return %orig(isTextRewriteEnabled, isImageRewriteEnabled, arg3, arg4, arg5, arg6);
|
||||
}
|
||||
%end
|
||||
|
||||
// "Imagine background" in story editor vertical action bar
|
||||
%hook _TtC17IGCreationOSSwift19IGCreationHeaderBar
|
||||
- (void)setButtons:(id)buttons maxItems:(NSInteger)max {
|
||||
NSArray *filteredObjs = buttons;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
filteredObjs = [filteredObjs filteredArrayUsingPredicate:
|
||||
[NSPredicate predicateWithBlock:^BOOL(IGCreationActionBarLabeledButton *obj, NSDictionary *bindings) {
|
||||
|
||||
return !(
|
||||
obj.button
|
||||
&& [((IGCreationActionBarButton *)obj.button).accessibilityIdentifier isEqualToString:@"contextual-background"]
|
||||
);
|
||||
|
||||
}]
|
||||
];
|
||||
}
|
||||
|
||||
%orig(filteredObjs, max);
|
||||
}
|
||||
%end
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Other
|
||||
|
||||
// Meta AI-branded search bars
|
||||
%hook IGSearchBar
|
||||
- (id)initWithConfig:(IGSearchBarConfig *)config {
|
||||
return %orig([self sanitizePlaceholderForConfig:config]);
|
||||
}
|
||||
|
||||
- (id)initWithConfig:(IGSearchBarConfig *)config userSession:(id)arg2 {
|
||||
return %orig([self sanitizePlaceholderForConfig:config], arg2);
|
||||
}
|
||||
|
||||
- (void)setConfig:(IGSearchBarConfig *)config {
|
||||
%orig([self sanitizePlaceholderForConfig:config]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
%new - (IGSearchBarConfig *)sanitizePlaceholderForConfig:(IGSearchBarConfig *)config {
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
|
||||
NSLog(@"[SCInsta] Hiding meta ai: reconfiguring search bar");
|
||||
|
||||
NSString *placeholder = [config valueForKey:@"placeholder"];
|
||||
|
||||
if ([placeholder containsString:@"Meta AI"]) {
|
||||
|
||||
// placeholder
|
||||
@try {
|
||||
[config setValue:@"Search" forKey:@"placeholder"];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
NSLog(@"[SCInsta] WARNING: %@\n\nFull object: %@", exception.reason, config);
|
||||
}
|
||||
|
||||
// shouldAnimatePlaceholder
|
||||
@try {
|
||||
[config setValue:0 forKey:@"shouldAnimatePlaceholder"];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
NSLog(@"[SCInsta] WARNING: %@\n\nFull object: %@", exception.reason, config);
|
||||
}
|
||||
|
||||
NSLog(@"[SCInsta] Changed search bar placeholder from: \"%@\" to \"%@\"", placeholder, [config valueForKey:@"placeholder"]);
|
||||
|
||||
// leftIconStyle
|
||||
@try {
|
||||
[config setValue:0 forKey:@"leftIconStyle"];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
NSLog(@"[SCInsta] WARNING: %@\n\nFull object: %@", exception.reason, config);
|
||||
}
|
||||
|
||||
// rightButtonStyle
|
||||
@try {
|
||||
[config setValue:0 forKey:@"rightButtonStyle"];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
NSLog(@"[SCInsta] WARNING: %@\n\nFull object: %@", exception.reason, config);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return [config copy];
|
||||
}
|
||||
%end
|
||||
|
||||
// Themed in-app buttons
|
||||
%hook IGTapButton
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
|
||||
// Hide buttons that are associated with meta ai
|
||||
if ([self.accessibilityIdentifier containsString:@"meta_ai"]) {
|
||||
NSLog(@"[SCInsta] Hiding meta ai: meta ai associated button");
|
||||
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Home feed meta ai button
|
||||
%hook IGFloatingActionButton.IGFloatingActionButton
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
[self removeFromSuperview];
|
||||
NSLog(@"[SCInsta] Hiding meta ai: home feed meta ai button");
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Share menu recipients
|
||||
%hook IGDirectRecipientListViewController
|
||||
- (id)objectsForListAdapter:(id)arg1 {
|
||||
NSArray *originalObjs = %orig();
|
||||
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
|
||||
|
||||
for (id obj in originalObjs) {
|
||||
BOOL shouldHide = NO;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
|
||||
if ([obj isKindOfClass:%c(IGDirectRecipientCellViewModel)]) {
|
||||
|
||||
// Meta AI (catch-all)
|
||||
if ([[[obj recipient] threadName] isEqualToString:@"Meta AI"]) {
|
||||
NSLog(@"[SCInsta] Hiding meta ai suggested as recipient (share menu)");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Populate new objs array
|
||||
if (!shouldHide) {
|
||||
[filteredObjs addObject:obj];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return [filteredObjs copy];
|
||||
}
|
||||
%end
|
||||
@@ -1,16 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
%hook IGDSSegmentedPillBarView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
|
||||
if ([[self delegate] isKindOfClass:%c(IGSearchTypeaheadNavigationHeaderView)]) {
|
||||
if ([SCIUtils getBoolPref:@"hide_trending_searches"]) {
|
||||
NSLog(@"[SCInsta] Hiding trending searches");
|
||||
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
}
|
||||
}
|
||||
%end
|
||||
@@ -1,120 +0,0 @@
|
||||
// Download highlight cover image from the profile long-press menu.
|
||||
// Captures the long-pressed IGStoryTrayCell, finds the IGImageView inside it,
|
||||
// and saves the cover using the user's download settings.
|
||||
|
||||
#import "../../Utils.h"
|
||||
#import "../../Downloader/Download.h"
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <substrate.h>
|
||||
|
||||
static SCIDownloadDelegate *sciHighlightDl = nil;
|
||||
|
||||
// Find the IGStoryTrayCell with an active long-press gesture
|
||||
static UIView *sciFindLongPressedCell(UIView *root) {
|
||||
Class cellCls = NSClassFromString(@"IGStoryTrayCell");
|
||||
if (!cellCls) return nil;
|
||||
NSMutableArray *stack = [NSMutableArray arrayWithObject:root];
|
||||
while (stack.count) {
|
||||
UIView *v = stack.lastObject; [stack removeLastObject];
|
||||
if ([v isKindOfClass:cellCls]) {
|
||||
for (UIGestureRecognizer *gr in v.gestureRecognizers) {
|
||||
if ([gr isKindOfClass:[UILongPressGestureRecognizer class]] &&
|
||||
(gr.state == UIGestureRecognizerStateBegan || gr.state == UIGestureRecognizerStateChanged))
|
||||
return v;
|
||||
}
|
||||
}
|
||||
for (UIView *sub in v.subviews) [stack addObject:sub];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Find the IGImageView inside a specific cell
|
||||
static UIImage *sciCoverImageFromCell(UIView *cell) {
|
||||
if (!cell) return nil;
|
||||
Class igImageView = NSClassFromString(@"IGImageView");
|
||||
if (!igImageView) igImageView = [UIImageView class];
|
||||
NSMutableArray *stack = [NSMutableArray arrayWithObject:cell];
|
||||
while (stack.count) {
|
||||
UIView *v = stack.lastObject; [stack removeLastObject];
|
||||
if ([v isKindOfClass:igImageView] && [v isKindOfClass:[UIImageView class]]) {
|
||||
UIImage *img = [(UIImageView *)v image];
|
||||
if (img && img.size.width > 10) return img;
|
||||
}
|
||||
for (UIView *sub in v.subviews) [stack addObject:sub];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
static void sciSaveCoverImage(UIImage *image, UIViewController *presenter) {
|
||||
if (!image) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not find cover image"];
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *method = [SCIUtils getStringPref:@"dw_save_action"];
|
||||
if ([method isEqualToString:@"photos"]) {
|
||||
// Save to Photos (respects RyukGram album pref)
|
||||
NSData *data = UIImageJPEGRepresentation(image, 1.0);
|
||||
if (!data) return;
|
||||
NSString *tmpPath = [NSTemporaryDirectory() stringByAppendingPathComponent:
|
||||
[NSString stringWithFormat:@"%@.jpg", [[NSUUID UUID] UUIDString]]];
|
||||
[data writeToFile:tmpPath atomically:YES];
|
||||
NSURL *tmpURL = [NSURL fileURLWithPath:tmpPath];
|
||||
sciHighlightDl = [[SCIDownloadDelegate alloc] initWithAction:saveToPhotos showProgress:NO];
|
||||
[sciHighlightDl downloadDidFinishWithFileURL:tmpURL];
|
||||
} else {
|
||||
// Share sheet
|
||||
UIActivityViewController *activityVC = [[UIActivityViewController alloc]
|
||||
initWithActivityItems:@[image] applicationActivities:nil];
|
||||
if (presenter) [presenter presentViewController:activityVC animated:YES completion:nil];
|
||||
}
|
||||
}
|
||||
|
||||
// Stored reference to the long-pressed cell (captured at presentation time)
|
||||
static __weak UIView *sciLongPressedHighlightCell = nil;
|
||||
|
||||
static void (*orig_present)(id, SEL, id, BOOL, id);
|
||||
static void new_present(id self, SEL _cmd, id vc, BOOL animated, id completion) {
|
||||
if ([SCIUtils getBoolPref:@"download_highlight_cover"] &&
|
||||
[NSStringFromClass([vc class]) containsString:@"ActionSheet"] &&
|
||||
[NSStringFromClass([self class]) containsString:@"Profile"]) {
|
||||
|
||||
// Capture the long-pressed cell NOW while the gesture is still active
|
||||
UIView *cell = sciFindLongPressedCell([(UIViewController *)self view]);
|
||||
sciLongPressedHighlightCell = cell;
|
||||
|
||||
if (cell) {
|
||||
Ivar actIvar = class_getInstanceVariable([vc class], "_actions");
|
||||
NSArray *actions = actIvar ? object_getIvar(vc, actIvar) : nil;
|
||||
if (actions && actions.count >= 2 && actions.count <= 6) {
|
||||
Class actionCls = NSClassFromString(@"IGActionSheetControllerAction");
|
||||
if (actionCls) {
|
||||
__weak UIViewController *weakSelf = (UIViewController *)self;
|
||||
void (^handler)(void) = ^{
|
||||
UIImage *cover = sciCoverImageFromCell(sciLongPressedHighlightCell);
|
||||
sciSaveCoverImage(cover, weakSelf);
|
||||
};
|
||||
|
||||
SEL initSel = @selector(initWithTitle:subtitle:style:handler:accessibilityIdentifier:accessibilityLabel:);
|
||||
typedef id (*InitFn)(id, SEL, id, id, NSInteger, id, id, id);
|
||||
id newAction = ((InitFn)objc_msgSend)([actionCls alloc], initSel,
|
||||
@"Download cover", nil, 0, handler, nil, nil);
|
||||
|
||||
if (newAction) {
|
||||
NSMutableArray *newActions = [actions mutableCopy];
|
||||
[newActions addObject:newAction];
|
||||
object_setIvar(vc, actIvar, [newActions copy]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
orig_present(self, _cmd, vc, animated, completion);
|
||||
}
|
||||
|
||||
__attribute__((constructor)) static void _highlightInit(void) {
|
||||
MSHookMessageEx([UIViewController class], @selector(presentViewController:animated:completion:),
|
||||
(IMP)new_present, (IMP *)&orig_present);
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
BOOL isSurfaceShown(IGMainAppSurfaceIntent *surface) {
|
||||
BOOL isShown = YES;
|
||||
|
||||
// Feed
|
||||
if ([[surface tabStringFromSurfaceIntent] isEqualToString:@"FEED"] && [SCIUtils getBoolPref:@"hide_feed_tab"]) {
|
||||
isShown = NO;
|
||||
}
|
||||
|
||||
// Reels
|
||||
else if ([[surface tabStringFromSurfaceIntent] isEqualToString:@"CLIPS"] && [SCIUtils getBoolPref:@"hide_reels_tab"]) {
|
||||
isShown = NO;
|
||||
}
|
||||
|
||||
// Explore
|
||||
else if ([[surface tabStringFromSurfaceIntent] isEqualToString:@"SEARCH"] && [SCIUtils getBoolPref:@"hide_explore_tab"]) {
|
||||
isShown = NO;
|
||||
}
|
||||
|
||||
// Create
|
||||
else if ([(NSNumber *)[surface valueForKey:@"_subtype"] unsignedIntegerValue] == 3 && [SCIUtils getBoolPref:@"hide_create_tab"]) {
|
||||
isShown = NO;
|
||||
}
|
||||
|
||||
return isShown;
|
||||
}
|
||||
|
||||
NSArray *filterSurfacesArray(NSArray *surfaces) {
|
||||
NSMutableArray *filteredSurfaces = [NSMutableArray array];
|
||||
|
||||
for (IGMainAppSurfaceIntent *surface in surfaces) {
|
||||
if (![surface isKindOfClass:%c(IGMainAppSurfaceIntent)]) break;
|
||||
|
||||
if (isSurfaceShown(surface)) {
|
||||
[filteredSurfaces addObject:surface];
|
||||
}
|
||||
}
|
||||
|
||||
return filteredSurfaces;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////
|
||||
|
||||
%hook IGTabBarControllerSwipeCoordinator
|
||||
- (id)initWithSurfaces:(id)surfaces parentViewController:(id)controller enableHaptics:(_Bool)haptics launcherSet:(id)set {
|
||||
// Removes the surface from the main swipeable app collection view
|
||||
return %orig(filterSurfacesArray(surfaces), controller, haptics, set);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook IGTabBarController
|
||||
- (void)_layoutTabBar {
|
||||
// Prevents the wrong icon from being shown as selected because of mismatched surface array indexes
|
||||
NSArray *_tabBarSurfaces = [SCIUtils getIvarForObj:self name:"_tabBarSurfaces"];
|
||||
|
||||
[SCIUtils setIvarForObj:self name:"_tabBarSurfaces" value:filterSurfacesArray(_tabBarSurfaces)];
|
||||
|
||||
%orig;
|
||||
}
|
||||
|
||||
- (id)_buttonForTabBarSurface:(id)surface {
|
||||
// Prevents the button from being added to the tab bar
|
||||
id button = %orig(surface);
|
||||
|
||||
if (!isSurfaceShown(surface)) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
return button;
|
||||
}
|
||||
%end
|
||||
|
||||
// Demangled name: IGNavConfiguration.IGNavConfiguration
|
||||
%hook _TtC18IGNavConfiguration18IGNavConfiguration
|
||||
- (NSInteger)tabOrdering {
|
||||
|
||||
if ([[SCIUtils getStringPref:@"nav_icon_ordering"] isEqualToString:@"classic"]) return 0;
|
||||
else if ([[SCIUtils getStringPref:@"nav_icon_ordering"] isEqualToString:@"standard"]) return 1;
|
||||
else if ([[SCIUtils getStringPref:@"nav_icon_ordering"] isEqualToString:@"alternate"]) return 2;
|
||||
|
||||
return %orig;
|
||||
|
||||
}
|
||||
- (void)setTabOrdering:(NSInteger)arg1 {
|
||||
return;
|
||||
}
|
||||
|
||||
- (BOOL)isTabSwipingEnabled {
|
||||
|
||||
if ([[SCIUtils getStringPref:@"swipe_nav_tabs"] isEqualToString:@"enabled"]) return YES;
|
||||
else if ([[SCIUtils getStringPref:@"swipe_nav_tabs"] isEqualToString:@"disabled"]) return NO;
|
||||
|
||||
return %orig;
|
||||
|
||||
}
|
||||
- (void)setIsTabSwipingEnabled:(BOOL)arg1 {
|
||||
return;
|
||||
}
|
||||
%end
|
||||
@@ -1,50 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
// Disable logging of searches at server-side
|
||||
%hook IGSearchEntityRouter
|
||||
- (id)initWithUserSession:(id)arg1 analyticsModule:(id)arg2 shouldAddToRecents:(BOOL)shouldAddToRecents {
|
||||
if ([SCIUtils getBoolPref:@"no_recent_searches"]) {
|
||||
NSLog(@"[SCInsta] Disabling recent searches");
|
||||
|
||||
shouldAddToRecents = false;
|
||||
}
|
||||
|
||||
return %orig(arg1, arg2, shouldAddToRecents);
|
||||
}
|
||||
%end
|
||||
|
||||
// Most in-app search bars
|
||||
%hook IGRecentSearchStore
|
||||
- (id)initWithDiskManager:(id)arg1 recentSearchStoreConfiguration:(id)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"no_recent_searches"]) {
|
||||
NSLog(@"[SCInsta] Disabling recent searches");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
- (BOOL)addItem:(id)arg1 {
|
||||
if ([SCIUtils getBoolPref:@"no_recent_searches"]) {
|
||||
NSLog(@"[SCInsta] Disabling recent searches");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Recent dm message recipients search bar
|
||||
%hook IGDirectRecipientRecentSearchStorage
|
||||
- (id)initWithDiskManager:(id)arg1 directCache:(id)arg2 userStore:(id)arg3 currentUser:(id)arg4 featureSets:(id)arg5 {
|
||||
if ([SCIUtils getBoolPref:@"no_recent_searches"]) {
|
||||
NSLog(@"[SCInsta] Disabling recent searches");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
@@ -1,19 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
// Channels dms tab (header)
|
||||
%hook IGDirectInboxHeaderSectionController
|
||||
- (id)viewModel {
|
||||
if ([[%orig title] isEqualToString:@"Suggested"]) {
|
||||
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_chats"]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested chats (header: channels tab)");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
@@ -1,263 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
// "Welcome to instagram" suggested users in feed
|
||||
%hook IGSuggestedUnitViewModel
|
||||
- (id)initWithAYMFModel:(id)arg1 headerViewModel:(id)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested users: main feed welcome section");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
%hook IGSuggestionsUnitViewModel
|
||||
- (id)initWithAYMFModel:(id)arg1 headerViewModel:(id)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested users: main feed welcome section");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Suggested users in profile header
|
||||
%hook IGProfileHeaderView
|
||||
- (id)objectsForListAdapter:(id)arg1 {
|
||||
NSArray *originalObjs = %orig();
|
||||
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
|
||||
|
||||
for (id obj in originalObjs) {
|
||||
BOOL shouldHide = NO;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
|
||||
if ([obj isKindOfClass:%c(IGProfileChainingModel)]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested users: profile header");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
}
|
||||
|
||||
// Populate new objs array
|
||||
if (!shouldHide) {
|
||||
[filteredObjs addObject:obj];
|
||||
}
|
||||
}
|
||||
|
||||
return [filteredObjs copy];
|
||||
}
|
||||
%end
|
||||
|
||||
// Notifications/activity feed
|
||||
%hook IGActivityFeedViewController
|
||||
- (id)objectsForListAdapter:(id)arg1 {
|
||||
NSArray *originalObjs = %orig();
|
||||
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
|
||||
|
||||
for (id obj in originalObjs) {
|
||||
BOOL shouldHide = NO;
|
||||
|
||||
// Section header
|
||||
if ([obj isKindOfClass:%c(IGLabelItemViewModel)]) {
|
||||
// Suggested for you
|
||||
if ([[obj labelTitle] isEqualToString:@"Suggested for you"]) {
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested users (header: activity feed)");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Suggested user
|
||||
else if ([obj isKindOfClass:%c(IGDiscoverPeopleItemConfiguration)]) {
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested users: (user: activity feed)");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
}
|
||||
|
||||
// "See all" button
|
||||
else if ([obj isKindOfClass:%c(IGSeeAllItemConfiguration)]) {
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested users: (see all: activity feed)");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
}
|
||||
|
||||
// Populate new objs array
|
||||
if (!shouldHide) {
|
||||
[filteredObjs addObject:obj];
|
||||
}
|
||||
}
|
||||
|
||||
return [filteredObjs copy];
|
||||
}
|
||||
%end
|
||||
|
||||
// Profile "following" and "followers" tabs
|
||||
%hook IGFollowListViewController
|
||||
- (id)objectsForListAdapter:(id)arg1 {
|
||||
NSArray *originalObjs = %orig(arg1);
|
||||
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
|
||||
|
||||
for (IGStoryTrayViewModel *obj in originalObjs) {
|
||||
BOOL shouldHide = NO;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
|
||||
|
||||
// Suggested user
|
||||
if ([obj isKindOfClass:%c(IGDiscoverPeopleItemConfiguration)]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested users: follow list suggested user");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
|
||||
// Section header
|
||||
else if ([obj isKindOfClass:%c(IGLabelItemViewModel)]) {
|
||||
|
||||
// "Suggested for you" search results header
|
||||
if ([[obj valueForKey:@"labelTitle"] isEqualToString:@"Suggested for you"]) {
|
||||
shouldHide = YES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// See all suggested users
|
||||
else if ([obj isKindOfClass:%c(IGSeeAllItemConfiguration)] && ((IGSeeAllItemConfiguration *)obj).destination == 4) {
|
||||
NSLog(@"[SCInsta] Hiding suggested users: follow list suggested user");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Populate new objs array
|
||||
if (!shouldHide) {
|
||||
[filteredObjs addObject:obj];
|
||||
}
|
||||
}
|
||||
|
||||
return [filteredObjs copy];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook IGSegmentedTabControl
|
||||
- (void)setSegments:(id)segments {
|
||||
NSArray *originalObjs = segments;
|
||||
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
|
||||
|
||||
for (IGStoryTrayViewModel *obj in originalObjs) {
|
||||
BOOL shouldHide = NO;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
|
||||
if ([obj isKindOfClass:%c(IGFindUsersViewController)]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested users: find users segmented tab");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
}
|
||||
|
||||
// Populate new objs array
|
||||
if (!shouldHide) {
|
||||
[filteredObjs addObject:obj];
|
||||
}
|
||||
}
|
||||
|
||||
return %orig([filteredObjs copy]);
|
||||
}
|
||||
%end
|
||||
|
||||
// Suggested subscriptions
|
||||
%hook IGFanClubSuggestedUsersDataSource
|
||||
- (id)initWithUserSession:(id)arg1 delegate:(id)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
return %orig(arg1, arg2);
|
||||
}
|
||||
%end
|
||||
|
||||
// Follow request/discover section (accessed through notifications page)
|
||||
// Demangled name: IGFriendingCenter.IGFriendingCenterViewController
|
||||
%hook _TtC17IGFriendingCenter31IGFriendingCenterViewController
|
||||
- (id)objectsForListAdapter:(id)arg1 {
|
||||
NSArray *originalObjs = %orig(arg1);
|
||||
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
|
||||
|
||||
for (IGStoryTrayViewModel *obj in originalObjs) {
|
||||
BOOL shouldHide = NO;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
|
||||
|
||||
// Suggested user
|
||||
if ([obj isKindOfClass:%c(IGDiscoverPeopleItemConfiguration)]) {
|
||||
NSLog(@"[SCInsta] Hiding suggested users: follow list suggested user");
|
||||
|
||||
shouldHide = YES;
|
||||
}
|
||||
|
||||
// Section header
|
||||
else if ([obj isKindOfClass:%c(IGLabelItemViewModel)]) {
|
||||
|
||||
// "Suggested for you" search results header
|
||||
if ([[obj valueForKey:@"labelTitle"] isEqualToString:@"Suggested for you"]) {
|
||||
shouldHide = YES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Populate new objs array
|
||||
if (!shouldHide) {
|
||||
[filteredObjs addObject:obj];
|
||||
}
|
||||
}
|
||||
|
||||
return [filteredObjs copy];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook IGProfileActionBarViewModel
|
||||
- (id)initWithIdentifier:(id)arg1
|
||||
rows:(id)arg2
|
||||
allActionsToDisplay:(id)arg3
|
||||
overflowActions:(id)arg4
|
||||
actionToBadgeInfoMap:(id)arg5
|
||||
allBusinessActions:(id)arg6
|
||||
overflowBusinessActions:(id)arg7
|
||||
contactSheetActions:(id)arg8
|
||||
user:(id)arg9
|
||||
sponsoredInfoProvider:(id)arg10
|
||||
profileBackgroundColor:(id)arg11
|
||||
{
|
||||
NSArray *rows = arg2;
|
||||
NSOrderedSet *allActions = [arg3 copy];
|
||||
NSOrderedSet *overflowActions = [arg4 copy];
|
||||
|
||||
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
|
||||
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT (SELF IN %@)", @[ @(3) ]];
|
||||
|
||||
// Actions sets
|
||||
allActions = [allActions filteredOrderedSetUsingPredicate:predicate];
|
||||
overflowActions = [overflowActions filteredOrderedSetUsingPredicate:predicate];
|
||||
|
||||
// Rows of actions sets
|
||||
NSMutableArray *filteredRows = [NSMutableArray new];
|
||||
for (NSOrderedSet *set in rows) {
|
||||
[filteredRows addObject:[set filteredOrderedSetUsingPredicate:predicate]];
|
||||
}
|
||||
rows = [filteredRows copy];
|
||||
}
|
||||
|
||||
return %orig(arg1, rows, allActions, overflowActions, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
|
||||
}
|
||||
%end
|
||||
@@ -1,293 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
static char targetStaticRef[] = "target";
|
||||
|
||||
%hook IGDirectNotesCreationView
|
||||
- (id)initWithViewModel:(id)model
|
||||
featureSupport:(IGNotesCreationFeatureSupportModel *)support
|
||||
presentationAnimation:(id)animation
|
||||
composerUpdateListener:(id)listener
|
||||
delegate:(id)delegate
|
||||
layoutType:(long long)type
|
||||
userSession:(id)session
|
||||
{
|
||||
if ([SCIUtils getBoolPref:@"enable_notes_customization"]) {
|
||||
|
||||
// enableAnimatedEmojisInCreation
|
||||
@try {
|
||||
[support setValue:@(YES) forKey:@"enableAnimatedEmojisInCreation"];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
NSLog(@"[SCInsta] WARNING: %@\n\nFull object: %@", exception.reason, support);
|
||||
}
|
||||
|
||||
// enableBubbleCustomization
|
||||
@try {
|
||||
[support setValue:@(YES) forKey:@"enableBubbleCustomization"];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
NSLog(@"[SCInsta] WARNING: %@\n\nFull object: %@", exception.reason, support);
|
||||
}
|
||||
|
||||
// enableRandomThemeGenerator
|
||||
@try {
|
||||
[support setValue:@(YES) forKey:@"enableRandomThemeGenerator"];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
NSLog(@"[SCInsta] WARNING: %@\n\nFull object: %@", exception.reason, support);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return %orig(model, support, animation, listener, delegate, type, session);
|
||||
}
|
||||
%end
|
||||
|
||||
// Demangled name: IGDirectNotesUISwift.IGDirectNotesBubbleEditorColorPaletteView
|
||||
%hook _TtC20IGDirectNotesUISwift41IGDirectNotesBubbleEditorColorPaletteView
|
||||
%property (nonatomic, copy) UIColor *backgroundColor;
|
||||
%property (nonatomic, copy) UIColor *textColor;
|
||||
%property (nonatomic, copy) NSString *emojiText;
|
||||
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
|
||||
if (![SCIUtils getBoolPref:@"custom_note_themes"]) return;
|
||||
|
||||
// Inject buttons once in view lifecycle
|
||||
static char didInjectButtons;
|
||||
if (objc_getAssociatedObject(self, &didInjectButtons)) {
|
||||
return;
|
||||
}
|
||||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
__strong typeof(weakSelf) self = weakSelf;
|
||||
if (!self || !self.window) {
|
||||
return;
|
||||
}
|
||||
|
||||
UIView *container = self.superview ?: self.window;
|
||||
if (!container) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Button config
|
||||
UIButtonConfiguration *config = [UIButtonConfiguration tintedButtonConfiguration];
|
||||
config.background.cornerRadius = 12.0;
|
||||
config.cornerStyle = UIButtonConfigurationCornerStyleFixed;
|
||||
config.contentInsets = NSDirectionalEdgeInsetsMake(13.7, 10, 13.7, 10);
|
||||
|
||||
|
||||
// Left button
|
||||
UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
leftButton.configuration = config;
|
||||
leftButton.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
leftButton.tintColor = [SCIUtils SCIColor_Primary];
|
||||
|
||||
NSMutableAttributedString *attrTitleLeft = [[NSMutableAttributedString alloc] initWithString:@"Background"];
|
||||
[attrTitleLeft addAttribute:NSFontAttributeName
|
||||
value:[UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]
|
||||
range:NSMakeRange(0, attrTitleLeft.length)
|
||||
];
|
||||
[leftButton setAttributedTitle:attrTitleLeft forState:UIControlStateNormal];
|
||||
[leftButton sizeToFit];
|
||||
|
||||
[leftButton addAction:[UIAction actionWithHandler:^(__kindof UIAction * _Nonnull action) {
|
||||
[self presentColorPicker:@"Background"];
|
||||
}] forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
// Middle button
|
||||
UIButton *middleButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
middleButton.configuration = config;
|
||||
middleButton.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
middleButton.tintColor = [SCIUtils SCIColor_Primary];
|
||||
|
||||
NSMutableAttributedString *attrTitleMiddle = [[NSMutableAttributedString alloc] initWithString:@"Text"];
|
||||
[attrTitleMiddle addAttribute:NSFontAttributeName
|
||||
value:[UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]
|
||||
range:NSMakeRange(0, attrTitleMiddle.length)
|
||||
];
|
||||
[middleButton setAttributedTitle:attrTitleMiddle forState:UIControlStateNormal];
|
||||
[middleButton sizeToFit];
|
||||
|
||||
[middleButton addAction:[UIAction actionWithHandler:^(__kindof UIAction * _Nonnull action) {
|
||||
[self presentColorPicker:@"Text"];
|
||||
}] forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
// Right button
|
||||
UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
rightButton.configuration = config;
|
||||
rightButton.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
rightButton.tintColor = [SCIUtils SCIColor_Primary];
|
||||
|
||||
NSMutableAttributedString *attrTitleRight = [[NSMutableAttributedString alloc] initWithString:@"Emoji"];
|
||||
[attrTitleRight addAttribute:NSFontAttributeName
|
||||
value:[UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]
|
||||
range:NSMakeRange(0, attrTitleRight.length)
|
||||
];
|
||||
[rightButton setAttributedTitle:attrTitleRight forState:UIControlStateNormal];
|
||||
[rightButton sizeToFit];
|
||||
|
||||
[rightButton addAction:[UIAction actionWithHandler:^(__kindof UIAction * _Nonnull action) {
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Enter Emoji Text"
|
||||
message:@"Click the Apply button after this to see the emoji"
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
|
||||
textField.placeholder = @"Type emoji...";
|
||||
}];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"OK"
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *action) {
|
||||
self.emojiText = alert.textFields[0].text;
|
||||
[self applySCICustomTheme:@"Emoji"];
|
||||
}]];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"Cancel"
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:nil]];
|
||||
|
||||
UIViewController *vc = [SCIUtils nearestViewControllerForView:self];
|
||||
[vc presentViewController:alert animated:YES completion:nil];
|
||||
}] forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
|
||||
// Create stack view
|
||||
UIStackView *stack = [[UIStackView alloc] initWithArrangedSubviews:@[leftButton, middleButton, rightButton]];
|
||||
stack.axis = UILayoutConstraintAxisHorizontal;
|
||||
stack.spacing = 15.0;
|
||||
stack.alignment = UIStackViewAlignmentCenter;
|
||||
stack.distribution = UIStackViewDistributionFillEqually;
|
||||
|
||||
// Find max height among arranged subviews
|
||||
CGFloat maxHeight = 0.0;
|
||||
for (UIView *subview in stack.arrangedSubviews) {
|
||||
maxHeight = MAX(maxHeight, subview.bounds.size.height);
|
||||
}
|
||||
|
||||
// Manual frame with side padding
|
||||
CGFloat bottomMargin = 15.0;
|
||||
|
||||
CGRect viewFrame = [self convertRect:self.bounds toView:container];
|
||||
CGFloat y = CGRectGetMinY(viewFrame) - maxHeight - bottomMargin;
|
||||
CGFloat width = container.bounds.size.width - stack.spacing * 2;
|
||||
|
||||
stack.frame = CGRectMake(stack.spacing, y, width, maxHeight);
|
||||
|
||||
[stack layoutIfNeeded];
|
||||
[container addSubview:stack];
|
||||
|
||||
objc_setAssociatedObject(
|
||||
self,
|
||||
&didInjectButtons,
|
||||
@YES,
|
||||
OBJC_ASSOCIATION_RETAIN_NONATOMIC
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
%new - (void)presentColorPicker:(NSString *)target {
|
||||
UIColorPickerViewController *colorPickerController = [[UIColorPickerViewController alloc] init];
|
||||
|
||||
colorPickerController.delegate = (id<UIColorPickerViewControllerDelegate>)self; // cast to suppress warnings
|
||||
colorPickerController.title = [NSString stringWithFormat:@"%@ color", target];
|
||||
colorPickerController.modalPresentationStyle = UIModalPresentationPopover;
|
||||
colorPickerController.supportsAlpha = NO;
|
||||
|
||||
// Show last picked color for type
|
||||
if ([target isEqualToString:@"Background"]) {
|
||||
colorPickerController.selectedColor = self.backgroundColor;
|
||||
}
|
||||
else if ([target isEqualToString:@"Text"]) {
|
||||
colorPickerController.selectedColor = self.textColor;
|
||||
}
|
||||
|
||||
UIViewController *presentingVC = [SCIUtils nearestViewControllerForView:self];
|
||||
|
||||
if (presentingVC != nil) {
|
||||
[presentingVC presentViewController:colorPickerController animated:YES completion:nil];
|
||||
}
|
||||
|
||||
// Save which color target to update
|
||||
objc_setAssociatedObject(
|
||||
presentingVC,
|
||||
&targetStaticRef,
|
||||
target,
|
||||
OBJC_ASSOCIATION_RETAIN_NONATOMIC
|
||||
);
|
||||
}
|
||||
|
||||
// UIColorPickerViewControllerDelegate Protocol
|
||||
%new - (void)colorPickerViewController:(UIColorPickerViewController *)viewController
|
||||
didSelectColor:(UIColor *)color
|
||||
continuously:(BOOL)continuously
|
||||
{
|
||||
_TtC20IGDirectNotesUISwift41IGDirectNotesBubbleEditorColorPaletteView *bubbleEditorVC = [SCIUtils nearestViewControllerForView:self];
|
||||
|
||||
NSString *target = objc_getAssociatedObject(bubbleEditorVC, &targetStaticRef);
|
||||
if (!target) return;
|
||||
|
||||
// Update saved color target
|
||||
if ([target isEqualToString:@"Background"]) {
|
||||
self.backgroundColor = color;
|
||||
}
|
||||
else if ([target isEqualToString:@"Text"]) {
|
||||
self.textColor = color;
|
||||
}
|
||||
|
||||
[self applySCICustomTheme:target];
|
||||
};
|
||||
|
||||
%new - (void)applySCICustomTheme:(NSString *)target {
|
||||
// Get notes composer vc
|
||||
_TtC20IGDirectNotesUISwift39IGDirectNotesBubbleEditorViewController *parentVC = [SCIUtils nearestViewControllerForView:self];
|
||||
if (!parentVC) return;
|
||||
|
||||
IGDirectNotesComposerViewController *composerVC = parentVC.delegate;
|
||||
if (!composerVC) return;
|
||||
|
||||
// Get current theme model
|
||||
IGNotesCustomThemeCreationModel *model = [composerVC valueForKey:@"_selectedCustomThemeCreationModel"];
|
||||
if (!model) {
|
||||
// Create new note theme model
|
||||
model = [[%c(IGNotesCustomThemeCreationModel) alloc] init];
|
||||
if (!model) return;
|
||||
}
|
||||
|
||||
//SCILog(@"Current note theme model: %@", model);
|
||||
[model setValue:[composerVC valueForKey:@"_composerText"] forKey:@"customEmoji"];
|
||||
|
||||
// Update saved color target
|
||||
if ([target isEqualToString:@"Background"]) {
|
||||
[model setValue:self.backgroundColor forKey:@"backgroundColor"];
|
||||
}
|
||||
else if ([target isEqualToString:@"Text"]) {
|
||||
[model setValue:self.textColor forKey:@"textColor"];
|
||||
[model setValue:self.textColor forKey:@"secondaryTextColor"];
|
||||
}
|
||||
|
||||
// Always set emoji to prevent it being overwritten
|
||||
[model setValue:self.emojiText forKey:@"customEmoji"];
|
||||
|
||||
//SCILog(@"Updated note theme model: %@", model);
|
||||
|
||||
// Apply custom notes theme
|
||||
[composerVC notesBubbleEditorViewControllerDidUpdateWithCustomThemeCreationModel:model];
|
||||
|
||||
// Enable apply/cancel buttons
|
||||
UIView *parentVCView = [parentVC view];
|
||||
if (!parentVCView) return;
|
||||
|
||||
NSArray<UIView *> *parentVCSubviews = [parentVCView subviews];
|
||||
if (!parentVCSubviews) return;
|
||||
|
||||
[parentVCSubviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||
if ([obj isKindOfClass:%c(IGDSBottomButtonsView)]) {
|
||||
[obj setPrimaryButtonEnabled:YES];
|
||||
[obj setSecondaryButtonEnabled:YES];
|
||||
}
|
||||
}];
|
||||
}
|
||||
%end
|
||||
@@ -1,69 +0,0 @@
|
||||
// Open links in external browser + strip IG tracking from URLs
|
||||
#import "../../Utils.h"
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
|
||||
// Extract the real URL from l.instagram.com redirects and strip tracking params
|
||||
static NSURL *sciCleanBrowserURL(NSURL *url) {
|
||||
if (![SCIUtils getBoolPref:@"strip_browser_tracking"]) return url;
|
||||
if (!url) return url;
|
||||
|
||||
NSString *urlStr = url.absoluteString;
|
||||
|
||||
// Unwrap l.instagram.com/?u=ENCODED_URL&e=TRACKING redirects
|
||||
if ([url.host isEqualToString:@"l.instagram.com"]) {
|
||||
NSURLComponents *comps = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];
|
||||
for (NSURLQueryItem *q in comps.queryItems) {
|
||||
if ([q.name isEqualToString:@"u"] && q.value.length) {
|
||||
NSString *decoded = [q.value stringByRemovingPercentEncoding];
|
||||
if (decoded) urlStr = decoded;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Strip common tracking params from the destination URL
|
||||
NSURLComponents *comps = [NSURLComponents componentsWithString:urlStr];
|
||||
if (comps.queryItems.count) {
|
||||
NSSet *trackingParams = [NSSet setWithArray:@[
|
||||
@"utm_source", @"utm_medium", @"utm_campaign", @"utm_content",
|
||||
@"utm_term", @"utm_id", @"fbclid", @"igshid", @"igsh",
|
||||
@"ig_rid", @"campaign_id", @"ad_id", @"aem"
|
||||
]];
|
||||
NSMutableArray *clean = [NSMutableArray array];
|
||||
for (NSURLQueryItem *q in comps.queryItems) {
|
||||
if (![trackingParams containsObject:q.name]) [clean addObject:q];
|
||||
}
|
||||
comps.queryItems = clean.count ? clean : nil;
|
||||
}
|
||||
|
||||
NSURL *result = comps.URL;
|
||||
return result ?: url;
|
||||
}
|
||||
|
||||
%hook IGBrowserNavigationController
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
id session = ((id(*)(id,SEL))objc_msgSend)(self, @selector(browserSession));
|
||||
Ivar urlIvar = session ? class_getInstanceVariable([session class], "_urlRequest") : nil;
|
||||
NSURLRequest *req = urlIvar ? object_getIvar(session, urlIvar) : nil;
|
||||
NSURL *url = req.URL;
|
||||
|
||||
if (url && [SCIUtils getBoolPref:@"open_links_external"]) {
|
||||
NSURL *cleaned = sciCleanBrowserURL(url);
|
||||
[[UIApplication sharedApplication] openURL:cleaned options:@{} completionHandler:nil];
|
||||
[(UIViewController *)self dismissViewControllerAnimated:NO completion:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
// For in-app browser: replace the URL request with the cleaned version
|
||||
if (url && [SCIUtils getBoolPref:@"strip_browser_tracking"]) {
|
||||
NSURL *cleaned = sciCleanBrowserURL(url);
|
||||
if (![cleaned isEqual:url]) {
|
||||
NSURLRequest *cleanReq = [NSURLRequest requestWithURL:cleaned];
|
||||
object_setIvar(session, urlIvar, cleanReq);
|
||||
}
|
||||
}
|
||||
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
@@ -1,251 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
#import "../../../modules/JGProgressHUD/JGProgressHUD.h"
|
||||
#import <objc/runtime.h>
|
||||
#import <substrate.h>
|
||||
|
||||
// Profile page copy button: hooks IG's native nav header builder to insert
|
||||
// a copy button alongside IG's own buttons, then opens a menu to copy
|
||||
// username/name/bio.
|
||||
|
||||
@interface IGProfileViewController : UIViewController
|
||||
@end
|
||||
|
||||
static id sci_safeValueForKey(id obj, NSString *key) {
|
||||
@try { return [obj valueForKey:key]; }
|
||||
@catch (__unused NSException *e) { return nil; }
|
||||
}
|
||||
|
||||
static id sci_valueForAnyKey(id obj, NSArray<NSString *> *keys) {
|
||||
for (NSString *k in keys) {
|
||||
id v = sci_safeValueForKey(obj, k);
|
||||
if (v && v != [NSNull null]) return v;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
static id sci_findUserOnVC(UIViewController *vc) {
|
||||
id user = sci_valueForAnyKey(vc, @[@"user", @"userGQL", @"profileUser", @"loggedInUser", @"currentUser"]);
|
||||
if (user) return user;
|
||||
|
||||
Class userCls = NSClassFromString(@"IGUser");
|
||||
Class c = [vc class];
|
||||
while (c && c != [NSObject class]) {
|
||||
unsigned int count = 0;
|
||||
Ivar *ivars = class_copyIvarList(c, &count);
|
||||
for (unsigned int i = 0; i < count; i++) {
|
||||
id v = object_getIvar(vc, ivars[i]);
|
||||
if (userCls && [v isKindOfClass:userCls]) {
|
||||
free(ivars);
|
||||
return v;
|
||||
}
|
||||
}
|
||||
if (ivars) free(ivars);
|
||||
c = class_getSuperclass(c);
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
static UIViewController *sci_findProfileVC(UIView *view) {
|
||||
Class profileCls = NSClassFromString(@"IGProfileViewController");
|
||||
UIResponder *r = view;
|
||||
while (r) {
|
||||
if (profileCls && [r isKindOfClass:profileCls]) return (UIViewController *)r;
|
||||
r = [r nextResponder];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
static void sci_copyAndToast(NSString *value, NSString *label) {
|
||||
if (value.length == 0) return;
|
||||
[UIPasteboard generalPasteboard].string = value;
|
||||
|
||||
JGProgressHUD *HUD = [[JGProgressHUD alloc] init];
|
||||
HUD.textLabel.text = [NSString stringWithFormat:@"Copied %@", label];
|
||||
HUD.indicatorView = [[JGProgressHUDSuccessIndicatorView alloc] init];
|
||||
UIView *host = nil;
|
||||
for (UIWindow *w in [UIApplication sharedApplication].windows) {
|
||||
if (w.isKeyWindow) { host = w; break; }
|
||||
}
|
||||
if (host) {
|
||||
[HUD showInView:host];
|
||||
[HUD dismissAfterDelay:1.5];
|
||||
}
|
||||
}
|
||||
|
||||
// Singleton target for the copy button so we don't have to track lifetime.
|
||||
@interface SCIProfileCopyTarget : NSObject
|
||||
+ (instancetype)shared;
|
||||
- (void)handleTap:(UIButton *)sender;
|
||||
@end
|
||||
|
||||
@implementation SCIProfileCopyTarget
|
||||
+ (instancetype)shared {
|
||||
static SCIProfileCopyTarget *s;
|
||||
static dispatch_once_t once;
|
||||
dispatch_once(&once, ^{ s = [[SCIProfileCopyTarget alloc] init]; });
|
||||
return s;
|
||||
}
|
||||
|
||||
- (void)handleTap:(UIButton *)sender {
|
||||
UIViewController *vc = sci_findProfileVC(sender);
|
||||
if (!vc) {
|
||||
NSLog(@"[SCInsta] copy button: no IGProfileViewController in responder chain");
|
||||
return;
|
||||
}
|
||||
|
||||
id user = sci_findUserOnVC(vc);
|
||||
if (!user) {
|
||||
NSLog(@"[SCInsta] copy button: no IGUser found on %@", vc.class);
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *username = [sci_valueForAnyKey(user, @[@"username"]) description];
|
||||
NSString *fullName = [sci_valueForAnyKey(user, @[@"fullName", @"fullname", @"name"]) description];
|
||||
NSString *biography = [sci_valueForAnyKey(user, @[@"biography", @"bio", @"profileBiography"]) description];
|
||||
|
||||
NSLog(@"[SCInsta] copy button user=%@ name=%@ bioLen=%lu",
|
||||
username, fullName, (unsigned long)biography.length);
|
||||
|
||||
UIAlertController *menu = [UIAlertController alertControllerWithTitle:@"Copy from profile"
|
||||
message:nil
|
||||
preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
|
||||
if (username.length) {
|
||||
[menu addAction:[UIAlertAction actionWithTitle:[NSString stringWithFormat:@"Copy username (@%@)", username]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *_) { sci_copyAndToast(username, @"username"); }]];
|
||||
}
|
||||
if (fullName.length) {
|
||||
[menu addAction:[UIAlertAction actionWithTitle:@"Copy name"
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *_) { sci_copyAndToast(fullName, @"name"); }]];
|
||||
}
|
||||
if (biography.length) {
|
||||
[menu addAction:[UIAlertAction actionWithTitle:@"Copy bio"
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *_) { sci_copyAndToast(biography, @"bio"); }]];
|
||||
}
|
||||
|
||||
NSMutableArray *parts = [NSMutableArray array];
|
||||
if (username.length) [parts addObject:[NSString stringWithFormat:@"Username: @%@", username]];
|
||||
if (fullName.length) [parts addObject:[NSString stringWithFormat:@"Name: %@", fullName]];
|
||||
if (biography.length) [parts addObject:[NSString stringWithFormat:@"Bio:\n%@", biography]];
|
||||
|
||||
if (parts.count >= 2) {
|
||||
NSString *combined = [parts componentsJoinedByString:@"\n\n"];
|
||||
[menu addAction:[UIAlertAction actionWithTitle:@"Copy all"
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *_) { sci_copyAndToast(combined, @"all"); }]];
|
||||
}
|
||||
|
||||
if (menu.actions.count == 0) {
|
||||
[menu addAction:[UIAlertAction actionWithTitle:@"Nothing to copy" style:UIAlertActionStyleDefault handler:nil]];
|
||||
}
|
||||
|
||||
[menu addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
|
||||
|
||||
if (sender) {
|
||||
menu.popoverPresentationController.sourceView = sender;
|
||||
menu.popoverPresentationController.sourceRect = sender.bounds;
|
||||
}
|
||||
|
||||
[vc presentViewController:menu animated:YES completion:nil];
|
||||
}
|
||||
@end
|
||||
|
||||
static UIView *sci_buildCopyButton(void) {
|
||||
UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
btn.accessibilityIdentifier = @"sci-profile-copy-button";
|
||||
btn.accessibilityLabel = @"Copy profile info";
|
||||
UIImageSymbolConfiguration *cfg =
|
||||
[UIImageSymbolConfiguration configurationWithPointSize:16
|
||||
weight:UIImageSymbolWeightRegular];
|
||||
UIImage *icon = [[UIImage systemImageNamed:@"doc.on.doc"] imageByApplyingSymbolConfiguration:cfg];
|
||||
[btn setImage:icon forState:UIControlStateNormal];
|
||||
btn.tintColor = [UIColor labelColor];
|
||||
btn.frame = CGRectMake(0, 0, 24, 44);
|
||||
[btn addTarget:[SCIProfileCopyTarget shared]
|
||||
action:@selector(handleTap:)
|
||||
forControlEvents:UIControlEventTouchUpInside];
|
||||
return btn;
|
||||
}
|
||||
|
||||
static void (*orig_configureHeaderView)(id, SEL, id, id, id, BOOL);
|
||||
|
||||
static void hooked_configureHeaderView(id self, SEL _cmd,
|
||||
id titleView,
|
||||
id leftButtons,
|
||||
id rightButtons,
|
||||
BOOL titleIsCentered) {
|
||||
if (![SCIUtils getBoolPref:@"profile_copy_button"]) {
|
||||
orig_configureHeaderView(self, _cmd, titleView, leftButtons, rightButtons, titleIsCentered);
|
||||
return;
|
||||
}
|
||||
|
||||
// Own profile (centered title) → inject on the left to avoid crowding the
|
||||
// plus/notifications/burger cluster. Other profiles → inject on the right.
|
||||
NSArray *lb = [leftButtons isKindOfClass:[NSArray class]] ? (NSArray *)leftButtons : nil;
|
||||
NSArray *rb = [rightButtons isKindOfClass:[NSArray class]] ? (NSArray *)rightButtons : nil;
|
||||
BOOL isOwnProfile = titleIsCentered;
|
||||
|
||||
BOOL alreadyHas = NO;
|
||||
for (id wrapper in (isOwnProfile ? lb : rb)) {
|
||||
UIView *v = sci_safeValueForKey(wrapper, @"view");
|
||||
if ([v isKindOfClass:[UIView class]] &&
|
||||
[v.accessibilityIdentifier isEqualToString:@"sci-profile-copy-button"]) {
|
||||
alreadyHas = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
NSArray *patchedLeft = leftButtons;
|
||||
NSArray *patchedRight = rightButtons;
|
||||
|
||||
if (!alreadyHas) {
|
||||
Class wrapperCls = NSClassFromString(@"IGProfileNavigationHeaderViewButtonSwift.IGProfileNavigationHeaderViewButton");
|
||||
// Mirror an existing button's type so IG lays ours out the same way
|
||||
id sample = rb.firstObject ?: lb.firstObject;
|
||||
NSInteger type = 0;
|
||||
id typeVal = sci_safeValueForKey(sample, @"type");
|
||||
if ([typeVal respondsToSelector:@selector(integerValue)]) {
|
||||
type = [typeVal integerValue];
|
||||
}
|
||||
|
||||
UIView *btn = sci_buildCopyButton();
|
||||
id wrapper = nil;
|
||||
if (wrapperCls) {
|
||||
wrapper = [wrapperCls alloc];
|
||||
SEL initSel = @selector(initWithType:view:);
|
||||
if ([wrapper respondsToSelector:initSel]) {
|
||||
id (*ctor)(id, SEL, NSInteger, id) =
|
||||
(id (*)(id, SEL, NSInteger, id))objc_msgSend;
|
||||
wrapper = ctor(wrapper, initSel, type, btn);
|
||||
}
|
||||
}
|
||||
|
||||
if (wrapper) {
|
||||
if (isOwnProfile) {
|
||||
NSMutableArray *m = lb ? [lb mutableCopy] : [NSMutableArray array];
|
||||
[m addObject:wrapper];
|
||||
patchedLeft = m;
|
||||
} else if (rb) {
|
||||
NSMutableArray *m = [rb mutableCopy];
|
||||
[m insertObject:wrapper atIndex:0];
|
||||
patchedRight = m;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
orig_configureHeaderView(self, _cmd, titleView, patchedLeft, patchedRight, titleIsCentered);
|
||||
}
|
||||
|
||||
%ctor {
|
||||
Class cls = objc_getClass("IGProfileNavigationSwift.IGProfileNavigationHeaderView");
|
||||
if (!cls) return;
|
||||
SEL sel = @selector(configureWithTitleView:leftButtons:rightButtons:titleIsCentered:);
|
||||
if (![cls instancesRespondToSelector:sel]) return;
|
||||
MSHookMessageEx(cls, sel,
|
||||
(IMP)hooked_configureHeaderView,
|
||||
(IMP *)&orig_configureHeaderView);
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
#import "../../InstagramHeaders.h"
|
||||
#import "../../Settings/SCISettingsViewController.h"
|
||||
|
||||
// Show SCInsta tweak settings by holding on the settings/more icon under profile for ~1 second
|
||||
%hook IGBadgedNavigationButton
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"profile-more-button"]) {
|
||||
[self addLongPressGestureRecognizer];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
%new - (void)addLongPressGestureRecognizer {
|
||||
if ([self.gestureRecognizers count] == 0) {
|
||||
NSLog(@"[SCInsta] Adding tweak settings long press gesture recognizer");
|
||||
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
}
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
NSLog(@"[SCInsta] Tweak settings gesture activated");
|
||||
|
||||
[SCIUtils showSettingsVC:[self window]];
|
||||
}
|
||||
%end
|
||||
|
||||
// Quick access to tweak settings by holding on home tab button
|
||||
%hook IGTabBarButton
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
// Only work on home/feed tab
|
||||
if (![self.accessibilityIdentifier isEqualToString:@"mainfeed-tab"]) return;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"settings_shortcut"]) {
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = 0.3;
|
||||
|
||||
// Take precidence over existing gesture recognizers
|
||||
for (UIGestureRecognizer *existing in self.gestureRecognizers) {
|
||||
[existing requireGestureRecognizerToFail:longPress];
|
||||
}
|
||||
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
}
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
[SCIUtils showSettingsVC:[self window]];
|
||||
}
|
||||
%end
|
||||
@@ -1,38 +0,0 @@
|
||||
#import "../../InstagramHeaders.h"
|
||||
#import "../../Utils.h"
|
||||
|
||||
%hook IGImageWithAccessoryButton
|
||||
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
[self addLongPressGestureRecognizer];
|
||||
}
|
||||
|
||||
%new - (void)addLongPressGestureRecognizer {
|
||||
BOOL hasLongPress = [self.gestureRecognizers filteredArrayUsingPredicate:
|
||||
[NSPredicate predicateWithBlock:^BOOL(NSObject *item, NSDictionary *_) {
|
||||
return [item isKindOfClass:[UILongPressGestureRecognizer class]];
|
||||
}]
|
||||
].count > 0;
|
||||
|
||||
if (!hasLongPress) {
|
||||
NSLog(@"[SCInsta] Adding teen app icons long press gesture recognizer");
|
||||
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
}
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"teen_app_icons"]) {
|
||||
IGHomeFeedHeaderViewController *homeFeedHeaderVC = [SCIUtils nearestViewControllerForView:self];
|
||||
|
||||
if (homeFeedHeaderVC != nil) {
|
||||
[homeFeedHeaderVC headerDidLongPressLogo:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
%end
|
||||
@@ -1,703 +0,0 @@
|
||||
#import "../../InstagramHeaders.h"
|
||||
#import "../../Utils.h"
|
||||
#import "../../Downloader/Download.h"
|
||||
#import <objc/runtime.h>
|
||||
|
||||
static SCIDownloadDelegate *imageDownloadDelegate;
|
||||
static SCIDownloadDelegate *videoDownloadDelegate;
|
||||
|
||||
static DownloadAction sciGetDownloadAction() {
|
||||
NSString *method = [SCIUtils getStringPref:@"dw_save_action"];
|
||||
if ([method isEqualToString:@"photos"]) return saveToPhotos;
|
||||
return share;
|
||||
}
|
||||
|
||||
static void initDownloaders () {
|
||||
// Re-init each time to pick up the current save action preference
|
||||
DownloadAction action = sciGetDownloadAction();
|
||||
DownloadAction imgAction = (action == saveToPhotos) ? saveToPhotos : quickLook;
|
||||
imageDownloadDelegate = [[SCIDownloadDelegate alloc] initWithAction:imgAction showProgress:NO];
|
||||
videoDownloadDelegate = [[SCIDownloadDelegate alloc] initWithAction:action showProgress:YES];
|
||||
}
|
||||
|
||||
// Helper: run a download block with optional confirmation dialog
|
||||
static void sciConfirmAndDownload(NSString *title, void(^downloadBlock)(void)) {
|
||||
if ([SCIUtils getBoolPref:@"dw_confirm"]) {
|
||||
[SCIUtils showConfirmation:downloadBlock title:title];
|
||||
} else {
|
||||
downloadBlock();
|
||||
}
|
||||
}
|
||||
|
||||
// Helper: recursively search within a view tree for downloadable media (bounded to one post)
|
||||
static BOOL sciFindAndDownloadMediaInView(UIView *root) {
|
||||
if (!root) return NO;
|
||||
|
||||
// Check for video media via mediaCellFeedItem
|
||||
if ([root respondsToSelector:@selector(mediaCellFeedItem)]) {
|
||||
IGMedia *media = [root performSelector:@selector(mediaCellFeedItem)];
|
||||
if (media) {
|
||||
NSURL *videoUrl = [SCIUtils getVideoUrlForMedia:media];
|
||||
if (videoUrl) {
|
||||
initDownloaders();
|
||||
[videoDownloadDelegate downloadFileWithURL:videoUrl fileExtension:[[videoUrl lastPathComponent] pathExtension] hudLabel:nil];
|
||||
return YES;
|
||||
}
|
||||
NSURL *photoUrl = [SCIUtils getPhotoUrlForMedia:media];
|
||||
if (photoUrl) {
|
||||
initDownloaders();
|
||||
[imageDownloadDelegate downloadFileWithURL:photoUrl fileExtension:[[photoUrl lastPathComponent] pathExtension] hudLabel:nil];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check for IGFeedPhotoView with delegate chain
|
||||
if ([root isKindOfClass:NSClassFromString(@"IGFeedPhotoView")] && [root respondsToSelector:@selector(delegate)]) {
|
||||
id delegate = [root performSelector:@selector(delegate)];
|
||||
if ([delegate isKindOfClass:NSClassFromString(@"IGFeedItemPhotoCell")]) {
|
||||
@try {
|
||||
Ivar cfgIvar = class_getInstanceVariable([delegate class], "_configuration");
|
||||
if (cfgIvar) {
|
||||
id cfg = object_getIvar(delegate, cfgIvar);
|
||||
if (cfg) {
|
||||
Ivar photoIvar = class_getInstanceVariable([cfg class], "_photo");
|
||||
if (photoIvar) {
|
||||
IGPhoto *photo = object_getIvar(cfg, photoIvar);
|
||||
NSURL *photoUrl = [SCIUtils getPhotoUrl:photo];
|
||||
if (photoUrl) {
|
||||
initDownloaders();
|
||||
[imageDownloadDelegate downloadFileWithURL:photoUrl fileExtension:[[photoUrl lastPathComponent] pathExtension] hudLabel:nil];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} @catch (NSException *e) {}
|
||||
}
|
||||
if ([delegate isKindOfClass:NSClassFromString(@"IGFeedItemPagePhotoCell")]) {
|
||||
@try {
|
||||
if ([delegate respondsToSelector:@selector(pagePhotoPost)]) {
|
||||
id pagePhotoPost = [delegate performSelector:@selector(pagePhotoPost)];
|
||||
if (pagePhotoPost && [pagePhotoPost respondsToSelector:@selector(photo)]) {
|
||||
IGPhoto *photo = [pagePhotoPost performSelector:@selector(photo)];
|
||||
NSURL *photoUrl = [SCIUtils getPhotoUrl:photo];
|
||||
if (photoUrl) {
|
||||
initDownloaders();
|
||||
[imageDownloadDelegate downloadFileWithURL:photoUrl fileExtension:[[photoUrl lastPathComponent] pathExtension] hudLabel:nil];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
} @catch (NSException *e) {}
|
||||
}
|
||||
}
|
||||
|
||||
// Recurse into subviews
|
||||
for (UIView *sub in root.subviews) {
|
||||
if (sciFindAndDownloadMediaInView(sub)) return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
// Helper: find IGMedia from a cell using runtime ivar scanning
|
||||
// Avoids property getters which can cause EXC_BAD_ACCESS on certain IG versions
|
||||
static IGMedia * _Nullable sciGetMediaFromView(UIView *view) {
|
||||
if (!view) return nil;
|
||||
|
||||
unsigned int ivarCount = 0;
|
||||
Ivar *ivars = class_copyIvarList([view class], &ivarCount);
|
||||
if (!ivars) return nil;
|
||||
|
||||
IGMedia *found = nil;
|
||||
Class mediaClass = NSClassFromString(@"IGMedia");
|
||||
|
||||
for (unsigned int i = 0; i < ivarCount; i++) {
|
||||
const char *name = ivar_getName(ivars[i]);
|
||||
if (!name) continue;
|
||||
|
||||
NSString *ivarName = [NSString stringWithUTF8String:name];
|
||||
NSString *lower = [ivarName lowercaseString];
|
||||
|
||||
if ([lower containsString:@"video"] || [lower containsString:@"media"] || [lower containsString:@"item"]) {
|
||||
id value = object_getIvar(view, ivars[i]);
|
||||
if (value && mediaClass && [value isKindOfClass:mediaClass]) {
|
||||
found = (IGMedia *)value;
|
||||
NSLog(@"[SCInsta] Found IGMedia in ivar '%@' of %@", ivarName, NSStringFromClass([view class]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(ivars);
|
||||
return found;
|
||||
}
|
||||
|
||||
// Helper: walk superview chain to find a view of a given class
|
||||
static UIView * _Nullable sciFindSuperviewOfClass(UIView *view, NSString *className) {
|
||||
Class cls = NSClassFromString(className);
|
||||
if (!cls) return nil;
|
||||
UIView *current = view.superview;
|
||||
int depth = 0;
|
||||
while (current && depth < 15) {
|
||||
if ([current isKindOfClass:cls]) return current;
|
||||
current = current.superview;
|
||||
depth++;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Helper: show debug ivar dump when media extraction fails (survives IG updates)
|
||||
static void sciShowDebugIvarDump(UIView *cell) {
|
||||
NSMutableString *debug = [NSMutableString stringWithFormat:@"No IGMedia found in %@\n\nIvars:\n", NSStringFromClass([cell class])];
|
||||
unsigned int count = 0;
|
||||
Ivar *ivars = class_copyIvarList([cell class], &count);
|
||||
for (unsigned int i = 0; i < count && i < 50; i++) {
|
||||
const char *name = ivar_getName(ivars[i]);
|
||||
const char *type = ivar_getTypeEncoding(ivars[i]);
|
||||
if (name) [debug appendFormat:@"%s (%s)\n", name, type ? type : "?"];
|
||||
}
|
||||
if (ivars) free(ivars);
|
||||
|
||||
NSLog(@"[SCInsta] Debug: %@", debug);
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"RyukGram Debug"
|
||||
message:debug
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"Copy & Close" style:UIAlertActionStyleDefault handler:^(UIAlertAction *a) {
|
||||
[[UIPasteboard generalPasteboard] setString:debug];
|
||||
}]];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"Close" style:UIAlertActionStyleCancel handler:nil]];
|
||||
UIViewController *topVC = topMostController();
|
||||
if (topVC) [topVC presentViewController:alert animated:YES completion:nil];
|
||||
});
|
||||
}
|
||||
|
||||
// Whether download buttons (not long-press) are enabled
|
||||
static BOOL sciUseDownloadButtons() {
|
||||
return [[SCIUtils getStringPref:@"dw_method"] isEqualToString:@"button"];
|
||||
}
|
||||
|
||||
|
||||
/* * Feed * */
|
||||
|
||||
// Download feed images
|
||||
%hook IGFeedPhotoView
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
if (![SCIUtils getBoolPref:@"dw_feed_posts"]) return;
|
||||
|
||||
if (sciUseDownloadButtons()) {
|
||||
[self sciAddDownloadButton];
|
||||
} else {
|
||||
[self addLongPressGestureRecognizer];
|
||||
}
|
||||
}
|
||||
%new - (void)sciAddDownloadButton {
|
||||
if ([self viewWithTag:1338]) return;
|
||||
|
||||
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
btn.tag = 1338;
|
||||
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:13 weight:UIImageSymbolWeightSemibold];
|
||||
[btn setImage:[UIImage systemImageNamed:@"arrow.down.to.line" withConfiguration:config] forState:UIControlStateNormal];
|
||||
btn.tintColor = [UIColor whiteColor];
|
||||
btn.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.4];
|
||||
btn.layer.cornerRadius = 12;
|
||||
btn.clipsToBounds = YES;
|
||||
btn.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[btn addTarget:self action:@selector(sciDownloadBtnTapped:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self addSubview:btn];
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[
|
||||
[btn.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:10],
|
||||
[btn.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-10],
|
||||
[btn.widthAnchor constraintEqualToConstant:24],
|
||||
[btn.heightAnchor constraintEqualToConstant:24]
|
||||
]];
|
||||
}
|
||||
%new - (void)sciDownloadBtnTapped:(UIButton *)sender {
|
||||
UIImpactFeedbackGenerator *haptic = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium];
|
||||
[haptic impactOccurred];
|
||||
[UIView animateWithDuration:0.1 animations:^{ sender.transform = CGAffineTransformMakeScale(0.75, 0.75); }
|
||||
completion:^(BOOL f) { [UIView animateWithDuration:0.1 animations:^{ sender.transform = CGAffineTransformIdentity; }]; }];
|
||||
|
||||
sciConfirmAndDownload(@"Download photo?", ^{
|
||||
[self handleLongPress:nil];
|
||||
});
|
||||
}
|
||||
%new - (void)addLongPressGestureRecognizer {
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = [SCIUtils getDoublePref:@"dw_finger_duration"];
|
||||
longPress.numberOfTouchesRequired = [SCIUtils getDoublePref:@"dw_finger_count"];
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender && sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
IGPhoto *photo;
|
||||
|
||||
if ([self.delegate isKindOfClass:%c(IGFeedItemPhotoCell)]) {
|
||||
IGFeedItemPhotoCellConfiguration *_configuration = MSHookIvar<IGFeedItemPhotoCellConfiguration *>(self.delegate, "_configuration");
|
||||
if (!_configuration) return;
|
||||
photo = MSHookIvar<IGPhoto *>(_configuration, "_photo");
|
||||
}
|
||||
else if ([self.delegate isKindOfClass:%c(IGFeedItemPagePhotoCell)]) {
|
||||
IGFeedItemPagePhotoCell *pagePhotoCell = self.delegate;
|
||||
photo = pagePhotoCell.pagePhotoPost.photo;
|
||||
}
|
||||
|
||||
NSURL *photoUrl = [SCIUtils getPhotoUrl:photo];
|
||||
if (!photoUrl) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not extract photo url from post"];
|
||||
return;
|
||||
}
|
||||
|
||||
initDownloaders();
|
||||
[imageDownloadDelegate downloadFileWithURL:photoUrl
|
||||
fileExtension:[[photoUrl lastPathComponent]pathExtension]
|
||||
hudLabel:nil];
|
||||
}
|
||||
%end
|
||||
|
||||
// Download feed videos
|
||||
%hook IGModernFeedVideoCell.IGModernFeedVideoCell
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
if (![SCIUtils getBoolPref:@"dw_feed_posts"]) return;
|
||||
|
||||
if (sciUseDownloadButtons()) {
|
||||
[self sciAddDownloadButton];
|
||||
} else {
|
||||
[self addLongPressGestureRecognizer];
|
||||
}
|
||||
}
|
||||
%new - (void)sciAddDownloadButton {
|
||||
UIView *selfView = (UIView *)self;
|
||||
if ([selfView viewWithTag:1338]) return;
|
||||
|
||||
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
btn.tag = 1338;
|
||||
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:13 weight:UIImageSymbolWeightSemibold];
|
||||
[btn setImage:[UIImage systemImageNamed:@"arrow.down.to.line" withConfiguration:config] forState:UIControlStateNormal];
|
||||
btn.tintColor = [UIColor whiteColor];
|
||||
btn.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.4];
|
||||
btn.layer.cornerRadius = 12;
|
||||
btn.clipsToBounds = YES;
|
||||
btn.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[btn addTarget:self action:@selector(sciDownloadBtnTapped:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[selfView addSubview:btn];
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[
|
||||
[btn.leadingAnchor constraintEqualToAnchor:selfView.leadingAnchor constant:10],
|
||||
[btn.bottomAnchor constraintEqualToAnchor:selfView.bottomAnchor constant:-10],
|
||||
[btn.widthAnchor constraintEqualToConstant:24],
|
||||
[btn.heightAnchor constraintEqualToConstant:24]
|
||||
]];
|
||||
}
|
||||
%new - (void)sciDownloadBtnTapped:(UIButton *)sender {
|
||||
UIImpactFeedbackGenerator *haptic = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium];
|
||||
[haptic impactOccurred];
|
||||
[UIView animateWithDuration:0.1 animations:^{ sender.transform = CGAffineTransformMakeScale(0.75, 0.75); }
|
||||
completion:^(BOOL f) { [UIView animateWithDuration:0.1 animations:^{ sender.transform = CGAffineTransformIdentity; }]; }];
|
||||
|
||||
sciConfirmAndDownload(@"Download video?", ^{
|
||||
[self handleLongPress:nil];
|
||||
});
|
||||
}
|
||||
%new - (void)addLongPressGestureRecognizer {
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = [SCIUtils getDoublePref:@"dw_finger_duration"];
|
||||
longPress.numberOfTouchesRequired = [SCIUtils getDoublePref:@"dw_finger_count"];
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender && sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
NSURL *videoUrl = [SCIUtils getVideoUrlForMedia:[self mediaCellFeedItem]];
|
||||
if (!videoUrl) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not extract video url from post"];
|
||||
return;
|
||||
}
|
||||
|
||||
initDownloaders();
|
||||
[videoDownloadDelegate downloadFileWithURL:videoUrl
|
||||
fileExtension:[[videoUrl lastPathComponent] pathExtension]
|
||||
hudLabel:nil];
|
||||
}
|
||||
%end
|
||||
|
||||
|
||||
|
||||
/* * Reels * */
|
||||
|
||||
// Download reels (photos) — long press only when gesture mode selected
|
||||
%hook IGSundialViewerPhotoView
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"dw_reels"] && !sciUseDownloadButtons()) {
|
||||
[self addLongPressGestureRecognizer];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
%new - (void)addLongPressGestureRecognizer {
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = [SCIUtils getDoublePref:@"dw_finger_duration"];
|
||||
longPress.numberOfTouchesRequired = [SCIUtils getDoublePref:@"dw_finger_count"];
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
@try {
|
||||
IGPhoto *_photo = nil;
|
||||
@try {
|
||||
_photo = MSHookIvar<IGPhoto *>(self, "_photo");
|
||||
} @catch (NSException *e) {}
|
||||
|
||||
if (!_photo) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not access reel photo"];
|
||||
return;
|
||||
}
|
||||
|
||||
NSURL *photoUrl = [SCIUtils getPhotoUrl:_photo];
|
||||
if (!photoUrl) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not extract photo url from reel"];
|
||||
return;
|
||||
}
|
||||
|
||||
initDownloaders();
|
||||
[imageDownloadDelegate downloadFileWithURL:photoUrl
|
||||
fileExtension:[[photoUrl lastPathComponent]pathExtension]
|
||||
hudLabel:nil];
|
||||
} @catch (NSException *exception) {
|
||||
NSLog(@"[SCInsta] Reel photo download error: %@", exception);
|
||||
[SCIUtils showErrorHUDWithDescription:[NSString stringWithFormat:@"Reel photo download failed: %@", exception.reason]];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Download reels (videos) — long press only when gesture mode selected
|
||||
%hook IGSundialViewerVideoCell
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"dw_reels"] && !sciUseDownloadButtons()) {
|
||||
[self addLongPressGestureRecognizer];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
%new - (void)addLongPressGestureRecognizer {
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = [SCIUtils getDoublePref:@"dw_finger_duration"];
|
||||
longPress.numberOfTouchesRequired = [SCIUtils getDoublePref:@"dw_finger_count"];
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
@try {
|
||||
IGMedia *media = sciGetMediaFromView(self);
|
||||
if (!media) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not access reel media"];
|
||||
return;
|
||||
}
|
||||
|
||||
NSURL *videoUrl = [SCIUtils getVideoUrlForMedia:media];
|
||||
if (!videoUrl) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not extract video url from reel"];
|
||||
return;
|
||||
}
|
||||
|
||||
initDownloaders();
|
||||
[videoDownloadDelegate downloadFileWithURL:videoUrl
|
||||
fileExtension:[[videoUrl lastPathComponent] pathExtension]
|
||||
hudLabel:nil];
|
||||
} @catch (NSException *exception) {
|
||||
NSLog(@"[SCInsta] Reel download error: %@", exception);
|
||||
[SCIUtils showErrorHUDWithDescription:[NSString stringWithFormat:@"Reel download failed: %@", exception.reason]];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Download button on reels vertical UFI (like/comment/share sidebar)
|
||||
%hook IGSundialViewerVerticalUFI
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
if (![SCIUtils getBoolPref:@"dw_reels"]) return;
|
||||
if (!sciUseDownloadButtons()) return;
|
||||
if (!self.superview) return;
|
||||
|
||||
// Add to superview so we're not clipped by the narrow 29pt UFI
|
||||
UIView *parent = self.superview;
|
||||
if ([parent viewWithTag:1337]) return;
|
||||
|
||||
UIButton *downloadBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
downloadBtn.tag = 1337;
|
||||
|
||||
// Match IG reel sidebar style: outline icon, semi-transparent white
|
||||
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:24 weight:UIImageSymbolWeightSemibold];
|
||||
UIImage *icon = [UIImage systemImageNamed:@"arrow.down" withConfiguration:config];
|
||||
[downloadBtn setImage:icon forState:UIControlStateNormal];
|
||||
downloadBtn.tintColor = [UIColor colorWithWhite:1.0 alpha:0.9];
|
||||
|
||||
downloadBtn.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
downloadBtn.layer.shadowOffset = CGSizeMake(0, 1);
|
||||
downloadBtn.layer.shadowOpacity = 0.5;
|
||||
downloadBtn.layer.shadowRadius = 3;
|
||||
|
||||
downloadBtn.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[downloadBtn addTarget:self action:@selector(sciDownloadTapped:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[parent addSubview:downloadBtn];
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[
|
||||
[downloadBtn.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
|
||||
[downloadBtn.bottomAnchor constraintEqualToAnchor:self.topAnchor constant:-10],
|
||||
[downloadBtn.widthAnchor constraintEqualToConstant:40],
|
||||
[downloadBtn.heightAnchor constraintEqualToConstant:40]
|
||||
]];
|
||||
}
|
||||
|
||||
%new - (void)sciDownloadTapped:(UIButton *)sender {
|
||||
NSLog(@"[SCInsta] Reel download button tapped");
|
||||
|
||||
// Haptic + visual feedback
|
||||
UIImpactFeedbackGenerator *haptic = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium];
|
||||
[haptic impactOccurred];
|
||||
[UIView animateWithDuration:0.1 animations:^{
|
||||
sender.transform = CGAffineTransformMakeScale(0.75, 0.75);
|
||||
} completion:^(BOOL finished) {
|
||||
[UIView animateWithDuration:0.1 animations:^{
|
||||
sender.transform = CGAffineTransformIdentity;
|
||||
}];
|
||||
}];
|
||||
|
||||
sciConfirmAndDownload(@"Download reel?", ^{
|
||||
// Find IGSundialViewerVideoCell in superview chain
|
||||
UIView *videoCell = sciFindSuperviewOfClass(self, @"IGSundialViewerVideoCell");
|
||||
|
||||
if (videoCell) {
|
||||
IGMedia *media = sciGetMediaFromView(videoCell);
|
||||
if (media) {
|
||||
NSURL *videoUrl = [SCIUtils getVideoUrlForMedia:media];
|
||||
if (videoUrl) {
|
||||
initDownloaders();
|
||||
[videoDownloadDelegate downloadFileWithURL:videoUrl
|
||||
fileExtension:[[videoUrl lastPathComponent] pathExtension]
|
||||
hudLabel:nil];
|
||||
return;
|
||||
}
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not extract video URL from reel"];
|
||||
return;
|
||||
}
|
||||
sciShowDebugIvarDump(videoCell);
|
||||
return;
|
||||
}
|
||||
|
||||
// Try photo reel
|
||||
UIView *photoView = sciFindSuperviewOfClass(self, @"IGSundialViewerPhotoView");
|
||||
if (photoView) {
|
||||
unsigned int count = 0;
|
||||
Ivar *ivars = class_copyIvarList([photoView class], &count);
|
||||
Class photoClass = NSClassFromString(@"IGPhoto");
|
||||
for (unsigned int i = 0; i < count; i++) {
|
||||
const char *name = ivar_getName(ivars[i]);
|
||||
if (!name) continue;
|
||||
NSString *ivarName = [NSString stringWithUTF8String:name];
|
||||
if ([[ivarName lowercaseString] containsString:@"photo"]) {
|
||||
id value = object_getIvar(photoView, ivars[i]);
|
||||
if (value && photoClass && [value isKindOfClass:photoClass]) {
|
||||
NSURL *photoUrl = [SCIUtils getPhotoUrl:(IGPhoto *)value];
|
||||
if (photoUrl) {
|
||||
free(ivars);
|
||||
initDownloaders();
|
||||
[imageDownloadDelegate downloadFileWithURL:photoUrl
|
||||
fileExtension:[[photoUrl lastPathComponent] pathExtension]
|
||||
hudLabel:nil];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ivars) free(ivars);
|
||||
sciShowDebugIvarDump(photoView);
|
||||
return;
|
||||
}
|
||||
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not find reel cell in view hierarchy"];
|
||||
});
|
||||
}
|
||||
%end
|
||||
|
||||
|
||||
/* * Stories * */
|
||||
|
||||
// Download story (images)
|
||||
%hook IGStoryPhotoView
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"dw_story"]) {
|
||||
[self addLongPressGestureRecognizer];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
%new - (void)addLongPressGestureRecognizer {
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = [SCIUtils getDoublePref:@"dw_finger_duration"];
|
||||
longPress.numberOfTouchesRequired = [SCIUtils getDoublePref:@"dw_finger_count"];
|
||||
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
NSURL *photoUrl = [SCIUtils getPhotoUrlForMedia:[self item]];
|
||||
if (!photoUrl) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not extract photo url from story"];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
initDownloaders();
|
||||
[imageDownloadDelegate downloadFileWithURL:photoUrl
|
||||
fileExtension:[[photoUrl lastPathComponent]pathExtension]
|
||||
hudLabel:nil];
|
||||
}
|
||||
%end
|
||||
|
||||
// Download story (videos)
|
||||
%hook IGStoryModernVideoView
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"dw_story"]) {
|
||||
[self addLongPressGestureRecognizer];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
%new - (void)addLongPressGestureRecognizer {
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = [SCIUtils getDoublePref:@"dw_finger_duration"];
|
||||
longPress.numberOfTouchesRequired = [SCIUtils getDoublePref:@"dw_finger_count"];
|
||||
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
NSURL *videoUrl = [SCIUtils getVideoUrlForMedia:self.item];
|
||||
|
||||
if (!videoUrl) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not extract video url from story"];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
initDownloaders();
|
||||
[videoDownloadDelegate downloadFileWithURL:videoUrl
|
||||
fileExtension:[[videoUrl lastPathComponent] pathExtension]
|
||||
hudLabel:nil];
|
||||
}
|
||||
%end
|
||||
|
||||
// Download story (videos, legacy)
|
||||
%hook IGStoryVideoView
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"dw_story"]) {
|
||||
[self addLongPressGestureRecognizer];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
%new - (void)addLongPressGestureRecognizer {
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = [SCIUtils getDoublePref:@"dw_finger_duration"];
|
||||
longPress.numberOfTouchesRequired = [SCIUtils getDoublePref:@"dw_finger_count"];
|
||||
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
NSURL *videoUrl;
|
||||
|
||||
IGStoryFullscreenSectionController *captionDelegate = self.captionDelegate;
|
||||
if (captionDelegate) {
|
||||
videoUrl = [SCIUtils getVideoUrlForMedia:captionDelegate.currentStoryItem];
|
||||
}
|
||||
else {
|
||||
// Direct messages video player
|
||||
id parentVC = [SCIUtils nearestViewControllerForView:self];
|
||||
if (!parentVC || ![parentVC isKindOfClass:%c(IGDirectVisualMessageViewerController)]) return;
|
||||
|
||||
IGDirectVisualMessageViewerViewModeAwareDataSource *_dataSource = MSHookIvar<IGDirectVisualMessageViewerViewModeAwareDataSource *>(parentVC, "_dataSource");
|
||||
if (!_dataSource) return;
|
||||
|
||||
IGDirectVisualMessage *_currentMessage = MSHookIvar<IGDirectVisualMessage *>(_dataSource, "_currentMessage");
|
||||
if (!_currentMessage) return;
|
||||
|
||||
IGVideo *rawVideo = _currentMessage.rawVideo;
|
||||
if (!rawVideo) return;
|
||||
|
||||
videoUrl = [SCIUtils getVideoUrl:rawVideo];
|
||||
}
|
||||
|
||||
if (!videoUrl) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not extract video url from story"];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
initDownloaders();
|
||||
[videoDownloadDelegate downloadFileWithURL:videoUrl
|
||||
fileExtension:[[videoUrl lastPathComponent] pathExtension]
|
||||
hudLabel:nil];
|
||||
}
|
||||
%end
|
||||
|
||||
|
||||
/* * Profile pictures * */
|
||||
|
||||
%hook IGProfilePictureImageView
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"save_profile"]) {
|
||||
[self addLongPressGestureRecognizer];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
%new - (void)addLongPressGestureRecognizer {
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
[self addGestureRecognizer:longPress];
|
||||
}
|
||||
%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
|
||||
if (sender.state != UIGestureRecognizerStateBegan) return;
|
||||
|
||||
IGImageView *_imageView = MSHookIvar<IGImageView *>(self, "_imageView");
|
||||
if (!_imageView) return;
|
||||
|
||||
IGImageSpecifier *imageSpecifier = _imageView.imageSpecifier;
|
||||
if (!imageSpecifier) return;
|
||||
|
||||
NSURL *imageUrl = imageSpecifier.url;
|
||||
if (!imageUrl) return;
|
||||
|
||||
initDownloaders();
|
||||
[imageDownloadDelegate downloadFileWithURL:imageUrl
|
||||
fileExtension:[[imageUrl lastPathComponent] pathExtension]
|
||||
hudLabel:@"Loading"];
|
||||
}
|
||||
%end
|
||||
@@ -1,322 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <substrate.h>
|
||||
|
||||
// When tap control is set to pause/play, these enhancements activate:
|
||||
// - Mute sub-toggle hidden (only play/pause icon visible)
|
||||
// - Audio forced on in reels tab
|
||||
// - Play/pause indicator hidden when video plays (fixes IG bug after hold/zoom)
|
||||
// - Playback toggle synced with overlay visibility during hold/zoom
|
||||
|
||||
static BOOL sciIsPausePlayMode() {
|
||||
return [[SCIUtils getStringPref:@"reels_tap_control"] isEqualToString:@"pause"];
|
||||
}
|
||||
|
||||
static BOOL sciIsInReelsTab = NO;
|
||||
static BOOL sciIsZooming = NO;
|
||||
|
||||
// ============ FIND PLAYBACK VIEW ============
|
||||
// Handles two IG A/B test variants:
|
||||
// 1. IGSundialPlaybackToggleView wrapper (contains play + mute subviews)
|
||||
// 2. Standalone IGDSMediaIconButton (no wrapper)
|
||||
|
||||
static UIView * _Nullable sciFindPlaybackView(UIView *videoCell) {
|
||||
if (!videoCell) return nil;
|
||||
Class toggleClass = objc_getClass("IGSundialPlaybackToggle.IGSundialPlaybackToggleView");
|
||||
Class iconBtnClass = NSClassFromString(@"IGDSMediaIconButton");
|
||||
UIView *fallbackIconBtn = nil;
|
||||
NSMutableArray *stack = [NSMutableArray arrayWithObject:videoCell];
|
||||
for (int d = 0; d < 6; d++) {
|
||||
NSMutableArray *next = [NSMutableArray array];
|
||||
for (UIView *v in stack) {
|
||||
for (UIView *sub in v.subviews) {
|
||||
if (toggleClass && [sub isKindOfClass:toggleClass]) return sub;
|
||||
if (iconBtnClass && [sub isKindOfClass:iconBtnClass] &&
|
||||
sub.frame.size.width > 50 && sub.frame.size.height > 50 &&
|
||||
!sub.hidden && sub.frame.origin.x > 100) {
|
||||
fallbackIconBtn = sub;
|
||||
}
|
||||
[next addObject:sub];
|
||||
}
|
||||
}
|
||||
stack = next;
|
||||
}
|
||||
return fallbackIconBtn;
|
||||
}
|
||||
|
||||
// ============ KVO: SYNC PLAYBACK VIEW WITH OVERLAY ============
|
||||
// IG animates the overlay container via Core Animation during hold/zoom.
|
||||
// The download button (tag 1337) is inside the container so it hides automatically.
|
||||
// The playback toggle is in a separate view branch — we KVO the download
|
||||
// button's layer.opacity and sync the toggle to match.
|
||||
|
||||
@interface SCIOpacityObserver : NSObject
|
||||
@end
|
||||
|
||||
@implementation SCIOpacityObserver
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
if (![keyPath isEqualToString:@"opacity"]) return;
|
||||
CGFloat opacity = [[change objectForKey:NSKeyValueChangeNewKey] floatValue];
|
||||
CALayer *layer = (CALayer *)object;
|
||||
UIView *dlBtn = (layer.delegate && [layer.delegate isKindOfClass:[UIView class]]) ? (UIView *)layer.delegate : nil;
|
||||
if (!dlBtn) return;
|
||||
UIView *videoCell = dlBtn.superview;
|
||||
while (videoCell && ![NSStringFromClass([videoCell class]) containsString:@"VideoCell"])
|
||||
videoCell = videoCell.superview;
|
||||
UIView *playView = sciFindPlaybackView(videoCell);
|
||||
// Skip during zoom — zoom callbacks handle the play button directly
|
||||
if (sciIsZooming) return;
|
||||
if (playView) playView.layer.opacity = opacity;
|
||||
}
|
||||
@end
|
||||
|
||||
static SCIOpacityObserver *sciObserver = nil;
|
||||
static NSHashTable *sciObservedLayers = nil;
|
||||
|
||||
static void sciSetupKVO(UIView *ufi) {
|
||||
UIView *parent = ufi.superview;
|
||||
if (!parent) return;
|
||||
UIView *dlBtn = [parent viewWithTag:1337];
|
||||
if (!dlBtn) return;
|
||||
if (!sciObserver) sciObserver = [[SCIOpacityObserver alloc] init];
|
||||
if (!sciObservedLayers) sciObservedLayers = [NSHashTable weakObjectsHashTable];
|
||||
if ([sciObservedLayers containsObject:dlBtn.layer]) return;
|
||||
[dlBtn.layer addObserver:sciObserver forKeyPath:@"opacity"
|
||||
options:NSKeyValueObservingOptionNew context:NULL];
|
||||
[sciObservedLayers addObject:dlBtn.layer];
|
||||
}
|
||||
|
||||
// ============ HIDE PLAY INDICATOR ON PLAY + ZOOM ============
|
||||
|
||||
// Use hidden for play/unpause (IG controls unhiding on next pause).
|
||||
// Use layer.opacity for zoom/KVO (we control restore).
|
||||
static void sciHidePlayView(id cell) {
|
||||
UIView *playView = sciFindPlaybackView(cell);
|
||||
if (playView) playView.hidden = YES;
|
||||
Ivar ivar = class_getInstanceVariable([cell class], "_playPauseMediaIndicator");
|
||||
if (ivar) {
|
||||
UIView *indicator = object_getIvar(cell, ivar);
|
||||
if (indicator) indicator.hidden = YES;
|
||||
}
|
||||
}
|
||||
|
||||
static void sciSetPlayViewOpacity(id cell, CGFloat opacity) {
|
||||
UIView *playView = sciFindPlaybackView(cell);
|
||||
if (playView) playView.layer.opacity = opacity;
|
||||
Ivar ivar = class_getInstanceVariable([cell class], "_playPauseMediaIndicator");
|
||||
if (ivar) {
|
||||
UIView *indicator = object_getIvar(cell, ivar);
|
||||
if (indicator) indicator.layer.opacity = opacity;
|
||||
}
|
||||
}
|
||||
|
||||
// Swallow IG's "no sound" toast and remember the media so we don't retry it.
|
||||
static NSString * const SCINoSoundToastText = @"This reel has no sound.";
|
||||
static BOOL sciSuppressNoSoundToast = NO;
|
||||
static BOOL sciSawNoSoundDuringUnmute = NO;
|
||||
static NSMutableSet<NSString *> *sciNoAudioMediaIds = nil;
|
||||
|
||||
static NSString *sciMediaIdFor(id media) {
|
||||
if (!media) return nil;
|
||||
for (NSString *k in @[@"pk", @"mediaPk", @"mediaID", @"mpk"]) {
|
||||
@try {
|
||||
id v = [media valueForKey:k];
|
||||
if (v) return [NSString stringWithFormat:@"%@", v];
|
||||
} @catch (__unused id e) {}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
static void sciForceUnmuteCell(id videoCell) {
|
||||
if (!videoCell) return;
|
||||
Ivar delegateIvar = class_getInstanceVariable([videoCell class], "_delegate");
|
||||
if (!delegateIvar) return;
|
||||
id sectionCtrl = object_getIvar(videoCell, delegateIvar);
|
||||
if (!sectionCtrl) return;
|
||||
|
||||
Ivar mediaIvar = class_getInstanceVariable([sectionCtrl class], "_media");
|
||||
id media = mediaIvar ? object_getIvar(sectionCtrl, mediaIvar) : nil;
|
||||
NSString *mediaId = sciMediaIdFor(media);
|
||||
if (mediaId && [sciNoAudioMediaIds containsObject:mediaId]) return;
|
||||
|
||||
SEL isAudioSel = NSSelectorFromString(@"isAudioEnabled");
|
||||
if (![sectionCtrl respondsToSelector:isAudioSel]) return;
|
||||
BOOL audioOn = ((BOOL(*)(id,SEL))objc_msgSend)(sectionCtrl, isAudioSel);
|
||||
if (audioOn) return;
|
||||
|
||||
SEL tapSel = NSSelectorFromString(@"_didTapSoundButton");
|
||||
if (![sectionCtrl respondsToSelector:tapSel]) return;
|
||||
|
||||
sciSuppressNoSoundToast = YES;
|
||||
sciSawNoSoundDuringUnmute = NO;
|
||||
((void(*)(id,SEL))objc_msgSend)(sectionCtrl, tapSel);
|
||||
sciSuppressNoSoundToast = NO;
|
||||
|
||||
if (sciSawNoSoundDuringUnmute && mediaId) {
|
||||
if (!sciNoAudioMediaIds) sciNoAudioMediaIds = [NSMutableSet new];
|
||||
[sciNoAudioMediaIds addObject:mediaId];
|
||||
}
|
||||
}
|
||||
|
||||
%hook IGSundialViewerVideoCell
|
||||
// hidden=YES on play; IG resets it on the next pause.
|
||||
- (void)sundialVideoPlaybackViewDidStartPlaying:(id)view {
|
||||
%orig;
|
||||
if (sciIsPausePlayMode()) {
|
||||
sciHidePlayView(self);
|
||||
if (sciIsInReelsTab) sciForceUnmuteCell(self);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)videoViewDidUnpause:(id)view {
|
||||
%orig;
|
||||
if (sciIsPausePlayMode()) sciHidePlayView(self);
|
||||
}
|
||||
|
||||
// Zoom — use layer.opacity (we restore it ourselves on zoom end)
|
||||
- (void)sundialVideoPlaybackView:(id)pbView willBeginZoomInteractionForView:(id)view withLogging:(id)logging {
|
||||
%orig;
|
||||
sciIsZooming = YES;
|
||||
if (sciIsPausePlayMode()) sciSetPlayViewOpacity(self, 0);
|
||||
}
|
||||
|
||||
- (void)sundialVideoPlaybackView:(id)pbView didEndZoomInteractionForView:(id)view withLogging:(id)logging minScale:(CGFloat)minScale {
|
||||
%orig;
|
||||
sciIsZooming = NO;
|
||||
if (sciIsPausePlayMode()) {
|
||||
sciSetPlayViewOpacity(self, 1);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
BOOL playing = [self respondsToSelector:@selector(isPlaying)] ?
|
||||
((BOOL(*)(id,SEL))objc_msgSend)(self, @selector(isPlaying)) : NO;
|
||||
if (playing) sciHidePlayView(self);
|
||||
});
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// ============ UFI: SYNC DOWNLOAD BUTTON + SETUP KVO ============
|
||||
|
||||
%hook IGSundialViewerVerticalUFI
|
||||
- (void)setAlpha:(CGFloat)alpha {
|
||||
%orig;
|
||||
UIView *parent = self.superview;
|
||||
if (!parent) return;
|
||||
UIView *dlBtn = [parent viewWithTag:1337];
|
||||
if (dlBtn) dlBtn.alpha = alpha;
|
||||
sciSetupKVO(self);
|
||||
}
|
||||
%end
|
||||
|
||||
// ============ HIDE MUTE SUBVIEW IN PLAYBACK TOGGLE ============
|
||||
// When pause/play mode is active, hide the mute sub-toggle (top subview)
|
||||
// and keep only the play/pause button visible.
|
||||
|
||||
static void (*orig_playbackToggle_didMoveToSuperview)(id self, SEL _cmd);
|
||||
static void (*orig_playbackToggle_layoutSubviews)(id self, SEL _cmd);
|
||||
|
||||
static void sciHideMuteSubview(UIView *toggleView) {
|
||||
if (!sciIsPausePlayMode()) {
|
||||
for (UIView *sub in toggleView.subviews) {
|
||||
if (sub.tag == 9999) {
|
||||
sub.hidden = NO; sub.alpha = 1; sub.userInteractionEnabled = YES; sub.tag = 0;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
NSArray *subs = toggleView.subviews;
|
||||
if (subs.count < 2) return;
|
||||
UIView *topView = nil;
|
||||
CGFloat minY = CGFLOAT_MAX;
|
||||
int visibleCount = 0;
|
||||
for (UIView *sub in subs) {
|
||||
if (sub.frame.size.width < 1 || sub.frame.size.height < 1) continue;
|
||||
visibleCount++;
|
||||
if (sub.frame.origin.y < minY) { minY = sub.frame.origin.y; topView = sub; }
|
||||
}
|
||||
if (topView && visibleCount >= 2) {
|
||||
topView.hidden = YES; topView.alpha = 0; topView.userInteractionEnabled = NO; topView.tag = 9999;
|
||||
}
|
||||
}
|
||||
|
||||
static void new_playbackToggle_didMoveToSuperview(id self, SEL _cmd) {
|
||||
orig_playbackToggle_didMoveToSuperview(self, _cmd);
|
||||
sciHideMuteSubview((UIView *)self);
|
||||
}
|
||||
static void new_playbackToggle_layoutSubviews(id self, SEL _cmd) {
|
||||
orig_playbackToggle_layoutSubviews(self, _cmd);
|
||||
sciHideMuteSubview((UIView *)self);
|
||||
}
|
||||
|
||||
// ============ FORCE AUDIO IN REELS TAB ============
|
||||
|
||||
%hook IGSundialFeedViewController
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
%orig;
|
||||
sciIsInReelsTab = YES;
|
||||
// Retry-until-ready: the first reel's cell may not be wired up yet.
|
||||
if (sciIsPausePlayMode()) {
|
||||
id feedVC = self;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((0.1 + i * 0.15) * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
if (!sciIsInReelsTab) return;
|
||||
SEL sel = NSSelectorFromString(@"_currentAudioCell");
|
||||
if (![feedVC respondsToSelector:sel]) return;
|
||||
id cell = ((id(*)(id,SEL))objc_msgSend)(feedVC, sel);
|
||||
if (cell) sciForceUnmuteCell(cell);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
%orig;
|
||||
sciIsInReelsTab = NO;
|
||||
}
|
||||
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
|
||||
%orig;
|
||||
if (sciIsPausePlayMode() && sciIsInReelsTab) {
|
||||
SEL sel = NSSelectorFromString(@"_currentAudioCell");
|
||||
if ([self respondsToSelector:sel]) {
|
||||
id cell = ((id(*)(id,SEL))objc_msgSend)(self, sel);
|
||||
if (cell) sciForceUnmuteCell(cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
%hook UILabel
|
||||
- (void)setText:(NSString *)text {
|
||||
if (sciSuppressNoSoundToast && [text isEqualToString:SCINoSoundToastText]) {
|
||||
sciSawNoSoundDuringUnmute = YES;
|
||||
%orig(@"");
|
||||
self.hidden = YES;
|
||||
// Container view is attached to a window after we return — detach the
|
||||
// topmost non-window ancestor on the next tick to remove the outline.
|
||||
__weak UILabel *weakSelf = self;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
UILabel *s = weakSelf;
|
||||
if (!s) return;
|
||||
UIView *top = s;
|
||||
while (top.superview && ![top.superview isKindOfClass:[UIWindow class]]) {
|
||||
top = top.superview;
|
||||
}
|
||||
[top removeFromSuperview];
|
||||
});
|
||||
return;
|
||||
}
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// ============ RUNTIME HOOKS ============
|
||||
|
||||
%ctor {
|
||||
Class toggleClass = objc_getClass("IGSundialPlaybackToggle.IGSundialPlaybackToggleView");
|
||||
if (toggleClass) {
|
||||
MSHookMessageEx(toggleClass, @selector(didMoveToSuperview),
|
||||
(IMP)new_playbackToggle_didMoveToSuperview, (IMP *)&orig_playbackToggle_didMoveToSuperview);
|
||||
MSHookMessageEx(toggleClass, @selector(layoutSubviews),
|
||||
(IMP)new_playbackToggle_layoutSubviews, (IMP *)&orig_playbackToggle_layoutSubviews);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
%hook IGSundialViewerNavigationBarOld
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
|
||||
if ([SCIUtils getBoolPref:@"hide_reels_header"]) {
|
||||
NSLog(@"[SCInsta] Hiding reels header");
|
||||
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
}
|
||||
%end
|
||||
@@ -1,189 +0,0 @@
|
||||
#import "../../InstagramHeaders.h"
|
||||
#import "../../Utils.h"
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
|
||||
// Password-locked reels use IGMediaOverlayProfileWithPasswordView as a blur overlay.
|
||||
// The password is stored in the _asnwer ivar (IG typo). We read it at runtime,
|
||||
// then provide buttons to auto-fill + submit or reveal + copy the password.
|
||||
|
||||
#define SCI_PW_BTN_TAG 1342
|
||||
|
||||
static NSString * _Nullable sciGetPassword(id overlayView) {
|
||||
Class cls = [overlayView class];
|
||||
while (cls && cls != [UIView class]) {
|
||||
unsigned int count = 0;
|
||||
Ivar *ivars = class_copyIvarList(cls, &count);
|
||||
for (unsigned int i = 0; i < count; i++) {
|
||||
const char *name = ivar_getName(ivars[i]);
|
||||
if (name && strcmp(name, "_asnwer") == 0) {
|
||||
id value = object_getIvar(overlayView, ivars[i]);
|
||||
free(ivars);
|
||||
if ([value isKindOfClass:[NSString class]] && [(NSString *)value length] > 0)
|
||||
return (NSString *)value;
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
if (ivars) free(ivars);
|
||||
cls = class_getSuperclass(cls);
|
||||
}
|
||||
|
||||
// Fallback: scan for any password-related string ivar
|
||||
cls = [overlayView class];
|
||||
while (cls && cls != [UIView class]) {
|
||||
unsigned int count = 0;
|
||||
Ivar *ivars = class_copyIvarList(cls, &count);
|
||||
for (unsigned int i = 0; i < count; i++) {
|
||||
const char *type = ivar_getTypeEncoding(ivars[i]);
|
||||
if (!type || type[0] != '@') continue;
|
||||
@try {
|
||||
id value = object_getIvar(overlayView, ivars[i]);
|
||||
if (![value isKindOfClass:[NSString class]] || [(NSString *)value length] == 0) continue;
|
||||
const char *name = ivar_getName(ivars[i]);
|
||||
if (!name) continue;
|
||||
NSString *lower = [[NSString stringWithUTF8String:name] lowercaseString];
|
||||
if ([lower containsString:@"answer"] || [lower containsString:@"asnwer"] ||
|
||||
[lower containsString:@"password"] || [lower containsString:@"secret"]) {
|
||||
free(ivars);
|
||||
return (NSString *)value;
|
||||
}
|
||||
} @catch(id e) {}
|
||||
}
|
||||
if (ivars) free(ivars);
|
||||
cls = class_getSuperclass(cls);
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
static UITextField * _Nullable sciFindTextField(UIView *root) {
|
||||
NSMutableArray *stack = [NSMutableArray arrayWithObject:root];
|
||||
while (stack.count > 0) {
|
||||
UIView *v = stack.lastObject;
|
||||
[stack removeLastObject];
|
||||
if ([v isKindOfClass:[UITextField class]]) return (UITextField *)v;
|
||||
for (UIView *sub in v.subviews) [stack addObject:sub];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
static UIView * _Nullable sciFindSubmitButton(UIView *root) {
|
||||
NSMutableArray *stack = [NSMutableArray arrayWithObject:root];
|
||||
while (stack.count > 0) {
|
||||
UIView *v = stack.lastObject;
|
||||
[stack removeLastObject];
|
||||
if ([NSStringFromClass([v class]) containsString:@"IGDSMediaTextButton"]) return v;
|
||||
for (UIView *sub in v.subviews) [stack addObject:sub];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
%hook IGMediaOverlayProfileWithPasswordView
|
||||
|
||||
- (void)didMoveToSuperview {
|
||||
%orig;
|
||||
if (!self.superview) return;
|
||||
if (![SCIUtils getBoolPref:@"unlock_password_reels"]) return;
|
||||
[self sciAddButtons];
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
%orig;
|
||||
if (![SCIUtils getBoolPref:@"unlock_password_reels"]) return;
|
||||
[self sciAddButtons];
|
||||
}
|
||||
|
||||
%new - (void)sciAddButtons {
|
||||
if ([self viewWithTag:SCI_PW_BTN_TAG]) return;
|
||||
|
||||
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:18 weight:UIImageSymbolWeightBold];
|
||||
|
||||
UIButton *unlockBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
unlockBtn.tag = SCI_PW_BTN_TAG;
|
||||
[unlockBtn setImage:[UIImage systemImageNamed:@"lock.open.fill" withConfiguration:config] forState:UIControlStateNormal];
|
||||
unlockBtn.tintColor = [UIColor colorWithRed:1.0 green:0.85 blue:0.0 alpha:1.0];
|
||||
unlockBtn.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.5];
|
||||
unlockBtn.layer.cornerRadius = 20;
|
||||
unlockBtn.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[unlockBtn addTarget:self action:@selector(sciUnlockTapped) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self addSubview:unlockBtn];
|
||||
|
||||
UIButton *eyeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
eyeBtn.tag = SCI_PW_BTN_TAG + 1;
|
||||
[eyeBtn setImage:[UIImage systemImageNamed:@"eye.fill" withConfiguration:config] forState:UIControlStateNormal];
|
||||
eyeBtn.tintColor = [UIColor whiteColor];
|
||||
eyeBtn.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.5];
|
||||
eyeBtn.layer.cornerRadius = 20;
|
||||
eyeBtn.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[eyeBtn addTarget:self action:@selector(sciShowPasswordTapped) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self addSubview:eyeBtn];
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[
|
||||
[unlockBtn.topAnchor constraintEqualToAnchor:self.safeAreaLayoutGuide.topAnchor constant:200],
|
||||
[unlockBtn.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-16],
|
||||
[unlockBtn.widthAnchor constraintEqualToConstant:40],
|
||||
[unlockBtn.heightAnchor constraintEqualToConstant:40],
|
||||
|
||||
[eyeBtn.topAnchor constraintEqualToAnchor:unlockBtn.bottomAnchor constant:12],
|
||||
[eyeBtn.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-16],
|
||||
[eyeBtn.widthAnchor constraintEqualToConstant:40],
|
||||
[eyeBtn.heightAnchor constraintEqualToConstant:40],
|
||||
]];
|
||||
}
|
||||
|
||||
%new - (void)sciUnlockTapped {
|
||||
UIImpactFeedbackGenerator *haptic = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium];
|
||||
[haptic impactOccurred];
|
||||
|
||||
NSString *password = sciGetPassword(self);
|
||||
if (!password) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"No password found"];
|
||||
return;
|
||||
}
|
||||
|
||||
UITextField *textField = sciFindTextField(self);
|
||||
if (!textField) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"No text field found"];
|
||||
return;
|
||||
}
|
||||
|
||||
textField.text = password;
|
||||
[textField sendActionsForControlEvents:UIControlEventEditingChanged];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:UITextFieldTextDidChangeNotification object:textField];
|
||||
|
||||
if (textField.delegate) {
|
||||
if ([textField.delegate respondsToSelector:@selector(textField:shouldChangeCharactersInRange:replacementString:)])
|
||||
[textField.delegate textField:textField shouldChangeCharactersInRange:NSMakeRange(0, 0) replacementString:password];
|
||||
if ([textField.delegate respondsToSelector:@selector(textFieldDidChangeSelection:)])
|
||||
[textField.delegate textFieldDidChangeSelection:textField];
|
||||
}
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
UIView *submitBtn = sciFindSubmitButton(self);
|
||||
if (submitBtn && [submitBtn isKindOfClass:[UIControl class]]) {
|
||||
[(UIControl *)submitBtn setHidden:NO];
|
||||
[(UIControl *)submitBtn sendActionsForControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
%new - (void)sciShowPasswordTapped {
|
||||
UIImpactFeedbackGenerator *haptic = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleLight];
|
||||
[haptic impactOccurred];
|
||||
|
||||
NSString *password = sciGetPassword(self);
|
||||
if (!password) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"No password found"];
|
||||
return;
|
||||
}
|
||||
|
||||
[[UIPasteboard generalPasteboard] setString:password];
|
||||
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Password"
|
||||
message:password
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"Copied!" style:UIAlertActionStyleCancel handler:nil]];
|
||||
UIViewController *topVC = topMostController();
|
||||
if (topVC) [topVC presentViewController:alert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
%end
|
||||
@@ -1,103 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
%hook IGSundialPlaybackControlsTestConfiguration
|
||||
- (id)initWithLauncherSet:(id)set
|
||||
tapToPauseEnabled:(_Bool)tapPauseEnabled
|
||||
combineSingleTapPlaybackControls:(_Bool)controls
|
||||
isVideoPreviewThumbnailEnabled:(_Bool)previewThumbEnabled
|
||||
minScrubberDurationSec:(long long)minSec
|
||||
seekResumeScrubberCooldownSec:(double)seekSec
|
||||
tapResumeScrubberCooldownSec:(double)tapSec
|
||||
persistentScrubberMinVideoDuration:(long long)duration
|
||||
isScrubberForShortVideoEnabled:(_Bool)shortScrubberEnabled
|
||||
{
|
||||
_Bool userTapPauseEnabled = tapPauseEnabled;
|
||||
if ([[SCIUtils getStringPref:@"reels_tap_control"] isEqualToString:@"pause"]) userTapPauseEnabled = true;
|
||||
else if ([[SCIUtils getStringPref:@"reels_tap_control"] isEqualToString:@"mute"]) userTapPauseEnabled = false;
|
||||
|
||||
long long userMinSec = minSec;
|
||||
long long userDuration = duration;
|
||||
_Bool userShortScrubberEnabled = shortScrubberEnabled;
|
||||
if ([SCIUtils getBoolPref:@"reels_show_scrubber"]) {
|
||||
userMinSec = 0;
|
||||
userDuration = 0;
|
||||
userShortScrubberEnabled = true;
|
||||
}
|
||||
|
||||
return %orig(set, userTapPauseEnabled, controls, previewThumbEnabled, userMinSec, seekSec, tapSec, userDuration, userShortScrubberEnabled);
|
||||
}
|
||||
%end
|
||||
|
||||
static BOOL sciReelRefreshBypassing = NO;
|
||||
|
||||
%hook IGSundialFeedViewController
|
||||
- (void)_refreshReelsWithParamsForNetworkRequest:(NSInteger)arg1 userDidPullToRefresh:(BOOL)arg2 {
|
||||
if ([SCIUtils getBoolPref:@"prevent_doom_scrolling"]) {
|
||||
IGRefreshControl *rc = MSHookIvar<IGRefreshControl *>(self, "_refreshControl");
|
||||
[self refreshControlDidEndFinishLoadingAnimation:rc];
|
||||
return;
|
||||
}
|
||||
|
||||
if (![(UIViewController *)self isViewLoaded] || sciReelRefreshBypassing || ![SCIUtils getBoolPref:@"refresh_reel_confirm"]) {
|
||||
%orig(arg1, arg2);
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset the refresh control state so pull-to-refresh can trigger again
|
||||
IGRefreshControl *rc = MSHookIvar<IGRefreshControl *>(self, "_refreshControl");
|
||||
Ivar stateIvar = class_getInstanceVariable([rc class], "_refreshState");
|
||||
if (stateIvar) {
|
||||
ptrdiff_t off = ivar_getOffset(stateIvar);
|
||||
*(NSInteger *)((char *)(__bridge void *)rc + off) = 0;
|
||||
}
|
||||
if ([rc respondsToSelector:@selector(endRefreshing)])
|
||||
((void(*)(id,SEL))objc_msgSend)(rc, @selector(endRefreshing));
|
||||
[self refreshControlDidEndFinishLoadingAnimation:rc];
|
||||
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Refresh Reels?"
|
||||
message:nil
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
__weak id weakSelf = self;
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"Refresh" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_) {
|
||||
sciReelRefreshBypassing = YES;
|
||||
SEL rSel = @selector(_refreshReelsWithParamsForNetworkRequest:userDidPullToRefresh:);
|
||||
((void(*)(id,SEL,NSInteger,BOOL))objc_msgSend)(weakSelf, rSel, arg1, arg2);
|
||||
sciReelRefreshBypassing = NO;
|
||||
}]];
|
||||
|
||||
UIViewController *presenter = (UIViewController *)self;
|
||||
[presenter presentViewController:alert animated:YES completion:nil];
|
||||
}
|
||||
%end
|
||||
|
||||
// * Disable auto-unmuting reels
|
||||
// Blocks all paths that can unmute: hardware buttons, headphones,
|
||||
// mute switch, and the audio state announcer.
|
||||
%hook IGAudioStatusAnnouncer
|
||||
- (void)_didPressVolumeButton:(id)button {
|
||||
if (![SCIUtils getBoolPref:@"disable_auto_unmuting_reels"]) {
|
||||
%orig(button);
|
||||
}
|
||||
}
|
||||
- (void)_didUnplugHeadphones:(id)headphones {
|
||||
if (![SCIUtils getBoolPref:@"disable_auto_unmuting_reels"]) {
|
||||
%orig(headphones);
|
||||
}
|
||||
}
|
||||
- (void)_muteSwitchStateChanged:(id)changed {
|
||||
extern BOOL sciStoryAudioBypass;
|
||||
if (sciStoryAudioBypass || ![SCIUtils getBoolPref:@"disable_auto_unmuting_reels"]) {
|
||||
%orig(changed);
|
||||
}
|
||||
}
|
||||
// Block the announcer from broadcasting "audio enabled" state changes
|
||||
- (void)_announceForDeviceStateChangesIfNeededForAudioEnabled:(BOOL)enabled reason:(NSInteger)reason {
|
||||
extern BOOL sciStoryAudioBypass;
|
||||
BOOL pausePlayMode = [[SCIUtils getStringPref:@"reels_tap_control"] isEqualToString:@"pause"];
|
||||
if ([SCIUtils getBoolPref:@"disable_auto_unmuting_reels"] && enabled && !pausePlayMode && !sciStoryAudioBypass) {
|
||||
return;
|
||||
}
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
@@ -1,58 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
|
||||
#define QUICKSNAPENABLED(orig) return [SCIUtils getBoolPref:@"disable_instants_creation"] ? false : orig;
|
||||
|
||||
// Demangled name: IGQuickSnapExperimentation.IGQuickSnapExperimentationHelper
|
||||
%hook _TtC26IGQuickSnapExperimentation32IGQuickSnapExperimentationHelper
|
||||
+ (_Bool)isQuicksnapEnabled:(id)enabled {
|
||||
QUICKSNAPENABLED(%orig);
|
||||
}
|
||||
+ (_Bool)isQuicksnapEnabledInFeed:(id)feed {
|
||||
QUICKSNAPENABLED(%orig);
|
||||
}
|
||||
+ (_Bool)isQuicksnapEnabledInInbox:(id)inbox {
|
||||
QUICKSNAPENABLED(%orig);
|
||||
}
|
||||
+ (_Bool)isQuicksnapEnabledInStories:(id)stories {
|
||||
QUICKSNAPENABLED(%orig);
|
||||
}
|
||||
+ (_Bool)isQuicksnapEnabledInNotesTray:(id)tray {
|
||||
QUICKSNAPENABLED(%orig);
|
||||
}
|
||||
+ (_Bool)isQuicksnapEnabledInNotesTrayWithPeek:(id)peek {
|
||||
QUICKSNAPENABLED(%orig);
|
||||
}
|
||||
+ (_Bool)isQuicksnapEnabledInNotesTrayWithPog:(id)pog {
|
||||
QUICKSNAPENABLED(%orig);
|
||||
}
|
||||
+ (_Bool)isQuicksnapNotesTrayEmptyPogEnabled:(id)enabled {
|
||||
QUICKSNAPENABLED(%orig);
|
||||
}
|
||||
// + (_Bool)isStoriesSpringEnabled:(id)enabled {
|
||||
// return true;
|
||||
// }
|
||||
// + (_Bool)shouldEnableScreenshotBlocking:(id)blocking {
|
||||
// return false;
|
||||
// }
|
||||
// + (_Bool)areFiltersEnabled:(id)enabled {
|
||||
// return true;
|
||||
// }
|
||||
// + (_Bool)isBottomsheetCustomAudienceEnabled:(id)enabled {
|
||||
// return true;
|
||||
// }
|
||||
// + (_Bool)isVideoCaptureEnabled:(id)enabled {
|
||||
// return true;
|
||||
// }
|
||||
%end
|
||||
|
||||
// %hook IGDirectNotesTrayRowCell
|
||||
// - (_Bool)isQuicksnapPeekVisible {
|
||||
// return true;
|
||||
// }
|
||||
// %end
|
||||
|
||||
// %hook IGDirectNotesTrayRowSectionController
|
||||
// - (_Bool)isQuicksnapPeekVisible {
|
||||
// return true;
|
||||
// }
|
||||
// %end
|
||||
@@ -1,251 +0,0 @@
|
||||
// Story seen receipt blocking + visual seen state blocking
|
||||
#import "StoryHelpers.h"
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <substrate.h>
|
||||
|
||||
BOOL sciSeenBypassActive = NO;
|
||||
BOOL sciAdvanceBypassActive = NO;
|
||||
BOOL sciStorySeenToggleEnabled = NO; // toggle-mode session bypass
|
||||
NSMutableSet *sciAllowedSeenPKs = nil;
|
||||
|
||||
extern BOOL sciIsCurrentStoryOwnerExcluded(void);
|
||||
extern BOOL sciIsObjectStoryOwnerExcluded(id obj);
|
||||
|
||||
static BOOL sciStorySeenToggleBypass(void) {
|
||||
return [[SCIUtils getStringPref:@"story_seen_mode"] isEqualToString:@"toggle"] && sciStorySeenToggleEnabled;
|
||||
}
|
||||
|
||||
void sciAllowSeenForPK(id media) {
|
||||
if (!media) return;
|
||||
id pk = sciCall(media, @selector(pk));
|
||||
if (!pk) return;
|
||||
if (!sciAllowedSeenPKs) sciAllowedSeenPKs = [NSMutableSet set];
|
||||
[sciAllowedSeenPKs addObject:[NSString stringWithFormat:@"%@", pk]];
|
||||
}
|
||||
|
||||
static BOOL sciIsPKAllowed(id media) {
|
||||
if (!media || !sciAllowedSeenPKs || sciAllowedSeenPKs.count == 0) return NO;
|
||||
id pk = sciCall(media, @selector(pk));
|
||||
if (!pk) return NO;
|
||||
return [sciAllowedSeenPKs containsObject:[NSString stringWithFormat:@"%@", pk]];
|
||||
}
|
||||
|
||||
static BOOL sciShouldBlockSeenNetwork() {
|
||||
if (sciSeenBypassActive) return NO;
|
||||
if (sciStorySeenToggleBypass()) return NO;
|
||||
if (sciIsCurrentStoryOwnerExcluded()) return NO;
|
||||
return [SCIUtils getBoolPref:@"no_seen_receipt"];
|
||||
}
|
||||
|
||||
static BOOL sciShouldBlockSeenVisual() {
|
||||
if (sciSeenBypassActive) return NO;
|
||||
if (sciStorySeenToggleBypass()) return NO;
|
||||
if (sciIsCurrentStoryOwnerExcluded()) return NO;
|
||||
return [SCIUtils getBoolPref:@"no_seen_receipt"] && [SCIUtils getBoolPref:@"no_seen_visual"];
|
||||
}
|
||||
|
||||
// Per-instance gating for tray/item/ring hooks where the "current" story
|
||||
// VC may not be the owner of the model in question.
|
||||
static BOOL sciShouldBlockSeenVisualForObj(id obj) {
|
||||
if (sciSeenBypassActive) return NO;
|
||||
if (sciStorySeenToggleBypass()) return NO;
|
||||
if (![SCIUtils getBoolPref:@"no_seen_receipt"] || ![SCIUtils getBoolPref:@"no_seen_visual"]) return NO;
|
||||
if (sciIsObjectStoryOwnerExcluded(obj)) return NO;
|
||||
return YES;
|
||||
}
|
||||
|
||||
// network seen blocking
|
||||
%hook IGStorySeenStateUploader
|
||||
- (void)uploadSeenStateWithMedia:(id)arg1 {
|
||||
if (!sciSeenBypassActive && sciShouldBlockSeenNetwork() && !sciIsPKAllowed(arg1)) return;
|
||||
%orig;
|
||||
}
|
||||
- (void)uploadSeenState {
|
||||
if (!sciSeenBypassActive && sciShouldBlockSeenNetwork() && !(sciAllowedSeenPKs && sciAllowedSeenPKs.count > 0)) return;
|
||||
%orig;
|
||||
}
|
||||
- (void)_uploadSeenState:(id)arg1 {
|
||||
if (!sciSeenBypassActive && sciShouldBlockSeenNetwork() && !sciIsPKAllowed(arg1)) return;
|
||||
%orig;
|
||||
}
|
||||
- (void)sendSeenReceipt:(id)arg1 {
|
||||
if (!sciSeenBypassActive && sciShouldBlockSeenNetwork() && !sciIsPKAllowed(arg1)) return;
|
||||
%orig;
|
||||
}
|
||||
- (id)networker { return %orig; }
|
||||
%end
|
||||
|
||||
// visual seen blocking + story auto-advance
|
||||
%hook IGStoryFullscreenSectionController
|
||||
- (void)markItemAsSeen:(id)arg1 { if (sciShouldBlockSeenVisual() && !sciIsPKAllowed(arg1)) return; %orig; }
|
||||
- (void)_markItemAsSeen:(id)arg1 { if (sciShouldBlockSeenVisual() && !sciIsPKAllowed(arg1)) return; %orig; }
|
||||
- (void)storySeenStateDidChange:(id)arg1 { if (sciShouldBlockSeenVisual()) return; %orig; }
|
||||
- (void)sendSeenRequestForCurrentItem { if (sciShouldBlockSeenVisual()) return; %orig; }
|
||||
- (void)markCurrentItemAsSeen { if (sciShouldBlockSeenVisual()) return; %orig; }
|
||||
- (void)storyPlayerMediaViewDidPlayToEnd:(id)arg1 {
|
||||
if (!sciAdvanceBypassActive && [SCIUtils getBoolPref:@"stop_story_auto_advance"]) return;
|
||||
%orig;
|
||||
}
|
||||
- (void)advanceToNextReelForAutoScroll {
|
||||
if (!sciAdvanceBypassActive && [SCIUtils getBoolPref:@"stop_story_auto_advance"]) return;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook IGStoryViewerViewController
|
||||
- (void)fullscreenSectionController:(id)arg1 didMarkItemAsSeen:(id)arg2 {
|
||||
if (sciShouldBlockSeenVisual() && !sciIsPKAllowed(arg2)) return;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook IGStoryTrayViewModel
|
||||
- (void)markAsSeen { if (sciShouldBlockSeenVisualForObj(self)) return; %orig; }
|
||||
- (void)setHasUnseenMedia:(BOOL)arg1 { if (sciShouldBlockSeenVisualForObj(self)) { %orig(YES); return; } %orig; }
|
||||
- (BOOL)hasUnseenMedia { if (sciShouldBlockSeenVisualForObj(self)) return YES; return %orig; }
|
||||
- (void)setIsSeen:(BOOL)arg1 { if (sciShouldBlockSeenVisualForObj(self)) { %orig(NO); return; } %orig; }
|
||||
- (BOOL)isSeen { if (sciShouldBlockSeenVisualForObj(self)) return NO; return %orig; }
|
||||
%end
|
||||
|
||||
%hook IGStoryItem
|
||||
- (void)setHasSeen:(BOOL)arg1 { if (sciShouldBlockSeenVisualForObj(self)) { %orig(NO); return; } %orig; }
|
||||
- (BOOL)hasSeen { if (sciShouldBlockSeenVisualForObj(self)) return NO; return %orig; }
|
||||
%end
|
||||
|
||||
%hook IGStoryGradientRingView
|
||||
- (void)setIsSeen:(BOOL)arg1 { if (sciShouldBlockSeenVisual()) { %orig(NO); return; } %orig; }
|
||||
- (void)setSeen:(BOOL)arg1 { if (sciShouldBlockSeenVisual()) { %orig(NO); return; } %orig; }
|
||||
- (void)updateRingForSeenState:(BOOL)arg1 { if (sciShouldBlockSeenVisual()) { %orig(NO); return; } %orig; }
|
||||
%end
|
||||
|
||||
// ============ STORY LIKE HOOKS ============
|
||||
// Hooks all known like entry points to trigger mark-seen and auto-advance on like.
|
||||
// Uses sciMarkSeenTapped: from OverlayButtons.xm for the actual seen flow.
|
||||
|
||||
static __weak UIViewController *sciActiveStoryVC = nil;
|
||||
|
||||
%hook IGStoryViewerViewController
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
%orig;
|
||||
sciActiveStoryVC = self;
|
||||
}
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
if (sciActiveStoryVC == (UIViewController *)self) sciActiveStoryVC = nil;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
static UIView *sciFindStoryOverlayView(UIViewController *vc) {
|
||||
if (!vc) return nil;
|
||||
Class targetCls = NSClassFromString(@"IGStoryFullscreenOverlayView");
|
||||
if (!targetCls) return nil;
|
||||
NSMutableArray *stack = [NSMutableArray arrayWithObject:vc.view];
|
||||
while (stack.count > 0) {
|
||||
UIView *v = stack.lastObject;
|
||||
[stack removeLastObject];
|
||||
if ([v isKindOfClass:targetCls]) return v;
|
||||
for (UIView *sub in v.subviews) [stack addObject:sub];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
static void sciMarkActiveStorySeen(void) {
|
||||
if (![SCIUtils getBoolPref:@"seen_on_story_like"]) return;
|
||||
UIView *overlay = sciFindStoryOverlayView(sciActiveStoryVC);
|
||||
if (!overlay) return;
|
||||
SEL sel = NSSelectorFromString(@"sciMarkSeenTapped:");
|
||||
if ([overlay respondsToSelector:sel])
|
||||
((void(*)(id, SEL, id))objc_msgSend)(overlay, sel, nil);
|
||||
}
|
||||
|
||||
// Dedup guard — multiple hooks fire for the same like event
|
||||
static uint64_t sciLastLikeAdvanceTime = 0;
|
||||
|
||||
static void sciAdvanceOnStoryLike(void) {
|
||||
if (![SCIUtils getBoolPref:@"advance_on_story_like"]) return;
|
||||
UIViewController *storyVC = sciActiveStoryVC;
|
||||
if (!storyVC) return;
|
||||
id sectionCtrl = sciFindSectionController(storyVC);
|
||||
if (!sectionCtrl) return;
|
||||
|
||||
uint64_t now = clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW);
|
||||
if (now - sciLastLikeAdvanceTime < 500000000ULL) return;
|
||||
sciLastLikeAdvanceTime = now;
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
sciAdvanceBypassActive = YES;
|
||||
SEL advSel = NSSelectorFromString(@"advanceToNextItemWithNavigationAction:");
|
||||
if ([sectionCtrl respondsToSelector:advSel])
|
||||
((void(*)(id, SEL, NSInteger))objc_msgSend)(sectionCtrl, advSel, 1);
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
id sc2 = storyVC ? sciFindSectionController(storyVC) : nil;
|
||||
if (sc2) {
|
||||
SEL resumeSel = NSSelectorFromString(@"tryResumePlaybackWithReason:");
|
||||
if ([sc2 respondsToSelector:resumeSel])
|
||||
((void(*)(id, SEL, NSInteger))objc_msgSend)(sc2, resumeSel, 0);
|
||||
}
|
||||
sciAdvanceBypassActive = NO;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
static void sciOnStoryLike(void) {
|
||||
sciMarkActiveStorySeen();
|
||||
sciAdvanceOnStoryLike();
|
||||
}
|
||||
|
||||
static void (*orig_didLikeSundial)(id, SEL, id);
|
||||
static void new_didLikeSundial(id self, SEL _cmd, id pk) {
|
||||
orig_didLikeSundial(self, _cmd, pk);
|
||||
sciOnStoryLike();
|
||||
}
|
||||
|
||||
static void (*orig_overlaySetIsLiked)(id, SEL, BOOL, BOOL);
|
||||
static void new_overlaySetIsLiked(id self, SEL _cmd, BOOL isLiked, BOOL animated) {
|
||||
orig_overlaySetIsLiked(self, _cmd, isLiked, animated);
|
||||
if (isLiked) sciOnStoryLike();
|
||||
}
|
||||
|
||||
// IGUFIButton selected state: YES = heart filled (liked), NO = empty (not liked).
|
||||
// handleStoryLikeTapWithButton: is a toggle — check state before orig to determine direction.
|
||||
static void (*orig_handleLikeTap)(id, SEL, id);
|
||||
static void new_handleLikeTap(id self, SEL _cmd, id button) {
|
||||
BOOL isLike = [button isKindOfClass:[UIButton class]] && [(UIButton *)button isSelected];
|
||||
orig_handleLikeTap(self, _cmd, button);
|
||||
if (isLike) sciOnStoryLike();
|
||||
}
|
||||
|
||||
static void (*orig_likeButtonSetIsLiked)(id, SEL, BOOL, BOOL);
|
||||
static void new_likeButtonSetIsLiked(id self, SEL _cmd, BOOL isLiked, BOOL animated) {
|
||||
orig_likeButtonSetIsLiked(self, _cmd, isLiked, animated);
|
||||
if (isLiked) sciOnStoryLike();
|
||||
}
|
||||
|
||||
%ctor {
|
||||
Class overlayCtl = NSClassFromString(@"IGSundialViewerControlsOverlayController");
|
||||
if (overlayCtl) {
|
||||
SEL didLike = NSSelectorFromString(@"didLikeSundialWithMediaPK:");
|
||||
if (class_getInstanceMethod(overlayCtl, didLike))
|
||||
MSHookMessageEx(overlayCtl, didLike, (IMP)new_didLikeSundial, (IMP *)&orig_didLikeSundial);
|
||||
|
||||
SEL setLiked = @selector(setIsLiked:animated:);
|
||||
if (class_getInstanceMethod(overlayCtl, setLiked))
|
||||
MSHookMessageEx(overlayCtl, setLiked, (IMP)new_overlaySetIsLiked, (IMP *)&orig_overlaySetIsLiked);
|
||||
}
|
||||
|
||||
Class likesImpl = NSClassFromString(@"IGStoryLikesInteractionControllingImpl");
|
||||
if (likesImpl) {
|
||||
SEL handleTap = NSSelectorFromString(@"handleStoryLikeTapWithButton:");
|
||||
if (class_getInstanceMethod(likesImpl, handleTap))
|
||||
MSHookMessageEx(likesImpl, handleTap, (IMP)new_handleLikeTap, (IMP *)&orig_handleLikeTap);
|
||||
}
|
||||
|
||||
Class likeBtn = NSClassFromString(@"IGSundialViewerUFI.IGSundialLikeButton");
|
||||
if (likeBtn) {
|
||||
SEL setLiked = @selector(setIsLiked:animated:);
|
||||
if (class_getInstanceMethod(likeBtn, setLiked))
|
||||
MSHookMessageEx(likeBtn, setLiked, (IMP)new_likeButtonSetIsLiked, (IMP *)&orig_likeButtonSetIsLiked);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
|
||||
// Defined in SeenButtons.x
|
||||
extern __weak IGDirectThreadViewController *sciActiveThreadVC;
|
||||
extern BOOL sciAutoTypingEnabled(void);
|
||||
extern void sciDoAutoSeen(IGDirectThreadViewController *threadVC);
|
||||
|
||||
%hook IGDirectTypingStatusService
|
||||
- (void)updateOutgoingStatusIsActive:(_Bool)active threadKey:(id)key threadMetadata:(id)metadata typingStatusType:(long long)type {
|
||||
// Mark the visible thread as seen on the first typing event — runs even
|
||||
// when typing-status broadcasting is blocked below.
|
||||
if (active && sciAutoTypingEnabled()) {
|
||||
IGDirectThreadViewController *vc = sciActiveThreadVC;
|
||||
if (vc) sciDoAutoSeen(vc);
|
||||
}
|
||||
|
||||
if ([SCIUtils getBoolPref:@"disable_typing_status"]) return;
|
||||
|
||||
return %orig(active, key, metadata, type);
|
||||
}
|
||||
%end
|
||||
@@ -1,192 +0,0 @@
|
||||
// Download voice messages from DMs. Detects audio messages via the
|
||||
// menuConfiguration hook, then injects a Download item into the long-press
|
||||
// PrismMenu. Tries to convert to .m4a; falls back to the source extension
|
||||
// (e.g. .ogg from web users) if AVFoundation can't decode the format.
|
||||
|
||||
#import "../../Utils.h"
|
||||
#import "../../InstagramHeaders.h"
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <substrate.h>
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import "../../Downloader/Download.h"
|
||||
|
||||
typedef id (*SCIMsgSendId)(id, SEL);
|
||||
static inline id sciDAF(id obj, SEL sel) {
|
||||
if (!obj || ![obj respondsToSelector:sel]) return nil;
|
||||
return ((SCIMsgSendId)objc_msgSend)(obj, sel);
|
||||
}
|
||||
|
||||
static BOOL sciAudioMenuPending = NO;
|
||||
static id sciLastAudioViewModel = nil;
|
||||
|
||||
// Demangled: IGDirectMessageMenuConfiguration.IGDirectMessageMenuConfiguration
|
||||
%hook _TtC32IGDirectMessageMenuConfiguration32IGDirectMessageMenuConfiguration
|
||||
|
||||
+ (id)menuConfigurationWithEligibleOptions:(id)options
|
||||
messageViewModel:(id)arg2
|
||||
contentType:(id)arg3
|
||||
isSticker:(_Bool)arg4
|
||||
isMusicSticker:(_Bool)arg5
|
||||
directNuxManager:(id)arg6
|
||||
sessionUserDefaults:(id)arg7
|
||||
launcherSet:(id)arg8
|
||||
userSession:(id)arg9
|
||||
tapHandler:(id)arg10
|
||||
{
|
||||
if ([SCIUtils getBoolPref:@"download_audio_message"] &&
|
||||
[arg3 isKindOfClass:[NSString class]] && [arg3 isEqualToString:@"voice_media"]) {
|
||||
sciAudioMenuPending = YES;
|
||||
sciLastAudioViewModel = arg2;
|
||||
}
|
||||
return %orig;
|
||||
}
|
||||
|
||||
%end
|
||||
|
||||
// PrismMenu uses Swift classes with mangled names — hook via MSHookMessageEx in %ctor.
|
||||
|
||||
static id (*orig_prismMenuView_init3)(id, SEL, NSArray *, id, BOOL);
|
||||
|
||||
static id new_prismMenuView_init3(id self, SEL _cmd, NSArray *elements, id header, BOOL edr) {
|
||||
if (!sciAudioMenuPending) return orig_prismMenuView_init3(self, _cmd, elements, header, edr);
|
||||
sciAudioMenuPending = NO;
|
||||
|
||||
if (![SCIUtils getBoolPref:@"download_audio_message"])
|
||||
return orig_prismMenuView_init3(self, _cmd, elements, header, edr);
|
||||
|
||||
Class builderClass = NSClassFromString(@"IGDSPrismMenuItemBuilder");
|
||||
Class elementClass = NSClassFromString(@"IGDSPrismMenuElement");
|
||||
if (!builderClass || !elementClass || elements.count == 0)
|
||||
return orig_prismMenuView_init3(self, _cmd, elements, header, edr);
|
||||
|
||||
typedef id (*InitFn)(id, SEL, id);
|
||||
typedef id (*WithFn)(id, SEL, id);
|
||||
typedef id (*BuildFn)(id, SEL);
|
||||
|
||||
id capturedVM = sciLastAudioViewModel;
|
||||
void (^handler)(void) = ^{
|
||||
if (!capturedVM) return;
|
||||
|
||||
// vm -> audio (IGDirectAudio) -> _server_audio (IGAudio) -> playbackURL
|
||||
id directAudio = nil;
|
||||
@try { directAudio = [capturedVM valueForKey:@"audio"]; } @catch (NSException *e) {}
|
||||
if (!directAudio) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Could not get audio data. Try again after refreshing the chat."];
|
||||
return;
|
||||
}
|
||||
|
||||
Ivar serverAudioIvar = class_getInstanceVariable([directAudio class], "_server_audio");
|
||||
id serverAudio = serverAudioIvar ? object_getIvar(directAudio, serverAudioIvar) : nil;
|
||||
if (!serverAudio) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"Audio not loaded yet. Play the message first and try again."];
|
||||
return;
|
||||
}
|
||||
|
||||
NSURL *playbackURL = sciDAF(serverAudio, @selector(playbackURL));
|
||||
if (!playbackURL) playbackURL = sciDAF(serverAudio, @selector(fallbackURL));
|
||||
if (!playbackURL) {
|
||||
[SCIUtils showErrorHUDWithDescription:@"No audio URL found. Try again after refreshing the chat."];
|
||||
return;
|
||||
}
|
||||
|
||||
UIView *topView = [UIApplication sharedApplication].keyWindow;
|
||||
SCIDownloadPillView *pill = [[SCIDownloadPillView alloc] init];
|
||||
[pill setText:@"Downloading audio..."];
|
||||
[pill showInView:topView];
|
||||
|
||||
NSURLSessionDownloadTask *task = [[NSURLSession sharedSession]
|
||||
downloadTaskWithURL:playbackURL
|
||||
completionHandler:^(NSURL *tempURL, NSURLResponse *response, NSError *error) {
|
||||
if (error || !tempURL) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[pill dismiss];
|
||||
[SCIUtils showErrorHUDWithDescription:error.localizedDescription ?: @"Download failed. Try again."];
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to convert to .m4a; on failure (e.g. Ogg/Opus) keep the source extension.
|
||||
NSString *urlExt = [[playbackURL.path pathExtension] lowercaseString];
|
||||
if (urlExt.length == 0) urlExt = @"m4a";
|
||||
|
||||
NSString *mediaId = sciDAF(serverAudio, @selector(mediaId)) ?: @"voice_message";
|
||||
NSString *srcPath = [NSTemporaryDirectory() stringByAppendingPathComponent:
|
||||
[NSString stringWithFormat:@"tmp_%@.%@", mediaId, urlExt]];
|
||||
NSURL *srcURL = [NSURL fileURLWithPath:srcPath];
|
||||
[[NSFileManager defaultManager] removeItemAtURL:srcURL error:nil];
|
||||
[[NSFileManager defaultManager] moveItemAtURL:tempURL toURL:srcURL error:nil];
|
||||
|
||||
void (^present)(NSURL *) = ^(NSURL *url) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[pill setText:@"Done!"];
|
||||
[pill dismissAfterDelay:0.5];
|
||||
[SCIUtils showShareVC:url];
|
||||
});
|
||||
};
|
||||
|
||||
NSString *m4aPath = [NSTemporaryDirectory() stringByAppendingPathComponent:
|
||||
[NSString stringWithFormat:@"audio_%@.m4a", mediaId]];
|
||||
NSURL *m4aURL = [NSURL fileURLWithPath:m4aPath];
|
||||
[[NSFileManager defaultManager] removeItemAtURL:m4aURL error:nil];
|
||||
|
||||
AVAsset *asset = [AVAsset assetWithURL:srcURL];
|
||||
AVAssetExportSession *exp = [AVAssetExportSession
|
||||
exportSessionWithAsset:asset presetName:AVAssetExportPresetAppleM4A];
|
||||
exp.outputURL = m4aURL;
|
||||
exp.outputFileType = AVFileTypeAppleM4A;
|
||||
|
||||
[exp exportAsynchronouslyWithCompletionHandler:^{
|
||||
if (exp.status == AVAssetExportSessionStatusCompleted) {
|
||||
[[NSFileManager defaultManager] removeItemAtURL:srcURL error:nil];
|
||||
present(m4aURL);
|
||||
return;
|
||||
}
|
||||
// Conversion failed — keep the original with its real extension.
|
||||
[[NSFileManager defaultManager] removeItemAtURL:m4aURL error:nil];
|
||||
NSString *outPath = [NSTemporaryDirectory() stringByAppendingPathComponent:
|
||||
[NSString stringWithFormat:@"audio_%@.%@", mediaId, urlExt]];
|
||||
NSURL *outURL = [NSURL fileURLWithPath:outPath];
|
||||
[[NSFileManager defaultManager] removeItemAtURL:outURL error:nil];
|
||||
if (![[NSFileManager defaultManager] moveItemAtURL:srcURL toURL:outURL error:nil]) {
|
||||
present(srcURL);
|
||||
return;
|
||||
}
|
||||
present(outURL);
|
||||
}];
|
||||
}];
|
||||
[task resume];
|
||||
};
|
||||
|
||||
id builder = ((InitFn)objc_msgSend)([builderClass alloc], @selector(initWithTitle:), @"Download");
|
||||
builder = ((WithFn)objc_msgSend)(builder, @selector(withImage:), [UIImage systemImageNamed:@"arrow.down.circle"]);
|
||||
builder = ((WithFn)objc_msgSend)(builder, @selector(withHandler:), handler);
|
||||
id menuItem = ((BuildFn)objc_msgSend)(builder, @selector(build));
|
||||
if (!menuItem) return orig_prismMenuView_init3(self, _cmd, elements, header, edr);
|
||||
|
||||
// Wrap in IGDSPrismMenuElement: clone _subtype from a sibling, attach the menuItem.
|
||||
id templateEl = elements[0];
|
||||
id newElement = [[templateEl class] new];
|
||||
Ivar subtypeIvar = class_getInstanceVariable([templateEl class], "_subtype");
|
||||
Ivar itemIvar = class_getInstanceVariable([templateEl class], "_item_menuItem");
|
||||
if (!newElement || !subtypeIvar || !itemIvar)
|
||||
return orig_prismMenuView_init3(self, _cmd, elements, header, edr);
|
||||
|
||||
ptrdiff_t offset = ivar_getOffset(subtypeIvar);
|
||||
*(uint64_t *)((uint8_t *)(__bridge void *)newElement + offset) =
|
||||
*(uint64_t *)((uint8_t *)(__bridge void *)templateEl + offset);
|
||||
object_setIvar(newElement, itemIvar, menuItem);
|
||||
|
||||
NSMutableArray *newElements = [NSMutableArray arrayWithObject:newElement];
|
||||
[newElements addObjectsFromArray:elements];
|
||||
return orig_prismMenuView_init3(self, _cmd, newElements, header, edr);
|
||||
}
|
||||
|
||||
%ctor {
|
||||
Class prismMenuView = objc_getClass("IGDSPrismMenu.IGDSPrismMenuView");
|
||||
if (prismMenuView) {
|
||||
SEL sel = @selector(initWithMenuElements:headerText:edrEnabled:);
|
||||
if ([prismMenuView instancesRespondToSelector:sel])
|
||||
MSHookMessageEx(prismMenuView, sel, (IMP)new_prismMenuView_init3, (IMP *)&orig_prismMenuView_init3);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user