From 885a023bc44fafd61f9f5a1d485f4f60c0838580 Mon Sep 17 00:00:00 2001 From: cebgcontract <99630598+cebgcontract@users.noreply.github.com> Date: Fri, 25 Nov 2022 17:00:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=8C=E7=BB=B4=E7=A0=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Classes_cocos/QrCodeViewController.h | 1 + Classes_cocos/QrCodeViewController.m | 24 +- Classes_cocos/QrCodeViewController.xib | 58 +- Classes_cocos/UIUtils.h | 16 + Classes_cocos/UIUtils.m | 80 +++ Classes_cocos/UIView+Toast.h | 446 +++++++++++++ Classes_cocos/UIView+Toast.m | 586 ++++++++++++++++++ Classes_cocos/UIViewController+Wallet.mm | 20 +- Unity-iPhone.xcodeproj/project.pbxproj | 12 + .../UserInterfaceState.xcuserstate | Bin 231401 -> 237005 bytes .../xcdebugger/Breakpoints_v2.xcbkptlist | 32 +- js/main.js | 4 +- 12 files changed, 1237 insertions(+), 42 deletions(-) create mode 100644 Classes_cocos/UIUtils.h create mode 100644 Classes_cocos/UIUtils.m create mode 100644 Classes_cocos/UIView+Toast.h create mode 100644 Classes_cocos/UIView+Toast.m diff --git a/Classes_cocos/QrCodeViewController.h b/Classes_cocos/QrCodeViewController.h index 7d83361..98fb26d 100644 --- a/Classes_cocos/QrCodeViewController.h +++ b/Classes_cocos/QrCodeViewController.h @@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong) UIImage* imgScan; @property (nonatomic, copy) NSString* content; @property (nonatomic, copy) NSString* tipTitle; +@property (nonatomic, copy) NSString* tipTxt; @property (nonatomic, assign) BOOL autosave; @end diff --git a/Classes_cocos/QrCodeViewController.m b/Classes_cocos/QrCodeViewController.m index 1d163ce..f437fc0 100644 --- a/Classes_cocos/QrCodeViewController.m +++ b/Classes_cocos/QrCodeViewController.m @@ -7,12 +7,14 @@ #import "QrCodeViewController.h" #include "LBXScanNative.h" +#include "UIUtils.h" @interface QrCodeViewController () @property (weak, nonatomic) IBOutlet UIImageView *scanImg; @property (weak, nonatomic) IBOutlet UIView *container; @property (weak, nonatomic) IBOutlet UILabel *titleLabel; @property (weak, nonatomic) IBOutlet UIButton *closeBtn; +@property (weak, nonatomic) IBOutlet UIButton *saveBtn; @property (weak, nonatomic) IBOutlet UITextView *textView; @end @@ -22,6 +24,7 @@ [super viewDidLoad]; // Do any additional setup after loading the view. [_closeBtn addTarget:self action:@selector(dismissSelf:) forControlEvents:UIControlEventTouchUpInside]; + [_saveBtn addTarget:self action:@selector(saveToLibrary:) forControlEvents:UIControlEventTouchUpInside]; self.container.backgroundColor = [UIColor whiteColor]; self.container.layer.shadowOffset = CGSizeMake(0, 2); self.container.layer.shadowRadius = 2; @@ -52,6 +55,15 @@ } _titleLabel.text = _tipTitle; _scanImg.image = _imgScan; + + if (_tipTxt) { + _textView.text = _tipTxt; + _textView.hidden = NO; + } else { + _textView.hidden = YES; + } + + _saveBtn.hidden = YES; if (_autosave) { [self saveToPhotoLibrary]; } @@ -69,9 +81,13 @@ - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo { if (error) { - NSLog(@"保存失败"); + NSLog(@"save error"); + [UIUtils showToastWithMessage: @"Error save recovery key image to System Library, Save it manually."]; + _saveBtn.hidden = NO; } else { - NSLog(@"保存成功"); + NSLog(@"save success"); + [UIUtils showToastWithMessage: @"Success save recovery key image to System Library."]; + _saveBtn.hidden = YES; } } @@ -79,4 +95,8 @@ [self dismissViewControllerAnimated:YES completion:nil]; } +-(void)saveToLibrary:(UIButton *)button{ + [self saveToPhotoLibrary]; +} + @end diff --git a/Classes_cocos/QrCodeViewController.xib b/Classes_cocos/QrCodeViewController.xib index d40373c..dccc4a7 100644 --- a/Classes_cocos/QrCodeViewController.xib +++ b/Classes_cocos/QrCodeViewController.xib @@ -13,6 +13,7 @@ + @@ -24,20 +25,45 @@ - - + + + + + + + + + + + This QR code is only used to export account recovery private key. + +1. Use CEBG client to scan the QR code to get the account recovery private key. + +2. Account of ios cannot login to Andorid device. + +3. Please keep your private key as safe as possible. + + + + + + - - + + + + + + - Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. - - - - + - +