Code Monkey home page Code Monkey logo

orion's People

Contributors

kabiroberai avatar luki120 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

orion's Issues

Orion broken on arm64e iOS 14 due to Xcode 11 being used.

Orion.framework is compiled with Xcode 11.
Xcode 11 swift apps break on arm64e iOS 14.

Orion tweaks crash in orion_init on arm64e iOS 14:

Call stack:
--
2 | 0   ColoredSwipe.dylib                0x0000000101132e00 0x10112c000 + 28160          // orion_init()
3 | 1   ColoredSwipe.dylib                0x0000000101132ddc 0x10112c000 + 28124          // orion_init()
4 | 2   ColoredSwipe.dylib                0x0000000101132da0 0x10112c000 + 28064          // orion_init
5 | 3   ColoredSwipe.dylib                0x0000000101132828 0x10112c000 + 26664          // init

Orion doesn't build correctly on Xcode 12.5

In the IDE, next to the first line with "import Orion" on it, this shows:
Failed to build module 'Orion' from its module interface; the compiler that produced it, 'Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.4 (swiftlang-1205.0.24.6 clang-1205.0.19.54)'
Upon building with make clean all messages=yes, I get this: Orion does not support this version of Swift yet. Please check https://github.com/theos/Orion for progress updates. #error("""

Orion broken on Linux

(Thanks for reporting an issue! Please make sure you click the link above to view the issue guidelines, then fill out the blanks below.)

What are the steps to reproduce this issue?

  1. Install Orion
  2. Attempt to compile a tweak

What happens?

Tweak fails to compile

What were you expecting to happen?

Tweak compiles successfully

Any logs, error output, etc?

https://ghostbin.co/paste/52w4

Any other comments?

The same code compiles on macOS

What versions of software are you using?

Operating System:
Linux
Distro: Ubuntu 20.04
Kernel: 5.8.0-44-generic

Toolchain Version:
Swift 5.3.3 from https://swift.org/download/
CRKatri toolchain 5.3.2 from https://github.com/CRKatri/llvm-project/releases/tag/swift-5.3.2-RELEASE

SDK Version:
iOS 14.0

Can't Link a Swift tweak's preference bundle

What are the steps to reproduce this issue?

  1. Create a Swift Tweak using $THEOS/bin/nic.pl action number 18.
  2. cd to that project folder.
  3. Create preference bundle for the tweak using $THEOS/bin/nic.pl action number 13.
  4. cd to tweak's folder.
  5. Run "make do".

What happens?

I get a linker error on the linking phase of the preference bundle.

What were you expecting to happen?

The tweak compiling and linking, considering I didn't even write any code, just used the given code.

Any logs, error output, etc?

> Making all for tweak customcarrier…
> Making all in preferencesforcarrier…
> Making all for bundle PreferencesForCarrier…
==> Copying resource directories into the bundle wrapper…
==> Compiling Sources/PreferencesForCarrier/RootListController.swift (arm64)…
==> Linking bundle PreferencesForCarrier (arm64)…
ld: warning: Could not find or use auto-linked framework 'Preferences'
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_PSListController", referenced from:
      type metadata for PreferencesForCarrier.RootListController in RootListController.swift.f4f34afd.o
  "_OBJC_METACLASS_$_PSListController", referenced from:
      _OBJC_METACLASS_$__TtC21PreferencesForCarrier18RootListController in RootListController.swift.f4f34afd.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [/Users/user/Developer/iOS/customcarrier/.theos/obj/debug/arm64/PreferencesForCarrier.bundle/PreferencesForCarrier] Error 1
make[3]: *** [/Users/user/Developer/iOS/customcarrier/.theos/obj/debug/arm64/PreferencesForCarrier.bundle/PreferencesForCarrier] Error 2
make[2]: *** [internal-bundle-all_] Error 2
make[1]: *** [PreferencesForCarrier.all.bundle.variables] Error 2
make: *** [internal-all] Error 2

