Skip to content

Commit d2a01fd

Browse files
author
qinhui
committed
Read bytes beauty license path from bundle, modify beauty installation instructions
1 parent 9be799c commit d2a01fd

File tree

4 files changed

+46
-38
lines changed

4 files changed

+46
-38
lines changed

iOS/APIExample/APIExample/Examples/Advanced/ThirdBeautify/ByteBeautify/Base.lproj/BytedEffect.storyboard

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
77
<capability name="Named colors" minToolsVersion="9.0"/>
88
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
99
<capability name="System colors in document resources" minToolsVersion="11.0"/>
@@ -105,14 +105,12 @@
105105
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j6s-Pm-fSS">
106106
<rect key="frame" x="20" y="20" width="374" height="842"/>
107107
<string key="text">You have not turned on the Byted beauty feature, please follow the steps below:
108-
1: enter ONLINE_LICENSE_KEY and ONLINE_LICENSE_SECRET in ByteBeautify- &gt; Manager- &gt; Core.h.
109-
2: open the pod 'bytedEffect' comment in Podfile.
110-
3: Create the ByteEffectLib folder in the iOS -&gt;APIExample directory
111-
4: add a BytedEffectSDK folder under the iOS- &gt; APIExample- &gt; ByteEffectLib directory.
112-
5: add the Resource folder under the iOS- &gt; APIExample- &gt; ByteEffectLib directory.
113-
6: add libeffect-sdk.a libraries in the iOS- &gt; APIExample- &gt; ByteEffectLib directory.
114-
7: execute pod install.
115-
8: rerun the project to see the effect</string>
108+
1:replace the Bundle identifier bound by license. open the pod 'bytedEffect' comment in Podfile.
109+
2: Create the ByteEffectLib folder in the iOS -&gt;APIExample directory
110+
3: add the Resource folder under the iOS- &gt; APIExample- &gt; ByteEffectLib directory.
111+
4: add libeffect-sdk.a libraries in the iOS- &gt; APIExample- &gt; ByteEffectLib directory.
112+
5: execute pod install.
113+
6: rerun the project to see the effect</string>
116114
<fontDescription key="fontDescription" name="ArialMT" family="Arial" pointSize="21"/>
117115
<color key="textColor" red="0.20000000300000001" green="0.20000000300000001" blue="0.20000000300000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
118116
<nil key="highlightedColor"/>

