You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-27Lines changed: 32 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ Once you are comfortable using *PPiOS-Rename*, it can be easier to use if you in
113
113
114
114
9. Rename the phase from `Run Script` to `Analyze Binary`.
115
115
116
-
10. Expand the phase, and where it says `Type a script or ...`, paste the following script, adjusting for the correct path:
116
+
10. Expand the phase, and replace the shell script comment that says `# Type a script or ...`, pasting the following script (adjusting for the correct path):
@@ -136,7 +136,7 @@ Once you are comfortable using *PPiOS-Rename*, it can be easier to use if you in
136
136
137
137
16. Add a script phase, and rename it to `Apply Renaming to Sources` (this should be the only real action for this target).
138
138
139
-
17. Paste the following script, again adjusting for the correct path:
139
+
17. Paste the following script (adjusting for the correct path):
140
140
141
141
PATH="$PATH:$HOME/Downloads/PPiOS-Rename-v1.3.0"
142
142
ppios-rename --obfuscate-sources
@@ -421,48 +421,50 @@ The procedure is as follows:
421
421
422
422
2. From within the workspace, create a new project:
423
423
1. In Xcode, go to `File` > `New` > `Project ...`.
424
-
2. Select `iOS`, and under the `Application` section select `Single View Application`.
425
-
3. When choosing the options, specify the `Product Name` as `WrappingApp`, and be sure to select Objective-C as the language.
426
-
4. Specify the directory to store the `WrappingApp` project as a sibling of the static library's project directory. These instructions expect a source tree layout like the following, with everything under `someParentDir` under source control:
427
-
428
-
someParentDir/StaticLib/StaticLib.xcodeproj
429
-
someParentDir/LibWorkspace.xcworkspace
430
-
someParentDir/WrappingApp/WrappingApp.xcodeproj
431
-
432
-
5. At the bottom of this dialog, specify `Add to:` the `LibWorkspace` workspace, and select `Create`.
433
-
6. Select the WrappingApp target, then clean and build the project to verify that the project builds.
434
-
7. Go to the Project Navigator, select the `WrappingApp` project, and select the `WrappingApp` target.
435
-
8. Select `General`, scroll to the bottom, and select the `+` to add to the list of `Linked Frameworks and Libraries`.
436
-
9. Add `libStaticLib.a`. This should appear under the `Workspace` section in the dialog. You may need to close and reopen `LibWorkspace` after adding `StaticLib` in order to get it to appear correctly.
437
-
10. Select `Build Settings`, search for `other linker`, and set `Other Linker Flags` to include `-ObjC`.
438
-
11. Clean and build again to verify that the workspace builds correctly. It should build the static library first and then the app.
424
+
2. Select `iOS`, then under the `Application` section select `Single View App`, and then select `Next`.
425
+
3. For the options: specify the `Product Name` as `WrappingApp` and be sure to select Objective-C as the language, then select `Next`.
426
+
4. Create the project:
427
+
1. Specify the directory to store the `WrappingApp` project as a sibling of the static library's project directory. These instructions expect a source tree layout like the following, with everything under `someParentDir` under source control:
428
+
429
+
someParentDir/StaticLib/StaticLib.xcodeproj
430
+
someParentDir/LibWorkspace.xcworkspace
431
+
someParentDir/WrappingApp/WrappingApp.xcodeproj
432
+
433
+
2. At the bottom of the dialog, specify `Add to:` the `LibWorkspace` workspace.
434
+
3. Select `Create`.
435
+
436
+
5. Select the WrappingApp target, then `Product` > `Build` to verify that the project builds.
437
+
6. Go to the Project Navigator, select the `WrappingApp` project, and select the `WrappingApp` target.
438
+
7. Select `General`, scroll to the bottom, and select the `+` to add to the list of `Linked Frameworks and Libraries`.
439
+
8. Add `libStaticLib.a`.
440
+
9. Select `Build Settings`, search for `other linker`, and set `Other Linker Flags` to include `-ObjC`.
441
+
10. Select `Product` > `Clean Build Folder` and build again to verify that the workspace builds correctly. It should build the static library first and then the app.
439
442
440
443
3. Setup *PPiOS-Rename* to analyze the app:
441
444
1. Follow instructions [5-12 in `Project Setup` above](#configureAnalyze), but apply them to `WrappingApp`, rather than the static library, and modify the original `WrappingApp` target. Duplication of the target is unnecessary.
442
-
2. You may need to close and re-open the workspace to get Xcode to use the correct target name in the report navigator.
443
-
3. <aname="countUniqueSymbols"></a>Clean and build the `Build and Analyze WrappingApp` target.
444
-
4. Review the build log in the report navigator and look for the number of `Generated unique symbols`. This number should include all of the public and all of the non-public symbols from `StaticLib`. This will also include a small number of symbols from classes in the app itself. These should be benign, but can be excluded manually if necessary.
445
-
5. Create a list of public types for the static library named `public-types.list`. Either create the list using the following procedure, or create the list manually. The procedure requires that the names of the public header files match the names of the types, or follow `AffectedType+CategoryName.h` convention.
445
+
2. <aname="countUniqueSymbols"></a>Clean and build the `Build and Analyze WrappingApp` target.
446
+
3. Review the build log in the report navigator and look for the number of `Generated unique symbols`. This number should include all of the public and all of the non-public symbols from `StaticLib`. This will also include a small number of symbols from classes in the app itself. Symbols from the app should be benign, but can be excluded manually if necessary.
447
+
4. Create a list of public types for the static library named `public-types.list`. Either create the list using the following procedure, or create the list manually. The procedure requires that the names of the public header files match the names of the types, or follow the `AffectedType+CategoryName.h` convention.
446
448
1. Go to the Report Navigator, review the log for a build of `StaticLib`, select a copy file task for one of the header files, right-click and `Copy`.
447
449
2. Paste the result in a text editor.
448
450
3. Select and copy the build output path. This should have the form: `<products-directory>/include/StaticLib`, and contain the string `/DerivedData/`.
449
451
4. At a command line, run the following commands, from `someParentDir`:
450
452
451
-
# Replace ".../include/StaticLib" with the path
453
+
# Replace ".../include/StaticLib" with the build output path
452
454
# Replace "StaticLib" with the name of the umbrella header
453
455
ls ".../include/StaticLib" | sed 's/.*+//' | sed 's/[.]h$//' | grep -v StaticLib > public-types.list
454
456
# Or omit the grep -v part if you have no umbrella header
455
457
ls ".../include/StaticLib" | sed 's/.*+//' | sed 's/[.]h$//' > public-types.list
456
458
# verify the contents
457
-
head public-types.list
459
+
less public-types.list
458
460
# SLAPublicClass
459
461
# SLProtocolForSomething
460
462
# SLSomeCategory
461
463
# ...
462
464
463
465
>Note: This is an additional point of maintenance: as types are added to or removed from the public API of the library, the `public-types.list` will need to be updated accordingly.
464
466
465
-
6. Replace the analyze script (`Analyze Binary` run script phase) with the following to exclude the public types from renaming:
467
+
5. Replace the analyze script (`Analyze Binary` run script phase) with the following to exclude the public types from renaming:
@@ -472,13 +474,16 @@ The procedure is as follows:
472
474
$(for each in $(cat ../public-types.list) ; do printf -- '-F !%s ' "$each" ; done) \
473
475
"$BUILT_PRODUCTS_DIR/$EXECUTABLE_PATH"
474
476
475
-
7. Repeat steps [3.iii - 3.iv](#countUniqueSymbols). The number of unique symbols should decrease, but still be significant. This should be the count of all of the non-public symbols (non-public symbols for which there are not public symbols with the same name).
476
-
8. Review the list of types that will be renamed by executing the following at a command line (assuming all of the type names are prefixed with the two letters `SL`):
477
+
6. Repeat steps [3.ii - 3.iii](#countUniqueSymbols). The number of unique symbols should decrease, but still be significant. This should be the count of all of the non-public symbols (non-public symbols for which there are not public symbols with the same name).
478
+
7. Review the list of types that will be renamed by executing the following at a command line, from `someParentDir` (assumes all of the type names are prefixed with the two letters `SL`):
8. Adjust `public-types.list` as necessary to ensure that all public types are not renamed.
479
484
480
485
4. Modify the static library project to apply the renaming:
481
-
1. Follow instructions [13-16 in `Project Setup` above](#configureRenaming), applying them to the static library target.
486
+
1. Follow instructions [13-16 in `Project Setup` above](#configureRenaming), applying them to the `StaticLib` target (duplicating the target this time).
482
487
2. The call to `ppios-rename` needs to reference the `symbols.map` file from the WrappingApp project, using the `--symbols-map` option. Use this script for the new Run Script phase (adjusting the path as necessary):
0 commit comments