What versions of software are you using?

Operating System: macOS Monterey 12.5.1

Toolchain Version: Xcode 13.4.1

SDK Version: I think the SDK Theos uses is iPhoneOS14.5.sdk

Building on iOS?

What are the steps to reproduce this issue?

  1. Install Orion on iOS device
  2. Install swift-toolchain (for iOS) and libswift
  3. create swift_tweak (using nic.pl)
  4. run

What happens?

Build failed

What were you expecting to happen?

Build the tweak

Any logs, error output, etc?

Making all for tweak swifttweakorion…
==> Building Swift support tools…
error: unable to invoke subcommand: /usr/bin/swift-build (No such file or directory)
Failed to build swift-support: command failed: SPM_THEOS_BUILD=1 swift build -c release --package-path /opt/theos/vendor/swift-support --build-path /opt/theos/vendor/swift-support/.theos_build
make[2]: *** [/opt/theos/makefiles/instance/rules.mk:197: internal-swifttweakorion-swift-support] Error 2
make[1]: *** [/opt/theos/makefiles/instance/rules.mk:62: before-swifttweakorion-all] Error 2
make: *** [/opt/theos/makefiles/master/rules.mk:163: swifttweakorion.all.tweak.variables] Error 2

Any other comments?

Is it even possible to build a tweak on iOS?

What versions of software are you using?

Operating System:
iOS 14.0.1

Toolchain Version:
swift-toolchain 4.0.3-1
libswift4 4.2.1-2

SDK Version:

Target more platforms with Theos

While regular SPM projects that use Orion should work on any Apple platform, Theos in particular only supports iOS at the moment. It would be useful to support other platforms like macOS and the iOS simulator.

This will probably require building multiple copies of the framework and selecting the right one depending on the platform. Something similar will have to be figured out for the tweak_swift template's Package.swift as well – maybe a binaryTarget, or some modulemap trickery.

[Question] Orion Preprocessor

Question: is there a prebuilt Orion Preprocessor, I am using the latest commit on gh actions and the build time increased by 7 mins to build Orion Preprocessor, this didn’t happen on the Orion branch of Theos

Unable to hook NSNotificationCenter

I have tried hooking NSNotificationCenter through

import Orion

class NSNotificationCenterHook: ClassHook<NSObject> {

    static let targetName = "NSNotificationCenter"

    func addObserver(_ observer: Any, selector aSelector: Selector, name aName: NSNotification.Name?, object anObject: Any?) {
        NSLog("NSNOTIFHOOKTESTLOG")
        orig.addObserver(observer, selector: aSelector, name: aName, object: anObject)
    }

}

yet the hook always fails (no logs appear).

However, the code does not cause any crash.

One guess as to why this fails is because of the renaming of NSNotificationCenter to NotificationCenter. This is merely a guess.

Plans to port to iOS 17?

What are the steps to reproduce this issue?

  1. Open Sileo
  2. Add repo
  3. Install

What happens?

Failure to install wrong iOS version

What were you expecting to happen?

It fails to install

With Palera1n allowing iOS 17 to have JB it'd be awesome if this tweak were ported. A lot of things depend on it.

Theos repo

Why should the system version be greater than 12.2 and will not support lower versions?

Add/Fix support to be able to make rootless debs

What are the steps to reproduce this issue?

  1. Compile package with rootless
    What happens?

Doesn’t create a rootless deb, just a normal deb

What were you expecting to happen?

I am expecting it to create a rootless deb

error: 'swift-support': Invalid manifest

What are the steps to reproduce this issue?

  1. Follow the "getting started" guide

What happens?

Build fails with error: 'swift-support': Invalid manifest

What were you expecting to happen?

No errors.

Any logs, error output, etc?

