Skip to content

Support games using UnityFramework#17

Open
rxbit wants to merge 1 commit intoNyaMisty:releasefrom
rxbit:release
Open

Support games using UnityFramework#17
rxbit wants to merge 1 commit intoNyaMisty:releasefrom
rxbit:release

Conversation

@rxbit
Copy link
Copy Markdown

@rxbit rxbit commented Mar 12, 2024

Games using Unity does not use UIKit, so add com.apple.Security to filter to support that.

@NyaMisty
Copy link
Copy Markdown
Owner

NyaMisty commented Apr 2, 2024

Hmm, is Unity App really not using UIKit? That's not sounding correct :(

All apps have _UIApplicationMain, I believe new Unity apps (that has UnityFramework) also uses UIKit

@rxbit
Copy link
Copy Markdown
Author

rxbit commented Apr 2, 2024

According to https://docs.unity3d.com/es/2019.4/Manual/UnityasaLibrary-iOS.html
It has a thin launcher, to load UnityFramework. The launcher dose not use UIKit directly.
Output use otool -L

Payload/ProductName.app/ProductName:
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 1971.0.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1500.65.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)
	/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation (compatibility version 150.0.0, current version 1971.0.0)

The Substrate or ElleKit injector might only check the bundle id when app start, so it does not inject this tweak into app's process.

As of iOS 9.0, the filter plist must exist. Dylibs without a corresponding plist will not be loaded. To replicate the previous effect of no filter plist causing the dylib to be loaded into all processes, set your filter to the bundle com.apple.Security.

And according to Substrate doc, set the filter bundle to com.apple.Security can match all process.

@rxbit
Copy link
Copy Markdown
Author

rxbit commented Apr 2, 2024

The launcher's main is

int main(int argc, char* argv[])
{
    gArgc = argc;
    gArgv = argv;
    
    @autoreleasepool
    {
          // run UnityFramework as main app
          id ufw = UnityFrameworkLoad();
          
          // Set UnityFramework target for Unity-iPhone/Data folder to make Data part of a UnityFramework.framework and call to setDataBundleId
          // ODR is not supported in this case, ( if you need embedded and ODR you need to copy data )
          [ufw setDataBundleId: "com.unity3d.framework"];
          [ufw runUIApplicationMainWithArgc: argc argv: argv];
    }
    
    return 0;
}

https://github.com/Unity-Technologies/uaal-example/blob/master/NativeiOSApp/NativeiOSApp/MainViewController.mm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants