rhodes 7.5.1 → 7.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +319 -0
- data/README.md +3 -15
- data/Rakefile +3 -0
- data/appveyor.yml +37 -32
- data/azure-pipelines.yml +1 -1
- data/bin/rhodes-setup +22 -8
- data/extensions/emdk3-manager/ext/platform/android/src/com/rho/emdk3/EMDK3Extension.java +14 -5
- data/extensions/instrumentation/ext/platform/android/src/com/rho/instrumentation/Instrumentation.java +29 -15
- data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/src/com/rhomobile/rhoelements/ans/ANSManager.java +1 -1
- data/extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/ElementsCore.java +12 -9
- data/extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/BatteryIndicator.java +2 -2
- data/lib/commonAPI/barcode/ext/platform/qt/Barcode.pro +1 -1
- data/lib/commonAPI/barcode/ext/platform/qt/Barcode.pro.erb +2 -2
- data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/QZXing.pri +9 -21
- data/lib/commonAPI/barcode/ext.yml +1 -0
- data/lib/commonAPI/bluetooth/ext/platform/qt/Bluetooth.pro +1 -1
- data/lib/commonAPI/bluetooth/ext/platform/qt/Bluetooth.pro.erb +1 -1
- data/lib/commonAPI/bluetooth/ext/platform/qt/src/bluetooth/bluetoothhelper.h +1 -1
- data/lib/commonAPI/coreapi/RhoSystemApi.rb +6 -0
- data/lib/commonAPI/coreapi/ext/Intent.xml +4 -0
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/intent/IntentSingleton.java +6 -0
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/Notification.java +2 -1
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationScheduler.java +1 -1
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/webview/WebViewSingleton.java +40 -27
- data/lib/commonAPI/coreapi/ext/platform/iphone/cpp_based_impl/SystemImpl.mm +5 -6
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/Intent.h +1 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/Intent.m +3 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NotificationSingleton.h +2 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NotificationSingleton.m +10 -0
- data/lib/commonAPI/coreapi/ext/platform/wm/src/IntentImpl.cpp +3 -0
- data/lib/commonAPI/coreapi/ext/shared/SystemImplBase.cpp +13 -0
- data/lib/commonAPI/coreapi/ext/shared/SystemImplBase.h +2 -0
- data/lib/commonAPI/coreapi/ext/system.xml +3 -0
- data/lib/commonAPI/mediacapture/ext/platform/android/ApplicationCameraActivity.erb +2 -2
- data/lib/commonAPI/mediacapture/ext/platform/android/ApplicationFileProvider.erb +1 -1
- data/lib/commonAPI/mediacapture/ext/platform/android/ext_java.files +1 -0
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraObject.java +8 -4
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraRhoListener.java +8 -0
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/mediacapture/RhoCameraFileProvider.java +6 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/MediaCapture.pro.erb +1 -1
- data/lib/commonAPI/mediacapture/ext/platform/qt/Mediacapture.pro +1 -1
- data/lib/commonAPI/signature/ext/platform/iphone/impl/readme.txt +7 -0
- data/lib/commonAPI/signature/ext/platform/qt/Signature.pro +3 -10
- data/lib/commonAPI/signature/ext/platform/qt/Signature.pro.erb +2 -2
- data/lib/extensions/fcm-push/ext/iphone/Podfile +15 -2
- data/lib/extensions/fcm-push/ext/iphone/fcm-push.xcodeproj/project.pbxproj +6 -7
- data/lib/extensions/nfc/ext/platform/android/src/com/rhomobile/nfc/Nfc.java +2 -1
- data/lib/extensions/serialport/ext/serialport.pro +1 -1
- data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +1 -0
- data/platform/android/Rhodes/jni/src/fileapi.cpp +4 -0
- data/platform/android/Rhodes/res/drawable/baseline_check_24.xml +5 -0
- data/platform/android/Rhodes/res/drawable/baseline_check_240.xml +5 -0
- data/platform/android/Rhodes/res/drawable/baseline_close_24.xml +5 -0
- data/platform/android/Rhodes/res/drawable/baseline_close_240.xml +5 -0
- data/platform/android/Rhodes/res/layout/overlay_layout.xml +39 -0
- data/platform/android/Rhodes/res/layout/perrmission_alert_dialog.xml +267 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +183 -66
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +38 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoFileProvider.java +32 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +529 -89
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +26 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +256 -160
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +14 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +4 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +5 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +79 -38
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +6 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/CallReceiver.java +22 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/IKioskMode.java +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/KioskManager.java +18 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyAccessibilityService.java +230 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyNotificationListenerService.java +16 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyOverlayService.java +197 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/PermissionManager.java +232 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +34 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/permissioncheck/CheckDrawable.java +53 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/permissioncheck/PermissionListGenerate.java +366 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/rhodes.iml +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +782 -41
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoInputConnectionWrapper.java +146 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoInputListener.java +21 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +92 -32
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/TauWebViewOptions.java +118 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebSettingsProviderBase.java +18 -17
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebSettingsProviderEclairMR1.java +4 -4
- data/platform/android/build/RhodesSRC_build.files +13 -0
- data/platform/android/build/android-repack.rake +8 -1
- data/platform/android/build/android.rake +118 -51
- data/platform/android/build/android_tools.rb +1 -1
- data/platform/android/build/androidcommon.rb +13 -7
- data/platform/android/build/config.yml +4 -1
- data/platform/android/build/manifest_generator.rb +14 -10
- data/platform/android/build/maven_deps_extractor.rb +7 -1
- data/platform/android/build/ndkwrapper.rb +12 -0
- data/platform/android/proguard/proguard-base-rules.pro +5 -0
- data/platform/android/proguard/proguard.jar +0 -0
- data/platform/iphone/Classes/RhoAppBaseLib-Bridging-Header.h +4 -0
- data/platform/iphone/Classes/RhoAppBaseStandaloneLib-Bridging-Header.h +4 -0
- data/platform/iphone/Classes/RhoCryptAESGCM.swift +105 -0
- data/platform/iphone/Classes/RhoUIWebView.h +1 -1
- data/platform/iphone/Classes/RhoUIWebView.m +1 -1
- data/platform/iphone/Classes/RhoWKWebView.h +1 -1
- data/platform/iphone/Classes/RhoWKWebView.mm +32 -4
- data/platform/iphone/Classes/RhoWebView.h +1 -1
- data/platform/iphone/Classes/RhoWebViewFabrique.m +7 -1
- data/platform/iphone/Classes/SimpleMainView.m +5 -5
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +21 -10
- data/platform/iphone/Classes/rho/net/IPhoneNetRequest.mm +4 -0
- data/platform/iphone/Framework/RhoApplication/RhoApplication.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/Framework/Rhodes/Rhodes.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/RhoAppBaseLib/RhoAppBaseLib.xcodeproj/project.pbxproj +46 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +4 -1
- data/platform/iphone/rbuild/iphone.rake +9 -8
- data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +4 -1
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +1 -1
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app.zip +0 -0
- data/platform/sailfish/build/{harbour-SailfishRhodes.pro.erb → SailfishRhodes.pro.erb} +10 -17
- data/platform/sailfish/build/rhodes.pro.erb +7 -17
- data/platform/sailfish/build/rpm/SailfishRhodes.desktop.erb +12 -0
- data/platform/sailfish/build/rpm/SailfishRhodes.erb +2 -0
- data/platform/sailfish/build/rpm/SailfishRhodes.spec.erb +43 -0
- data/platform/sailfish/build/rubylib.pro.erb +29 -29
- data/platform/sailfish/build/sailfish.rake +188 -180
- data/platform/sailfish/keys/regular_cert.pem +14 -0
- data/platform/sailfish/keys/regular_key.pem +4 -0
- data/platform/shared/common/RhodesApp.cpp +33 -9
- data/platform/shared/common/iphone/RhoCryptImpl.mm +130 -54
- data/platform/shared/qt/RhoSimulator.pro +1 -1
- data/platform/shared/qt/rhodes/rhodes.pro +4 -11
- data/platform/shared/qt/sailfish/SailfishRhodes.desktop +3 -4
- data/platform/shared/qt/sailfish/SailfishRhodes.pro +9 -10
- data/platform/shared/qt/sailfish/icons/108x108/108x108.png +0 -0
- data/platform/shared/qt/sailfish/privileges/sailfishrhodes +2 -0
- data/platform/shared/qt/sailfish/qml/pages/FirstPageWK.qml +7 -11
- data/platform/shared/qt/sailfish/qml/{harbour-sailfishrhodes.qml → sailfishrhodes.qml} +1 -1
- data/platform/shared/qt/sailfish/rpm/sailfishrhodes.spec +80 -0
- data/platform/shared/qt/sailfish/rpm/{harbour-sailfishrhodes.yaml → sailfishrhodes.yaml} +2 -2
- data/platform/shared/qt/sailfish/src/QtMainWindow.cpp +1 -1
- data/platform/shared/qt/sailfish/src/QtMainWindow.h +1 -1
- data/platform/shared/qt/sailfish/src/main.cpp +6 -38
- data/platform/shared/qt/sailfish/src/rootdelegate.h +2 -14
- data/platform/shared/ruby/aurora/ruby/config.h +386 -0
- data/platform/shared/ruby/aurora/ruby/constdefs.c +5866 -0
- data/platform/shared/ruby/aurora/ruby/constdefs.h +1788 -0
- data/platform/shared/sqlite/crypto.c +14 -0
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/win32/build/rhodes.nsi +3 -3
- data/platform/win32/build/win32.rake +1 -1
- data/rakefile.rb +3 -0
- data/res/build-tools/iphonesim/build/Release/iphonesim_8 +4 -4
- data/res/generators/templates/application/AndroidManifest.erb +26 -5
- data/res/generators/templates/application/build.yml +14 -10
- data/res/generators/templates/application/resources/android/res/xml/provider_paths.xml +4 -0
- data/res/generators/templates/application/rhoconfig.txt +10 -1
- data/res/generators/templates/iphone_project/Bremen8.xcodeproj/project.pbxproj +24 -1
- data/res/generators/templates/iphone_project/Classes/SimpleSwiftClass.swift +20 -0
- data/res/generators/templates/iphone_project/Classes/rhorunner-Bridging-Header.h +4 -0
- data/rhobuild.yml.example +3 -3
- data/rhodes.gemspec +4 -2
- data/version +1 -1
- metadata +81 -26
- data/platform/sailfish/build/rho_build.cmd.erb +0 -14
- data/platform/sailfish/build/rho_clean.cmd.erb +0 -14
- data/platform/sailfish/build/rho_deploy.cmd.erb +0 -15
- data/platform/sailfish/build/rho_rpm.cmd.erb +0 -14
- data/platform/sailfish/build/rho_rpmvalidation.cmd.erb +0 -14
- data/platform/sailfish/build/rpm/harbour-SailfishRhodes.desktop.erb +0 -7
- data/platform/sailfish/build/rpm/harbour-SailfishRhodes.erb +0 -2
- data/platform/sailfish/build/rpm/harbour-SailfishRhodes.yaml.erb +0 -37
- data/platform/shared/qt/sailfish/harbour-sailfishrhodes.desktop +0 -6
- data/platform/shared/qt/sailfish/icons/108x108/harbour-sailfishrhodes.png +0 -0
- data/platform/shared/qt/sailfish/privileges/harbour-sailfishrhodes +0 -2
- data/platform/shared/qt/sailfish/qml/pages/FirstPageWE.qml +0 -236
- /data/platform/shared/qt/sailfish/icons/128x128/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
- /data/platform/shared/qt/sailfish/icons/172x172/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
- /data/platform/shared/qt/sailfish/icons/86x86/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
@@ -37,6 +37,7 @@ require File.dirname(__FILE__) + '/../../../lib/build/BuildConfig'
|
|
37
37
|
|
38
38
|
require_relative 'dex_builder'
|
39
39
|
require_relative 'build_tools_finder'
|
40
|
+
require_relative 'ndkwrapper'
|
40
41
|
|
41
42
|
load File.dirname(__FILE__) + '/android-repack.rake'
|
42
43
|
require 'pathname'
|
@@ -62,8 +63,8 @@ JAVA_PACKAGE_NAME = 'com.rhomobile.rhodes'
|
|
62
63
|
# For complete list of android API levels and its mapping to
|
63
64
|
# market names (such as "Android-1.5" etc) see output of
|
64
65
|
# command "android list targets"
|
65
|
-
ANDROID_MIN_SDK_LEVEL =
|
66
|
-
ANDROID_SDK_LEVEL =
|
66
|
+
ANDROID_MIN_SDK_LEVEL = 26 #21 is the minimum API that supports arm64
|
67
|
+
ANDROID_SDK_LEVEL = 32
|
67
68
|
|
68
69
|
ANDROID_PERMISSIONS = {
|
69
70
|
'audio' => ['RECORD_AUDIO', 'MODIFY_AUDIO_SETTINGS'],
|
@@ -80,7 +81,8 @@ ANDROID_PERMISSIONS = {
|
|
80
81
|
'read_sdcard' => 'READ_EXTERNAL_STORAGE',
|
81
82
|
'push' => nil,
|
82
83
|
'shared_runtime' => nil,
|
83
|
-
'hardware_acceleration' => nil
|
84
|
+
'hardware_acceleration' => nil,
|
85
|
+
'install_packages' => 'REQUEST_INSTALL_PACKAGES'
|
84
86
|
}
|
85
87
|
|
86
88
|
ANDROID_CAPS_ALWAYS_ENABLED = ['network_state']
|
@@ -557,25 +559,35 @@ def get_case_insensetive_property(property)
|
|
557
559
|
return nil
|
558
560
|
end
|
559
561
|
|
560
|
-
def select_aapt2
|
562
|
+
def select_aapt2(build_tools_path)
|
561
563
|
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
platform_dir = 'osx'
|
568
|
-
elsif OS.linux?
|
569
|
-
platform_dir = 'linux'
|
564
|
+
aapt2 = nil
|
565
|
+
|
566
|
+
buildToolsVerMajor = $build_tools_ver&.split('.')[0].to_i
|
567
|
+
if ( buildToolsVerMajor >= 34 )
|
568
|
+
aapt2 = File.join(build_tools_path,'aapt2'+$exe_ext)
|
570
569
|
else
|
571
|
-
|
572
|
-
|
570
|
+
platform_dir = ''
|
571
|
+
|
572
|
+
if OS.windows?
|
573
|
+
platform_dir = 'windows'
|
574
|
+
elsif OS.mac?
|
575
|
+
platform_dir = 'osx'
|
576
|
+
elsif OS.linux?
|
577
|
+
platform_dir = 'linux'
|
578
|
+
else
|
579
|
+
raise "unknown host OS"
|
580
|
+
end
|
573
581
|
|
574
|
-
|
582
|
+
aapt2 = File.join($startdir, "res", "build-tools", "aapt2", platform_dir , 'aapt2'+$exe_ext)
|
583
|
+
end
|
584
|
+
|
585
|
+
$logger.debug( "AAPT2 path is: #{aapt2}")
|
586
|
+
return aapt2
|
575
587
|
end
|
576
588
|
|
577
589
|
|
578
|
-
def init_aapt2_helper
|
590
|
+
def init_aapt2_helper( build_tools_path )
|
579
591
|
helper = Aapt2Helper.instance
|
580
592
|
|
581
593
|
helper.logger = $logger
|
@@ -589,7 +601,7 @@ def init_aapt2_helper
|
|
589
601
|
helper.androidjar = $androidjar
|
590
602
|
helper.manifest = $appmanifest
|
591
603
|
|
592
|
-
helper.aapt2 = select_aapt2
|
604
|
+
helper.aapt2 = select_aapt2(build_tools_path)
|
593
605
|
helper.bundletool = $bundletool
|
594
606
|
helper.javabin = File.join( $java, 'java' + $exe_ext )
|
595
607
|
helper.rjava_dir = $app_rjava_dir
|
@@ -602,6 +614,29 @@ def init_aapt2_helper
|
|
602
614
|
end
|
603
615
|
|
604
616
|
namespace "config" do
|
617
|
+
|
618
|
+
namespace "android" do
|
619
|
+
task :enable_custom_manifest => 'config:load' do
|
620
|
+
|
621
|
+
unless $app_config['android']&.[]('manifest_template')
|
622
|
+
|
623
|
+
default_manifest_file = File.join $startdir, 'res', 'generators', 'templates', 'application', 'AndroidManifest.erb'
|
624
|
+
|
625
|
+
custom_manifest_file = File.join($app_path,'AndroidManifest.erb')
|
626
|
+
|
627
|
+
cp default_manifest_file, custom_manifest_file
|
628
|
+
|
629
|
+
$app_config['android']['manifest_template'] = 'AndroidManifest.erb'
|
630
|
+
|
631
|
+
buildyml = File.join( $app_path, 'build.yml' )
|
632
|
+
cp buildyml,buildyml+'.bak'
|
633
|
+
|
634
|
+
File.open(buildyml, 'w') {|f| f.write $app_config.to_yaml }
|
635
|
+
|
636
|
+
end
|
637
|
+
end
|
638
|
+
end
|
639
|
+
|
605
640
|
task :set_android_platform do
|
606
641
|
$current_platform = "android"
|
607
642
|
end
|
@@ -1014,7 +1049,7 @@ namespace "config" do
|
|
1014
1049
|
mkdir_p $targetdir if not File.exists? $targetdir
|
1015
1050
|
mkdir_p $srcdir if not File.exists? $srcdir
|
1016
1051
|
|
1017
|
-
init_aapt2_helper
|
1052
|
+
init_aapt2_helper build_tools_path
|
1018
1053
|
|
1019
1054
|
print_timestamp('config:android FINISH')
|
1020
1055
|
|
@@ -1055,6 +1090,11 @@ namespace "config" do
|
|
1055
1090
|
$app_extensions_list.each do |ext, extpath|
|
1056
1091
|
next if extpath.nil?
|
1057
1092
|
|
1093
|
+
# com.android.ndk.thirdparty:openssl:1.1.1 openssl.so and openssl.so - obsolete
|
1094
|
+
if ext == 'openssl.so'
|
1095
|
+
next
|
1096
|
+
end
|
1097
|
+
|
1058
1098
|
puts "#{extpath} is configuring..."
|
1059
1099
|
extyml = File.join(extpath, "ext.yml")
|
1060
1100
|
if File.file? extyml
|
@@ -1255,14 +1295,14 @@ namespace "config" do
|
|
1255
1295
|
end
|
1256
1296
|
end
|
1257
1297
|
|
1258
|
-
preload_java_classes.push(
|
1298
|
+
preload_java_classes.push(extconf_android["preload_java_classes"]) if (extconf_android && extconf_android["preload_java_classes"])
|
1259
1299
|
|
1260
1300
|
puts "#{extpath} is configured"
|
1261
1301
|
end # $app_extensions_list.each
|
1262
1302
|
|
1263
1303
|
mkdir_p(File.join( $tmpdir, "include" ) )
|
1264
1304
|
File.open( File.join( $tmpdir, "include", "rhojava_extra.inc" ), "w" ) { |f|
|
1265
|
-
preload_java_classes.each { |cls| f.puts( "\"#{cls}\"
|
1305
|
+
preload_java_classes.each { |cls| f.puts( "RHODES_DEFINE_JAVA_CLASS(#{cls[0]}, \"#{cls[1]}\")") }
|
1266
1306
|
}
|
1267
1307
|
|
1268
1308
|
puts "Extensions' java source lists: #{$ext_android_additional_sources.inspect}"
|
@@ -1425,14 +1465,22 @@ namespace "build" do
|
|
1425
1465
|
unless $app_config['android']&.[]('barcode_engine').nil?
|
1426
1466
|
engine = $app_config['android']['barcode_engine']
|
1427
1467
|
case engine
|
1468
|
+
when 'google'
|
1469
|
+
ENV["BARCODE_ENGINE"] = 'google'
|
1428
1470
|
when 'zxing'
|
1429
1471
|
ENV["BARCODE_ENGINE"] = 'zxing'
|
1472
|
+
when 'google'
|
1473
|
+
ENV["BARCODE_ENGINE"] = 'google'
|
1430
1474
|
else
|
1431
1475
|
raise 'Only supported barcode engines are: google(default) and zxing'
|
1432
1476
|
end
|
1433
1477
|
end
|
1434
1478
|
|
1435
1479
|
$ext_android_build_scripts.each do |ext, builddata|
|
1480
|
+
# com.android.ndk.thirdparty:openssl:1.1.1 extension openssl.so - obsolete
|
1481
|
+
if ext == 'openssl.so'
|
1482
|
+
next
|
1483
|
+
end
|
1436
1484
|
|
1437
1485
|
puts "Building #{ext}: #{builddata.inspect}"
|
1438
1486
|
|
@@ -1625,29 +1673,6 @@ namespace "build" do
|
|
1625
1673
|
print_timestamp('build:android:libsqlite FINISH')
|
1626
1674
|
end
|
1627
1675
|
|
1628
|
-
#not real build, just copy existing .so to build dir
|
1629
|
-
task :libopenssl => "config:android" do
|
1630
|
-
|
1631
|
-
skip = ($app_config['extensions'].index('openssl.so') || $app_config['extensions'].index('openssl'))
|
1632
|
-
next if skip
|
1633
|
-
|
1634
|
-
print_timestamp('build:android:libopenssl START')
|
1635
|
-
|
1636
|
-
libdir = File.join($app_builddir, 'openssl')
|
1637
|
-
mkdir_p libdir unless File.directory? libdir
|
1638
|
-
|
1639
|
-
src_dir = "#{$shareddir}/../../lib/extensions/openssl.so/ext/android"
|
1640
|
-
|
1641
|
-
$abis.each do |abi|
|
1642
|
-
realabi = abi
|
1643
|
-
realabi = 'armeabi' if abi == 'arm'
|
1644
|
-
mkdir_p File.join(libdir, realabi) unless File.directory? File.join(libdir, realabi)
|
1645
|
-
cp_r File.join(src_dir, realabi, "libopenssl.so.a"), File.join(libdir, realabi, "libopenssl.a")
|
1646
|
-
end
|
1647
|
-
|
1648
|
-
LibBuilder.results['openssl'] = libdir
|
1649
|
-
end
|
1650
|
-
|
1651
1676
|
task :libcurl => "config:android" do
|
1652
1677
|
print_timestamp('build:android:libcurl START')
|
1653
1678
|
# Steps to get curl_config.h from fresh libcurl sources:
|
@@ -1815,8 +1840,7 @@ namespace "build" do
|
|
1815
1840
|
:librhocommon,
|
1816
1841
|
:librhomain,
|
1817
1842
|
:librhosync,
|
1818
|
-
:librholog
|
1819
|
-
:libopenssl
|
1843
|
+
:librholog
|
1820
1844
|
]
|
1821
1845
|
|
1822
1846
|
task :genconfig => "config:android" do
|
@@ -1900,6 +1924,12 @@ namespace "build" do
|
|
1900
1924
|
next
|
1901
1925
|
end
|
1902
1926
|
srcdir = File.join $androidpath, "Rhodes", "jni", "src"
|
1927
|
+
openssl_include = File.join AndroidTools::MavenDepsExtractor.instance.prefab_dirs[0], "modules", "crypto", "include"
|
1928
|
+
|
1929
|
+
# maven dependency com.android.ndk.thirdparty:openssl:1.1.1
|
1930
|
+
openssl_crypto_lib = File.join AndroidTools::MavenDepsExtractor.instance.prefab_dirs[0], "modules", "crypto", "libs"
|
1931
|
+
openssl_ssl_lib = File.join AndroidTools::MavenDepsExtractor.instance.prefab_dirs[0], "modules", "ssl", "libs"
|
1932
|
+
abi_prefab_target_dirs = { "arm" => "android.armeabi-v7a", "aarch64" => "android.arm64-v8a", "x86" => "android.x86", "armeabi-v7a" => "android.armeabi-v7a", "x86_64" => "android.x86_64" }
|
1903
1933
|
|
1904
1934
|
args = []
|
1905
1935
|
args << "-I\"#{$appincdir}\""
|
@@ -1912,7 +1942,8 @@ namespace "build" do
|
|
1912
1942
|
args << "-I\"#{$shareddir}/curl/include\""
|
1913
1943
|
args << "-I\"#{$shareddir}/ruby/include\""
|
1914
1944
|
args << "-I\"#{$shareddir}/ruby/android\""
|
1915
|
-
|
1945
|
+
# maven dependency com.android.ndk.thirdparty:openssl:1.1.1
|
1946
|
+
args << "-I\"#{openssl_include}\""
|
1916
1947
|
args << "-I\"#{$coreapidir}\""
|
1917
1948
|
args << "-I\"#{File.join($tmpdir,"include")}\""
|
1918
1949
|
|
@@ -1938,6 +1969,10 @@ namespace "build" do
|
|
1938
1969
|
rlibs << "z"
|
1939
1970
|
rlibs << "stdc++"
|
1940
1971
|
|
1972
|
+
# maven dependency com.android.ndk.thirdparty:openssl:1.1.1
|
1973
|
+
rlibs << "crypto"
|
1974
|
+
rlibs << "ssl"
|
1975
|
+
|
1941
1976
|
rlibs.map! { |x| "-l#{x}" }
|
1942
1977
|
|
1943
1978
|
realabi = abi
|
@@ -1949,6 +1984,9 @@ namespace "build" do
|
|
1949
1984
|
args << "-L\"#{File.dirname(lib)}\""
|
1950
1985
|
end
|
1951
1986
|
|
1987
|
+
# maven dependency com.android.ndk.thirdparty:openssl:1.1.1
|
1988
|
+
args << "-L\"#{File.join(openssl_crypto_lib, abi_prefab_target_dirs[abi])}\""
|
1989
|
+
args << "-L\"#{File.join(openssl_ssl_lib, abi_prefab_target_dirs[abi])}\""
|
1952
1990
|
|
1953
1991
|
deps = []
|
1954
1992
|
libs = []
|
@@ -2041,6 +2079,10 @@ namespace "build" do
|
|
2041
2079
|
end
|
2042
2080
|
|
2043
2081
|
if cap_item.is_a? String
|
2082
|
+
|
2083
|
+
if $target_sdk_level >= 30 && cap_item == 'WRITE_EXTERNAL_STORAGE' || cap_item == 'READ_EXTERNAL_STORAGE'
|
2084
|
+
usesPermissions << "android.permission.MANAGE_EXTERNAL_STORAGE"
|
2085
|
+
end
|
2044
2086
|
usesPermissions << "android.permission.#{cap_item}"
|
2045
2087
|
next
|
2046
2088
|
end
|
@@ -2049,8 +2091,14 @@ namespace "build" do
|
|
2049
2091
|
usesPermissions.uniq!
|
2050
2092
|
|
2051
2093
|
hidden = get_boolean($app_config['hidden_app'])
|
2094
|
+
home_app = false
|
2095
|
+
if $app_config['android'] != nil
|
2096
|
+
if $app_config['android']['home_app'] != nil
|
2097
|
+
home_app = $app_config['android']['home_app']
|
2098
|
+
end
|
2099
|
+
end
|
2052
2100
|
|
2053
|
-
generator = ManifestGenerator.new JAVA_PACKAGE_NAME, $app_package_name, hidden, usesPermissions
|
2101
|
+
generator = ManifestGenerator.new JAVA_PACKAGE_NAME, $app_package_name, hidden, home_app, usesPermissions
|
2054
2102
|
|
2055
2103
|
generator.versionName = $app_config["version"]
|
2056
2104
|
generator.versionCode = version
|
@@ -2202,15 +2250,16 @@ namespace "build" do
|
|
2202
2250
|
Dir.glob($app_builddir + "/**/lib*.so").each do |lib|
|
2203
2251
|
arch = File.basename(File.dirname(lib))
|
2204
2252
|
file = File.basename(lib)
|
2253
|
+
|
2254
|
+
ndkwrapper = NDKWrapper.new($androidndkpath)
|
2255
|
+
llvm_stl = ndkwrapper.get_llvm_stl_path(arch)
|
2205
2256
|
arch = 'arm64-v8a' if arch == "aarch64"
|
2206
2257
|
cp_r lib, File.join($applibs,arch,file)
|
2207
|
-
|
2208
|
-
localabi = arch
|
2209
|
-
localabi = "armeabi-v7a" if arch == "armeabi"
|
2210
|
-
llvm_stl = File.join($androidndkpath, "sources", "cxx-stl", "llvm-libc++", "libs", localabi, "libc++_shared.so")
|
2258
|
+
|
2211
2259
|
if File.exists? llvm_stl
|
2212
2260
|
cp_r llvm_stl, File.join($applibs,arch)
|
2213
2261
|
end
|
2262
|
+
|
2214
2263
|
end
|
2215
2264
|
$ext_android_additional_lib.each do |lib|
|
2216
2265
|
arch = File.basename(File.dirname(lib))
|
@@ -2218,6 +2267,23 @@ namespace "build" do
|
|
2218
2267
|
cp_r lib, File.join($applibs,arch,file)
|
2219
2268
|
end
|
2220
2269
|
|
2270
|
+
abi_prefab_alter_names = { "android.armeabi-v7a" => "arm", "android.arm64-v8a" => "aarch64", "android.x86" => "x86", "armeabi-v7a" => "arm", "android.x86_64" => "x86_64" }
|
2271
|
+
abi_prefab_target_dirs = { "android.armeabi-v7a" => "armeabi", "android.arm64-v8a" => "arm64-v8a", "android.x86" => "x86", "armeabi-v7a" => "armeabi", "android.x86_64" => "x86_64" }
|
2272
|
+
android_prefab_dir = AndroidTools::MavenDepsExtractor.instance.prefab_dirs
|
2273
|
+
android_prefab_dir.each do |dir|
|
2274
|
+
Dir.glob(dir + "/**/lib*.so").each do |lib|
|
2275
|
+
arch = File.basename(File.dirname(lib))
|
2276
|
+
if !$abis.include?(abi_prefab_alter_names[arch])
|
2277
|
+
next
|
2278
|
+
end
|
2279
|
+
arch = abi_prefab_target_dirs[arch]
|
2280
|
+
file = File.basename(lib)
|
2281
|
+
if Dir.exists? File.join($applibs,arch)
|
2282
|
+
cp_r lib, File.join($applibs,arch,file)
|
2283
|
+
end
|
2284
|
+
end
|
2285
|
+
end
|
2286
|
+
|
2221
2287
|
abi_alter_names = { "armeabi" => "arm", "arm64-v8a" => "aarch64", "x86" => "x86", "armeabi-v7a" => "arm", "x86_64" => "x86_64" }
|
2222
2288
|
if !$rhodes_as_lib
|
2223
2289
|
$android_jni_libs = AndroidTools::MavenDepsExtractor.instance.jni_libs
|
@@ -2876,6 +2942,7 @@ def create_bundle()
|
|
2876
2942
|
|
2877
2943
|
apk = File.join($targetdir,"#{$appname}-universal.apk")
|
2878
2944
|
apks = File.join($targetdir,"#{$appname}.apks")
|
2945
|
+
rm apks if File.file? apks
|
2879
2946
|
Jake.run( $javabin, ["-jar", $bundletool, "build-apks","--bundle=#{signed_bundle}", "--output=#{apks}", "--mode=universal"] )
|
2880
2947
|
rm apk if File.file? apk
|
2881
2948
|
Zip::File.open(apks) { |zip|
|
@@ -912,7 +912,7 @@ module_function :read_manifest_package
|
|
912
912
|
def generateKeystore( keystore, storealias, storepass, keypass )
|
913
913
|
@@logger.info "Generating private keystore..."
|
914
914
|
|
915
|
-
mkdir_p File.dirname(
|
915
|
+
mkdir_p File.dirname(keystore) unless File.directory? File.dirname(keystore)
|
916
916
|
|
917
917
|
args = []
|
918
918
|
args << "-genkey"
|
@@ -153,18 +153,24 @@ def cpp_def_args
|
|
153
153
|
args << "-std=c++11"
|
154
154
|
else
|
155
155
|
args << "-stdlib=libc++"
|
156
|
+
#args << "-std=c++17"
|
156
157
|
end
|
157
158
|
|
158
159
|
args << "-Wno-reorder"
|
159
|
-
|
160
|
-
|
161
|
-
|
160
|
+
|
161
|
+
if($ndk_rev_major < 18)
|
162
|
+
args << "-I\"#{File.join($androidndkpath,'sources','cxx-stl','gnu-libstdc++',$ndkgccver,'include')}\""
|
163
|
+
args << "-I\"#{File.join($androidndkpath,'sources','cxx-stl','gnu-libstdc++',$ndkgccver,'include','backward')}\""
|
162
164
|
|
163
|
-
|
164
|
-
|
165
|
-
|
165
|
+
dirArmeabi = File.join($androidndkpath,'sources','cxx-stl','gnu-libstdc++',$ndkgccver,'libs','armeabi','include')
|
166
|
+
if !File.directory?(dirArmeabi)
|
167
|
+
dirArmeabi = File.join($androidndkpath,'sources','cxx-stl','gnu-libstdc++',$ndkgccver,'libs','armeabi-v7a','include')
|
168
|
+
end
|
169
|
+
args << "-I\"#{dirArmeabi}\""
|
170
|
+
else
|
171
|
+
#args << "-I\"#{File.join($androidndkpath,'sources','cxx-stl','llvm-libc++','include')}\""
|
166
172
|
end
|
167
|
-
|
173
|
+
|
168
174
|
args
|
169
175
|
end
|
170
176
|
|
@@ -1,5 +1,8 @@
|
|
1
1
|
maven_deps:
|
2
|
-
- 'androidx.core:core:1.
|
2
|
+
- 'androidx.core:core:1.6.0'
|
3
|
+
- 'androidx.core:core-ktx:1.6.0'
|
3
4
|
- 'androidx.lifecycle:lifecycle-common:2.3.1'
|
4
5
|
- 'androidx.lifecycle:lifecycle-common-java8:2.3.1'
|
5
6
|
- 'org.conscrypt:conscrypt-android:2.5.1'
|
7
|
+
- 'com.android.ndk.thirdparty:openssl:1.1.1q-beta-1'
|
8
|
+
- 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
|
@@ -23,11 +23,11 @@ class ManifestGenerator
|
|
23
23
|
attr_accessor :buildToolsVer
|
24
24
|
attr_accessor :androidVerMaj
|
25
25
|
attr_accessor :androidVerMin
|
26
|
-
|
26
|
+
|
27
27
|
attr_accessor :manifestManifestAdds
|
28
28
|
attr_accessor :applicationManifestAdds
|
29
|
-
|
30
|
-
def initialize(javaPackage, appPackage, hidden, permissions, features = {})
|
29
|
+
|
30
|
+
def initialize(javaPackage, appPackage, hidden, home_app, permissions, features = {})
|
31
31
|
@javaPackageName = javaPackage
|
32
32
|
@appPackageName = appPackage
|
33
33
|
@permissions = {}
|
@@ -41,7 +41,11 @@ class ManifestGenerator
|
|
41
41
|
@rhodesActivityIntentFilters = []
|
42
42
|
@rhodesActivityIntentFilters << {:act=>'android.intent.action.VIEW', :cat=>['android.intent.category.DEFAULT', 'android.intent.category.BROWSABLE']}
|
43
43
|
unless hidden
|
44
|
-
|
44
|
+
categors = ['android.intent.category.DEFAULT','android.intent.category.LAUNCHER']
|
45
|
+
if home_app
|
46
|
+
categors << 'android.intent.category.HOME'
|
47
|
+
end
|
48
|
+
@rhodesActivityIntentFilters << {:act=>'android.intent.action.MAIN', :cat=>categors}
|
45
49
|
end
|
46
50
|
@screenOrientation = 'unspecified'
|
47
51
|
@debuggable = 'false'
|
@@ -51,21 +55,21 @@ class ManifestGenerator
|
|
51
55
|
@applicationManifestAdds = []
|
52
56
|
@apikey = ''
|
53
57
|
end
|
54
|
-
|
58
|
+
|
55
59
|
def addGoogleMaps
|
56
60
|
@usesLibraries['com.google.android.maps'] = true
|
57
61
|
@usesLibraries['org.apache.http.legacy'] = false
|
58
62
|
end
|
59
|
-
|
63
|
+
|
60
64
|
def addGooglePush(erbPath)
|
61
65
|
@permissions["#{@appPackageName}.permission.C2D_MESSAGE"] = 'signature'
|
62
66
|
@usesPermissions << "#{@appPackageName}.permission.C2D_MESSAGE"
|
63
67
|
@usesPermissions << 'com.google.android.c2dm.permission.RECEIVE'
|
64
68
|
@applicationManifestAdds << erbPath
|
65
69
|
end
|
66
|
-
|
67
|
-
|
68
|
-
|
70
|
+
|
71
|
+
|
72
|
+
|
69
73
|
def addUriParams(scheme, host, pathPrefix = nil)
|
70
74
|
@rhodesActivityIntentFilters.each do |filter|
|
71
75
|
if filter[:act] == 'android.intent.action.VIEW' && filter[:cat] == ['android.intent.category.DEFAULT', 'android.intent.category.BROWSABLE']
|
@@ -76,7 +80,7 @@ class ManifestGenerator
|
|
76
80
|
end
|
77
81
|
end
|
78
82
|
end
|
79
|
-
|
83
|
+
|
80
84
|
def makeIntentFilter(filterHash)
|
81
85
|
filter = REXML::Element.new 'intent-filter'
|
82
86
|
filter.add_element('action', 'android:name'=>filterHash[:act]) if filterHash[:act]
|
@@ -47,7 +47,7 @@ class MavenDepsExtractor
|
|
47
47
|
@asset_dirs = []
|
48
48
|
@jni_libs = []
|
49
49
|
@manifests = []
|
50
|
-
|
50
|
+
@prefab_dirs = []
|
51
51
|
|
52
52
|
end
|
53
53
|
|
@@ -118,6 +118,10 @@ class MavenDepsExtractor
|
|
118
118
|
@dependencies
|
119
119
|
end
|
120
120
|
|
121
|
+
def prefab_dirs
|
122
|
+
@prefab_dirs
|
123
|
+
end
|
124
|
+
|
121
125
|
def set_temp_dir( d )
|
122
126
|
raise "Maven extractor directory was already set to #{@temp_dir}" if @temp_dir
|
123
127
|
|
@@ -177,6 +181,7 @@ class MavenDepsExtractor
|
|
177
181
|
libs = File.join(target,'libs')
|
178
182
|
jni = File.join(target,'jni')
|
179
183
|
classes = File.join(target,'classes.jar')
|
184
|
+
prefab = File.join(target,'prefab')
|
180
185
|
|
181
186
|
@asset_dirs << assets if (File.directory?(assets) and !Dir[File.join(assets,'*')].empty? )
|
182
187
|
@manifests << manifest if File.file?(manifest) and File.size?(r_txt)
|
@@ -184,6 +189,7 @@ class MavenDepsExtractor
|
|
184
189
|
@jars += Dir[File.join(libs,'*.jar')]
|
185
190
|
@jars << classes if File.file?(classes)
|
186
191
|
@jni_libs += Dir[(File.join(jni,'**','*.so'))]
|
192
|
+
@prefab_dirs << prefab if (File.directory?(prefab) and !Dir[File.join(prefab,'**')].empty? )
|
187
193
|
|
188
194
|
end
|
189
195
|
elsif File.extname(f) == '.jar'
|
@@ -276,6 +276,18 @@ class NDKWrapper
|
|
276
276
|
@rev_major
|
277
277
|
end
|
278
278
|
|
279
|
+
def get_llvm_stl_path( arch )
|
280
|
+
if @rev_major <= 24
|
281
|
+
arch = 'arm64-v8a' if arch == "aarch64"
|
282
|
+
localabi = arch
|
283
|
+
localabi = "armeabi-v7a" if arch == "armeabi"
|
284
|
+
File.join(@root_path, "sources", "cxx-stl", "llvm-libc++", "libs", localabi, "libc++_shared.so")
|
285
|
+
else
|
286
|
+
arch = "arm" if arch == "armeabi"
|
287
|
+
File.join(@root_path, "toolchains", "llvm", "prebuilt", "darwin-x86_64", "sysroot", "usr", "lib", @@abi_triple[arch], "libc++_shared.so")
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
279
291
|
def select_tool_abi_prefix( tool, abi )
|
280
292
|
prefix = abi
|
281
293
|
|
@@ -613,3 +613,8 @@ public static final android.os.Parcelable$Creator *;
|
|
613
613
|
-dontwarn android.support.design.internal.**
|
614
614
|
-dontwarn com.google.android.gms.**
|
615
615
|
-dontwarn android.support.v4.**
|
616
|
+
|
617
|
+
-keep public class androidx.**
|
618
|
+
-keep public class kotlin.**
|
619
|
+
-dontwarn androidx.**
|
620
|
+
-dontwarn kotlin.**
|
Binary file
|
@@ -0,0 +1,105 @@
|
|
1
|
+
//
|
2
|
+
// RhoCryptAESGCM.swift
|
3
|
+
// RhoAppBaseLib
|
4
|
+
//
|
5
|
+
// Created by Dmitry Soldatenkov on 13.04.2023.
|
6
|
+
//
|
7
|
+
|
8
|
+
import Foundation
|
9
|
+
import os
|
10
|
+
import CryptoKit
|
11
|
+
|
12
|
+
|
13
|
+
@objc(RhoCryptAESGCM)
|
14
|
+
public class RhoCryptAESGCM : NSObject {
|
15
|
+
|
16
|
+
|
17
|
+
@objc(generate_new_key)
|
18
|
+
public func generate_new_key() -> Data? {
|
19
|
+
if #available(iOS 13.0, *) {
|
20
|
+
let key = SymmetricKey(size: .bits256)
|
21
|
+
let key_data = key.withUnsafeBytes { Data(Array($0)) }
|
22
|
+
return key_data
|
23
|
+
}
|
24
|
+
return nil;
|
25
|
+
}
|
26
|
+
|
27
|
+
@objc(encrypt_page::)
|
28
|
+
public func encrypt_page(page : Data, key : Data) -> Data? {
|
29
|
+
|
30
|
+
if #available(iOS 13.0, *) {
|
31
|
+
let data_to_encrypt : Data = page.subdata(in: 0 ..< (page.count-32) )
|
32
|
+
let symm_key = SymmetricKey(data: key)
|
33
|
+
|
34
|
+
// encrypt
|
35
|
+
do {
|
36
|
+
|
37
|
+
let sealedBox = try AES.GCM.seal(data_to_encrypt, using: symm_key)
|
38
|
+
|
39
|
+
//
|
40
|
+
var result_data : Data = sealedBox.ciphertext
|
41
|
+
let nonce_data : Data = Data(sealedBox.nonce)
|
42
|
+
let tag_data : Data = sealedBox.tag
|
43
|
+
|
44
|
+
let random_4_bytes_data : Data = Data((0 ..< 4).map { _ in UInt8.random(in: UInt8.min ... UInt8.max) })
|
45
|
+
|
46
|
+
result_data.append(nonce_data)
|
47
|
+
result_data.append(random_4_bytes_data)
|
48
|
+
result_data.append(tag_data)
|
49
|
+
|
50
|
+
return result_data
|
51
|
+
}
|
52
|
+
catch {
|
53
|
+
return nil
|
54
|
+
}
|
55
|
+
|
56
|
+
}
|
57
|
+
else {
|
58
|
+
return nil
|
59
|
+
}
|
60
|
+
|
61
|
+
}
|
62
|
+
|
63
|
+
@objc(decrypt_page::)
|
64
|
+
public func decrypt_page(page : Data, key : Data) -> Data? {
|
65
|
+
|
66
|
+
|
67
|
+
if #available(iOS 13.0, *) {
|
68
|
+
|
69
|
+
do {
|
70
|
+
let data_to_decrypt : Data = page.subdata(in: 0 ..< (page.count-32) )
|
71
|
+
|
72
|
+
let nonce_data : Data = page.subdata(in: (page.count-32) ..< (page.count-32+12))
|
73
|
+
let tag_data : Data = page.subdata(in: (page.count-16) ..< (page.count))
|
74
|
+
|
75
|
+
let nonce : AES.GCM.Nonce = try AES.GCM.Nonce(data: nonce_data)
|
76
|
+
let symm_key = SymmetricKey(data: key)
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
let sealedBoxRestored = try AES.GCM.SealedBox(nonce: nonce, ciphertext: data_to_decrypt, tag: tag_data)
|
81
|
+
let result_data : Data = try AES.GCM.open(sealedBoxRestored, using: symm_key)
|
82
|
+
|
83
|
+
return result_data
|
84
|
+
}
|
85
|
+
catch {
|
86
|
+
return nil
|
87
|
+
}
|
88
|
+
}
|
89
|
+
else {
|
90
|
+
return nil
|
91
|
+
}
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
|
96
|
+
@objc(is_aes_gcm_available)
|
97
|
+
public func is_aes_gcm_available() -> Bool {
|
98
|
+
if #available(iOS 13.0, *) {
|
99
|
+
return true
|
100
|
+
}
|
101
|
+
return false
|
102
|
+
}
|
103
|
+
|
104
|
+
}
|
105
|
+
|
@@ -108,7 +108,7 @@
|
|
108
108
|
|
109
109
|
//UIWebView
|
110
110
|
|
111
|
-
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script {
|
111
|
+
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script wantAnswer:(BOOL)wantAnswer{
|
112
112
|
return [webview stringByEvaluatingJavaScriptFromString:script];
|
113
113
|
}
|
114
114
|
|