Skip to content

Commit

Permalink
Read bytes beauty license path from bundle, modify beauty installatio…
Browse files Browse the repository at this point in the history
…n instructions
  • Loading branch information
qinhui committed Oct 29, 2024
1 parent 9be799c commit d2a01fd
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
Expand Down Expand Up @@ -105,14 +105,12 @@
<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">
<rect key="frame" x="20" y="20" width="374" height="842"/>
<string key="text">You have not turned on the Byted beauty feature, please follow the steps below:
1: enter ONLINE_LICENSE_KEY and ONLINE_LICENSE_SECRET in ByteBeautify- &gt; Manager- &gt; Core.h.
2: open the pod 'bytedEffect' comment in Podfile.
3: Create the ByteEffectLib folder in the iOS -&gt;APIExample directory
4: add a BytedEffectSDK folder under the iOS- &gt; APIExample- &gt; ByteEffectLib directory.
5: add the Resource folder under the iOS- &gt; APIExample- &gt; ByteEffectLib directory.
6: add libeffect-sdk.a libraries in the iOS- &gt; APIExample- &gt; ByteEffectLib directory.
7: execute pod install.
8: rerun the project to see the effect</string>
1:replace the Bundle identifier bound by license. open the pod 'bytedEffect' comment in Podfile.
2: Create the ByteEffectLib folder in the iOS -&gt;APIExample directory
3: add the Resource folder under the iOS- &gt; APIExample- &gt; ByteEffectLib directory.
4: add libeffect-sdk.a libraries in the iOS- &gt; APIExample- &gt; ByteEffectLib directory.
5: execute pod install.
6: rerun the project to see the effect</string>
<fontDescription key="fontDescription" name="ArialMT" family="Arial" pointSize="21"/>
<color key="textColor" red="0.20000000300000001" green="0.20000000300000001" blue="0.20000000300000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ - (id)init {
else
{
_licenseProvider->setParam("mode", "OFFLINE");
NSString *licenseName = [NSString stringWithFormat:@"/%s", LICENSE_NAME];
NSBundle *bundle = [BundleUtil bundleWithBundleName:@"ByteEffectLib" podName:@"bytedEffect"];
NSString* licensePath = [bundle pathForResource:OFFLIN_LICENSE_PATH ofType:OFFLIN_BUNDLE];
licensePath = [licensePath stringByAppendingString:licenseName];
NSString* licensePath = [self getLicensePath];
_licenseProvider->setParam("licensePath", [licensePath UTF8String]);
}
_requestProvider = new BEHttpRequestProvider;
Expand All @@ -102,6 +99,24 @@ - (id)init {
return self;
}

- (NSString *)getLicensePath {
NSString *licensePath = @"";
NSString *licenseName = @"";
NSBundle *bundle = [BundleUtil bundleWithBundleName:@"ByteEffectLib" podName:@"bytedEffect"];
licensePath = [bundle pathForResource:OFFLIN_LICENSE_PATH ofType:OFFLIN_BUNDLE];
NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
NSArray *licenseArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:licensePath error:nil];
for (NSString *license in licenseArray) {
if ([license containsString:bundleIdentifier]) {
licenseName = [NSString stringWithFormat:@"/%@", license];
break;
}
}

licensePath = [licensePath stringByAppendingString:licenseName];
return licensePath;
}

- (NSString *)licenseUrl {
NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
if ([[def objectForKey:@"licenseUrl"] isEqual: @""] || [def objectForKey:@"licenseUrl"] == nil) {
Expand Down Expand Up @@ -198,10 +213,7 @@ - (LICENSE_MODE_ENUM) licenseMode{
}

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
Expand Down Expand Up @@ -33,15 +33,14 @@
<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">
<rect key="frame" x="10" y="20" width="394" height="750"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<string key="text">You haven't turned on the phase core beauty function, please follow the following steps:
1: replace license in FUBeautify- &gt; Manager- &gt; authpack.
<mutableString key="text">You haven't turned on the phase core beauty function, please follow the following steps:
1: replace the Bundle identifier bound by license
2: open the pod 'fuLib' comment in Podfile.
3: Create FUlib folder under iOS -&gt;APIExample directory
4: add FURenderKit.framework under the iOS- &gt; APIExample- &gt; FULib directory.
5: add the Resources resource folder under the iOS- &gt; APIExample- &gt; FULib directory
6: Add Resources -&gt;Sticker Folder under iOS -&gt;APIExample -&gt;FULib

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

6: execute pod install.
7: rerun the project to see the effect</mutableString>
<fontDescription key="fontDescription" name="ArialMT" family="Arial" pointSize="21"/>
<color key="textColor" red="0.20000000300000001" green="0.20000000300000001" blue="0.20000000300000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
Expand Down Expand Up @@ -104,14 +104,13 @@
</view>
<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">
<rect key="frame" x="10" y="80" width="394" height="698"/>
<string key="text">You have not enabled the beauty feature of Shang Tang, please follow the steps below:
1: replace SENSEME.lic in SenseBeautify- &gt; Manager- &gt;.
2: replace the Bundle identifier bound by license
3: open the pod 'senseLib' comment in Podfile.
4: Create the SenseLib folder in the iOS -&gt;APIExample directory
5: add a remoteSourcesLib folder under the iOS- &gt; APIExample- &gt; SenseLib directory.
6: add the st_mobile_sdk folder under the iOS- &gt; APIExample- &gt; SenseLib directory.
7: execute pod install.
8: rerun the project to see the effect</string>
<mutableString key="text">You have not enabled the beauty feature of Shang Tang, please follow the steps below:
1: replace the Bundle identifier bound by license
2: open the pod 'SenseLib' comment in Podfile.
3: Create the SenseLib folder in the iOS -&gt;APIExample directory
4: add a resouce folder under the iOS- &gt; APIExample- &gt; SenseLib directory.
5: add the st_mobile_sdk folder and the SENSEME.lic file under the iOS- &gt; APIExample- &gt; SenseLib directory.
6: execute pod install.
7: rerun the project to see the effect</mutableString>
<fontDescription key="fontDescription" name="ArialMT" family="Arial" pointSize="21"/>
<color key="textColor" red="0.20000000300000001" green="0.20000000300000001" blue="0.20000000300000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
Expand Down

0 comments on commit d2a01fd

Please sign in to comment.