`make do
==> Notice: Build may be slow as Theos isn’t using all available CPU cores on this computer. Consider upgrading GNU Make: https://theos.dev/docs/parallel-building
==> Warning: Building for iOS 12.2, but the current toolchain can’t produce arm64e binaries for iOS earlier than 14.0. More information: https://theos.dev/docs/arm64e-deployment

Making all for tweak VLCTweak…
==> Building Swift support tools…
warning: '--build-path' option is deprecated; use '--scratch-path' instead
error: 'swift-support': Invalid manifest
:474:9: note: in file included from :474:
#import "hfs/hfs_format.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/hfs/hfs_format.h:794:2: error: unknown type name 'uuid_string_t'; did you mean 'io_string_t'?
uuid_string_t ext_jnl_uuid;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/device/device_types.h:89:33: note: 'io_string_t' declared here
typedef char io_string_t[512];
^
:474:9: note: in file included from :474:
#import "hfs/hfs_format.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/hfs/hfs_format.h:796:20: error: use of undeclared identifier 'uuid_string_t'
char reserved[JIB_RESERVED_SIZE];
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/hfs/hfs_format.h:787:61: note: expanded from macro 'JIB_RESERVED_SIZE'
#define JIB_RESERVED_SIZE ((32*sizeof(u_int32_t)) - sizeof(uuid_string_t) - 48)
^
:482:9: note: in file included from :482:
#import "netinet6/ipcomp.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/netinet6/ipcomp.h:40:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/netinet6/ipcomp.h:40:
#include <netinet6/ipsec.h>
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/netinet6/ipsec.h:141:2: error: unknown type name 'uuid_string_t'; did you mean 'io_string_t'?
uuid_string_t wake_uuid;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/device/device_types.h:89:33: note: 'io_string_t' declared here
typedef char io_string_t[512];
^
:482:9: note: in file included from :482:
#import "netinet6/ipcomp.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/netinet6/ipcomp.h:40:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/netinet6/ipcomp.h:40:
#include <netinet6/ipsec.h>
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/netinet6/ipsec.h:148:2: error: unknown type name 'uuid_string_t'; did you mean 'io_string_t'?
uuid_string_t wake_uuid;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/device/device_types.h:89:33: note: 'io_string_t' declared here
typedef char io_string_t[512];
^
:0: error: could not build Objective-C module 'Darwin'
/Users/blackout/theos/vendor/swift-support/Package.swift:3:8: error: failed to build module 'PackageDescription' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
import PackageDescription
^
Failed to build swift-support: command failed: SPM_THEOS_BUILD=1 swift build -c release --package-path /Users/blackout/theos/vendor/swift-support --build-path /Users/blackout/theos/vendor/swift-support/.theos_build
make[2]: *** [internal-VLCTweak-swift-support] Error 2
make[1]: *** [before-VLCTweak-all] Error 2
make: *** [VLCTweak.all.tweak.variables] Error 2`

What versions of software are you using?

Operating System: macOS 12.6.1

Toolchain Version: IDK

SDK Version: iPhoneOS16.2

Cannot use implicitly unwrapped optional types in hooked function signatures

class MyHook: ClassHook<SomeClass> {

    func function(arg: Any) {}

}

and

class MyHook: ClassHook<SomeClass> {

    func function(arg: Any?) {}

}

both compile as expected.
However, if I do

class MyHook: ClassHook<SomeClass> {

    func function(arg: Any!) {}

}

I receive the following errors:

error: using '!' is not allowed here; perhaps '?' was intended?
    private static let orion_sel1 = #selector(function(arg:) as (Self) -> (Any!) -> Void)
