Convert static structure to dynamic

I want to convert a static iOS infrastructure ( https://github.com/comScore/ComScore-iOS-watchOS-tvOS/tree/master/ComScore/iOS ) to dynamic.

> clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -lc++ -F . -framework ComScore -ObjC -o ComScoreDynamic

This command is successful, but there is a problem with the visibility of the character.

When I check the characters in the original structure, this is about 4 thousand public characters:

> nm -gU ComScore.framework/ComScore | wc -l 4387

In the dynamic version, only very few of them are:

nm -gU ComScoreDynamic
0000000000114af8 S _OBJC_CLASS_$_SCORCommonUtils 0000000000114940 S _OBJC_CLASS_$_SCORCrossPublisherIdSourceValue 0000000000114a08 S _OBJC_CLASS_$_SCORHTTP 0000000000114990 S _OBJC_CLASS_$_SCORHelper 0000000000114aa8 S _OBJC_CLASS_$_SCORObfuscation 0000000000114a80 S _OBJC_CLASS_$_SCORReachability 0000000000114918 S _OBJC_CLASS_$_SCORUniqueId 0000000000114b20 S _OBJC_METACLASS_$_SCORCommonUtils 00000000001149e0 S _OBJC_METACLASS_$_SCORCrossPublisherIdSourceValue 0000000000114a30 S _OBJC_METACLASS_$_SCORHTTP 0000000000114968 S _OBJC_METACLASS_$_SCORHelper 0000000000114ad0 S _OBJC_METACLASS_$_SCORObfuscation 0000000000114a58 S _OBJC_METACLASS_$_SCORReachability 00000000001149b8 S _OBJC_METACLASS_$_SCORUniqueId 00000000001166b0 D __ZTINSt3__117bad_function_callE 00000000000d5d60 S __ZTSNSt3__117bad_function_callE

All other characters are marked as internal ( tand s).

How to save external characters?

UPDATE:

It looks like this could be a similar problem: Export `OBJC_CLASS` from one static library as part of another

, static lib private_extern, .

+4
1

comScore private external. nm SCORAnalytics:

nm -m ComScore/iOS/ComScore.framework/Versions/A/ComScore  |grep _OBJC_CLASS_\$_SCORAnalytics

:

---------------- (LTO,DATA) private external _OBJC_CLASS_$_SCORAnalytics

, . Cocoapods ( "" ) , extern. , . , Swift ; .

, comScore . comScore , iOS 8 ; comScore iOS 6. .

, comScore Cocoapod Podspec, Obj-C, Swift. , Cocoapod , comScore . , comScore, , , , , . YMMV.

+1

Source: https://habr.com/ru/post/1675632/


All Articles