iOS/APIExample/APIExample/Examples/Advanced/ThirdBeautify/ByteBeautify/Manager/BELicenseHelper.mm

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ - (id)init {
8888
else
8989
{
9090
_licenseProvider->setParam("mode", "OFFLINE");
91-
NSString *licenseName = [NSString stringWithFormat:@"/%s", LICENSE_NAME];
92-
NSBundle *bundle = [BundleUtil bundleWithBundleName:@"ByteEffectLib" podName:@"bytedEffect"];
93-
NSString* licensePath = [bundle pathForResource:OFFLIN_LICENSE_PATH ofType:OFFLIN_BUNDLE];
94-
licensePath = [licensePath stringByAppendingString:licenseName];
91+
NSString* licensePath = [self getLicensePath];
9592
_licenseProvider->setParam("licensePath", [licensePath UTF8String]);
9693
}
9794
_requestProvider = new BEHttpRequestProvider;
@@ -102,6 +99,24 @@ - (id)init {
10299
return self;
103100
}
104101

102+
- (NSString *)getLicensePath {
103+
NSString *licensePath = @"";
104+
NSString *licenseName = @"";
105+
NSBundle *bundle = [BundleUtil bundleWithBundleName:@"ByteEffectLib" podName:@"bytedEffect"];
106+
licensePath = [bundle pathForResource:OFFLIN_LICENSE_PATH ofType:OFFLIN_BUNDLE];
107+
NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
108+
NSArray *licenseArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:licensePath error:nil];
109+
for (NSString *license in licenseArray) {
110+
if ([license containsString:bundleIdentifier]) {
111+
licenseName = [NSString stringWithFormat:@"/%@", license];
112+
break;
113+
}
114+
}
115+
116+
licensePath = [licensePath stringByAppendingString:licenseName];
117+
return licensePath;
118+
}
119+
105120
- (NSString *)licenseUrl {
106121
NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
107122
if ([[def objectForKey:@"licenseUrl"] isEqual: @""] || [def objectForKey:@"licenseUrl"] == nil) {
@@ -198,10 +213,7 @@ - (LICENSE_MODE_ENUM) licenseMode{
198213
}
199214

200215
- (bool)checkLicense {
201-
NSString *licenseName = [NSString stringWithFormat:@"/%s", LICENSE_NAME];
202-
NSBundle *bundle = [BundleUtil bundleWithBundleName:@"ByteEffectLib" podName:@"bytedEffect"];
203-
NSString* licensePath = [bundle pathForResource:OFFLIN_LICENSE_PATH ofType:OFFLIN_BUNDLE];
204-
licensePath = [licensePath stringByAppendingString:licenseName];
216+
NSString* licensePath = [self getLicensePath];
205217
return [self checkLicenseOK:[licensePath UTF8String]];
206218
}
207219

iOS/APIExample/APIExample/Examples/Advanced/ThirdBeautify/FUBeautify/Base.lproj/FUBeautify.storyboard

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
77
<capability name="Named colors" minToolsVersion="9.0"/>
88
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
99
<capability name="System colors in document resources" minToolsVersion="11.0"/>
@@ -33,15 +33,14 @@
3333
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j6s-Pm-fSS">
3434
<rect key="frame" x="10" y="20" width="394" height="750"/>
3535
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
36-
<string key="text">You haven't turned on the phase core beauty function, please follow the following steps:
37-
1: replace license in FUBeautify- &gt; Manager- &gt; authpack.
36+
<mutableString key="text">You haven't turned on the phase core beauty function, please follow the following steps:
37+
1: replace the Bundle identifier bound by license
3838
2: open the pod 'fuLib' comment in Podfile.
39-
3: Create FUlib folder under iOS -&gt;APIExample directory
40-
4: add FURenderKit.framework under the iOS- &gt; APIExample- &gt; FULib directory.
41-
5: add the Resources resource folder under the iOS- &gt; APIExample- &gt; FULib directory
42-
6: Add Resources -&gt;Sticker Folder under iOS -&gt;APIExample -&gt;FULib

43-
7: execute pod install.
44-
8: rerun the project to see the effect</string>
39+
3: Create FULib folder under iOS -&gt;APIExample directory
40+
4: add the authpack.h file under the iOS- &gt; APIExample- &gt; FULib directory
41+
5: add Resources "sticker", "Animoji", "makeup" folder under iOS -&gt;APIExample -&gt;FULib

42+
6: execute pod install.
43+
7: rerun the project to see the effect</mutableString>
4544
<fontDescription key="fontDescription" name="ArialMT" family="Arial" pointSize="21"/>
4645
<color key="textColor" red="0.20000000300000001" green="0.20000000300000001" blue="0.20000000300000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
4746
<nil key="highlightedColor"/>

iOS/APIExample/APIExample/Examples/Advanced/ThirdBeautify/SenseBeautify/Base.lproj/SenseBeautify.storyboard

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
77
<capability name="Named colors" minToolsVersion="9.0"/>
88
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
99
<capability name="System colors in document resources" minToolsVersion="11.0"/>
@@ -104,14 +104,13 @@
104104
</view>
105105
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j6s-Pm-fSS">
106106
<rect key="frame" x="10" y="80" width="394" height="698"/>
107-
<string key="text">You have not enabled the beauty feature of Shang Tang, please follow the steps below:
108-
1: replace SENSEME.lic in SenseBeautify- &gt; Manager- &gt;.
109-
2: replace the Bundle identifier bound by license
3: open the pod 'senseLib' comment in Podfile.
110-
4: Create the SenseLib folder in the iOS -&gt;APIExample directory
111-
5: add a remoteSourcesLib folder under the iOS- &gt; APIExample- &gt; SenseLib directory.
112-
6: add the st_mobile_sdk folder under the iOS- &gt; APIExample- &gt; SenseLib directory.
113-
7: execute pod install.
114-
8: rerun the project to see the effect</string>
107+
<mutableString key="text">You have not enabled the beauty feature of Shang Tang, please follow the steps below:
108+
1: replace the Bundle identifier bound by license
2: open the pod 'SenseLib' comment in Podfile.
109+
3: Create the SenseLib folder in the iOS -&gt;APIExample directory
110+
4: add a resouce folder under the iOS- &gt; APIExample- &gt; SenseLib directory.
111+
5: add the st_mobile_sdk folder and the SENSEME.lic file under the iOS- &gt; APIExample- &gt; SenseLib directory.
112+
6: execute pod install.
113+
7: rerun the project to see the effect</mutableString>
115114
<fontDescription key="fontDescription" name="ArialMT" family="Arial" pointSize="21"/>
116115
<color key="textColor" red="0.20000000300000001" green="0.20000000300000001" blue="0.20000000300000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
117116
<nil key="highlightedColor"/>

0 commit comments

Comments
 (0)