error: using '!' is not allowed here; perhaps '?' was intended?
    private static var orion_orig1: @convention(c) (Target, Selector, Any!) -> Void = { target, _cmd, arg1 in
error: using '!' is not allowed here; perhaps '?' was intended?
            callSuper((@convention(c) (UnsafeRawPointer, Selector, Any!) -> Void).self) { $0($1, Self.orion_sel1, arg1) }

I do not believe this behavior is intended.

DEBUG macro is always false

(Thanks for reporting an issue! Please make sure you click the link above to view the issue guidelines, then fill out the blanks below.)

What are the steps to reproduce this issue?

Add this to your Tweak's Objective-C inside a method.

#if DEBUG
    NSLog(@"This value should appear in the console")
#endif

Call the method in code.
Compile and install tweak with make do

What happens?

The code between the#if DEBUG is never executed.

What were you expecting to happen?

The code to be executed since make do builds as debug by default

Any logs, error output, etc?

None

Any other comments?

  • Adding DEBUG=1 to the makefile doesn't work.
  • Doing make DEBUG=1 do doesn't work.
  • Declaring #define DEBUG 1 does work for manual initialization but #define DEBUG 0 is not allowed.

What versions of software are you using?

Operating System:
MacOS Big Sur
Orion 0.9.1

SDK Version:
iOS 14.4

[Suggestion] Libhooker backend

Would be useful, especially for function hooking (unsure if ObjC hooking has any efficiency bonus, though, but C hooking certainly does). I tried to have a go at this, but it's rather complex from Swift to be able to actually use the batched functions.

The best way to do it would be to get all the needed symbols in one go with LHFindSymbols, then hook everything in one go with LHHookFunctions.

headers

Improve documentation

  • Fill in stub guides
  • Add more examples
  • Add basic documentation in template, similar to the regular tweak template
  • Describe how to hook classes which can't be linked (@interface, Dynamic, etc.)
  • Add troubleshooting guide (mention handleError, Theos troubleshooting, etc.)

Document QoL features:

  • Automatic @available handling
  • Calling other hooks' supr/orig methods

Document directives:

  • disable
  • new
  • returns_retained
  • supr_tramp
  • Schemas

Cant hook AppDelegate

What are the steps to reproduce this issue?

im building against ios 14 and im injection my deb & orion 14 deb

class AppDelegate_Hook: ClassHook< UIApplicationDelegate> { func applicationDidBecomeActive(_ application: UIApplication) -> Target { let target = orig.applicationDidBecomeActive(application: application) return target } }

What happens?

I get an exception when running the app

VM Region Info: 0 is not in any region. Bytes before following region: 4344643584

What were you expecting to happen?

The hook to work

Any other comments?

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes: 0x0000000000000001, 0x0000000000000000
VM Region Info: 0 is not in any region. Bytes before following region: 4340596736
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 102b84000-106d14000 [ 65.6M] r-x/r-x SM=COW ...game.app/game
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [68713]
Triggered by Thread: 0
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 ??? 0x0 ???
1 Orion 0x10ecc31cc 0x10eca8000 + 111052
2 Orion 0x10ecc3094 0x10eca8000 + 110740
3 Orion 0x10ecaf1e8 0x10eca8000 + 29160
4 Orion 0x10ecb6aec 0x10eca8000 + 60140
5 lddmw2.dylib 0x10e90c5b8 0x10e904000 + 34232
6 dyld 0x1a7b937c4 invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 156
7 dyld 0x1a7bd8214 invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 340
8 dyld 0x1a7bcb524 invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 524
9 dyld 0x1a7b782d8 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 296
10 dyld 0x1a7bca548 dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 192
11 dyld 0x1a7bd7bf4 dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 516
12 dyld 0x1a7b9369c dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 176
13 dyld 0x1a7b93950 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 216
14 dyld 0x1a7b9392c dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 180
15 dyld 0x1a7b93ae8 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 328
16 dyld 0x1a7bb64b8 dyld4::APIs::runAllInitializersForMain() + 480
17 dyld 0x1a7b7cdd8 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3500
18 dyld 0x1a7b7bdc4 start + 2404

What versions of software are you using?

Operating System: Monterey

Toolchain Version: Newest

SDK Version: TARGET := iphone:clang:latest:14.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.