forked from dylib-Finally/executor-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathios_integration_guide.sh
More file actions
executable file
·111 lines (102 loc) · 5.03 KB
/
ios_integration_guide.sh
File metadata and controls
executable file
·111 lines (102 loc) · 5.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
# iOS Integration Guide for Roblox Executor dylib
# This script explains how to integrate the dylib with your iOS app
# Create colorful output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
echo -e "${BLUE}=====================================================${NC}"
echo -e "${BLUE} Roblox Executor iOS Integration Guide ${NC}"
echo -e "${BLUE}=====================================================${NC}"
echo ""
echo -e "${GREEN}Step 1: Build the Executor dylib${NC}"
echo "First, build the executor dylib using the build script:"
echo -e " ${YELLOW}./build_ios_dylib.sh${NC}"
echo "This will create libmylibrary.dylib in the output directory."
echo ""
echo -e "${GREEN}Step 2: Create or open your iOS project in Xcode${NC}"
echo "1. Open your iOS application project in Xcode"
echo "2. Select your project in the Navigator panel"
echo "3. Select your app target"
echo ""
echo -e "${GREEN}Step 3: Add the dylib to your Xcode project${NC}"
echo "1. Drag libmylibrary.dylib from Finder into your Xcode project"
echo "2. When prompted, check 'Copy items if needed'"
echo "3. Make sure your app target is selected"
echo "4. Go to 'Build Phases' tab"
echo "5. Expand 'Link Binary with Libraries'"
echo "6. Verify libmylibrary.dylib is listed (add it if not)"
echo "7. Add a new 'Copy Files' phase if you don't have one:"
echo " - Click '+' -> 'New Copy Files Phase'"
echo " - Set Destination to 'Frameworks'"
echo " - Add libmylibrary.dylib to this phase"
echo ""
echo -e "${GREEN}Step 4: Update Entitlements and Info.plist${NC}"
echo "1. Go to the 'Signing & Capabilities' tab"
echo "2. Add the following entitlements:"
echo " - App Sandbox (uncheck all)"
echo " - Disable Library Validation"
echo ""
echo "3. Open your Info.plist and add:"
echo -e " ${YELLOW}<key>NSAppleMusicUsageDescription</key>${NC}"
echo -e " ${YELLOW}<string>Required for loading scripts</string>${NC}"
echo ""
echo -e "${GREEN}Step 5: Load the dylib in your code${NC}"
echo "Add the following code to your app to load the dylib:"
echo -e "${YELLOW}// Objective-C${NC}"
echo -e "${YELLOW}#import <dlfcn.h>${NC}"
echo -e "${YELLOW}NSString *path = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@\"Frameworks/libmylibrary.dylib\"];${NC}"
echo -e "${YELLOW}void *handle = dlopen([path UTF8String], RTLD_NOW);${NC}"
echo -e "${YELLOW}if (handle == NULL) {${NC}"
echo -e "${YELLOW} NSLog(@\"Failed to load library: %s\", dlerror());${NC}"
echo -e "${YELLOW}} else {${NC}"
echo -e "${YELLOW} NSLog(@\"Library loaded successfully\");${NC}"
echo -e "${YELLOW} // Get function pointers${NC}"
echo -e "${YELLOW} bool (*ExecuteScript)(const char*) = dlsym(handle, \"ExecuteScript\");${NC}"
echo -e "${YELLOW} if (ExecuteScript) {${NC}"
echo -e "${YELLOW} ExecuteScript(\"print('Hello from Roblox Executor!')\");${NC}"
echo -e "${YELLOW} }${NC}"
echo -e "${YELLOW}}${NC}"
echo ""
echo -e "${YELLOW}// Swift${NC}"
echo -e "${YELLOW}import Foundation${NC}"
echo -e "${YELLOW}func loadExecutor() {${NC}"
echo -e "${YELLOW} let bundlePath = Bundle.main.bundlePath${NC}"
echo -e "${YELLOW} let path = bundlePath + \"/Frameworks/libmylibrary.dylib\"${NC}"
echo -e "${YELLOW} let handle = dlopen(path, RTLD_NOW)${NC}"
echo -e "${YELLOW} if handle == nil {${NC}"
echo -e "${YELLOW} print(\"Failed to load library: \(String(cString: dlerror()))\")${NC}"
echo -e "${YELLOW} } else {${NC}"
echo -e "${YELLOW} print(\"Library loaded successfully\")${NC}"
echo -e "${YELLOW} // Get function pointers${NC}"
echo -e "${YELLOW} let ExecuteScript = unsafeBitCast(dlsym(handle, \"ExecuteScript\"), to: (@convention(c) (UnsafePointer<CChar>) -> Bool).self)${NC}"
echo -e "${YELLOW} ExecuteScript(\"print('Hello from Roblox Executor!')\"})${NC}"
echo -e "${YELLOW} }${NC}"
echo -e "${YELLOW}}${NC}"
echo ""
echo -e "${GREEN}Step 6: Troubleshooting${NC}"
echo "Common issues and solutions:"
echo ""
echo "1. Library not loading (dlopen error):"
echo " - Check that the dylib is correctly copied to the app bundle"
echo " - Verify code signing and entitlements"
echo " - Check console logs for detailed error messages"
echo ""
echo "2. Symbols not found when calling functions:"
echo " - Make sure you're using the correct function names"
echo " - Try using nm tool to verify exported symbols: nm -g libmylibrary.dylib"
echo ""
echo "3. App crashing when using the library:"
echo " - Check that all required frameworks are linked"
echo " - Ensure you have the latest version of the dylib"
echo " - Look for compatibility issues with iOS version"
echo ""
echo "4. App rejected by App Store:"
echo " - This library is for development/research purposes only"
echo " - Consider using it only in debug builds or Ad-Hoc distribution"
echo ""
echo -e "${BLUE}=====================================================${NC}"
echo -e "${GREEN}That's it! Your iOS app should now be able to use the Roblox Executor functionality.${NC}"
echo -e "${BLUE}=====================================================${NC}"