forked from cwtch.im/cwtch-ui
Merge branch 'noDisable' into fixDeactivate
This commit is contained in:
commit
c2f46a0117
|
@ -47,7 +47,7 @@ steps:
|
||||||
# #Todo: fix all the lint errors and add `-set_exit_status` above to enforce linting
|
# #Todo: fix all the lint errors and add `-set_exit_status` above to enforce linting
|
||||||
|
|
||||||
- name: build-linux
|
- name: build-linux
|
||||||
image: openpriv/flutter-desktop:linux-fstable-3.3.8
|
image: openpriv/flutter-desktop:linux-fstable-3.3.9
|
||||||
volumes:
|
volumes:
|
||||||
- name: deps
|
- name: deps
|
||||||
path: /root/.pub-cache
|
path: /root/.pub-cache
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2022-12-07-17-51-v1.10.1
|
2022-12-12-22-59-v1.10.1-3-g3d0a3a5
|
|
@ -1 +1 @@
|
||||||
2022-12-07-22-53-v1.10.1
|
2022-12-12-22-59-v1.10.1-3-g3d0a3a5
|
|
@ -68,7 +68,7 @@ class MainActivity: FlutterActivity() {
|
||||||
private val PROFILE_EXPORT_REQUEST_CODE = 236
|
private val PROFILE_EXPORT_REQUEST_CODE = 236
|
||||||
private val REQUEST_DOZE_WHITELISTING_CODE:Int = 9
|
private val REQUEST_DOZE_WHITELISTING_CODE:Int = 9
|
||||||
private var dlToProfile = ""
|
private var dlToProfile = ""
|
||||||
private var dlToHandle = ""
|
private var dlToHandle = 0
|
||||||
private var dlToFileKey = ""
|
private var dlToFileKey = ""
|
||||||
private var exportFromPath = ""
|
private var exportFromPath = ""
|
||||||
|
|
||||||
|
@ -128,9 +128,10 @@ class MainActivity: FlutterActivity() {
|
||||||
if (requestCode == FILEPICKER_REQUEST_CODE) {
|
if (requestCode == FILEPICKER_REQUEST_CODE) {
|
||||||
val filePath = intent!!.getData().toString();
|
val filePath = intent!!.getData().toString();
|
||||||
val manifestPath = StringBuilder().append(this.applicationContext.cacheDir).append("/").append(this.dlToFileKey).toString();
|
val manifestPath = StringBuilder().append(this.applicationContext.cacheDir).append("/").append(this.dlToFileKey).toString();
|
||||||
|
Log.d("MainActivity:FILEPICKER_REQUEST_CODE", "DownloadableFileCreated");
|
||||||
handleCwtch(MethodCall("DownloadFile", mapOf(
|
handleCwtch(MethodCall("DownloadFile", mapOf(
|
||||||
"ProfileOnion" to this.dlToProfile,
|
"ProfileOnion" to this.dlToProfile,
|
||||||
"handle" to this.dlToHandle,
|
"conversation" to this.dlToHandle.toInt(),
|
||||||
"filepath" to filePath,
|
"filepath" to filePath,
|
||||||
"manifestpath" to manifestPath,
|
"manifestpath" to manifestPath,
|
||||||
"filekey" to this.dlToFileKey
|
"filekey" to this.dlToFileKey
|
||||||
|
@ -228,7 +229,7 @@ class MainActivity: FlutterActivity() {
|
||||||
var method = call.method
|
var method = call.method
|
||||||
// todo change usage patern to match that in FlwtchWorker
|
// todo change usage patern to match that in FlwtchWorker
|
||||||
// Unsafe for anything using int args, causes access time attempt to cast to string which will fail
|
// Unsafe for anything using int args, causes access time attempt to cast to string which will fail
|
||||||
val argmap: Map<String, String> = call.arguments as Map<String, String>
|
val argmap: Map<String, String> = call.arguments as Map<String,String>
|
||||||
|
|
||||||
// the frontend calls Start every time it fires up, but we don't want to *actually* call Cwtch.Start()
|
// the frontend calls Start every time it fires up, but we don't want to *actually* call Cwtch.Start()
|
||||||
// in case the ForegroundService is still running. in both cases, however, we *do* want to re-register
|
// in case the ForegroundService is still running. in both cases, however, we *do* want to re-register
|
||||||
|
@ -255,7 +256,7 @@ class MainActivity: FlutterActivity() {
|
||||||
}
|
}
|
||||||
"CreateDownloadableFile" -> {
|
"CreateDownloadableFile" -> {
|
||||||
this.dlToProfile = argmap["ProfileOnion"] ?: ""
|
this.dlToProfile = argmap["ProfileOnion"] ?: ""
|
||||||
this.dlToHandle = argmap["handle"] ?: ""
|
this.dlToHandle = call.argument("conversation")!!
|
||||||
val suggestedName = argmap["filename"] ?: "filename.ext"
|
val suggestedName = argmap["filename"] ?: "filename.ext"
|
||||||
this.dlToFileKey = argmap["filekey"] ?: ""
|
this.dlToFileKey = argmap["filekey"] ?: ""
|
||||||
val intent = Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
|
val intent = Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
|
||||||
|
@ -358,7 +359,8 @@ class MainActivity: FlutterActivity() {
|
||||||
"CreateProfile" -> {
|
"CreateProfile" -> {
|
||||||
val nick: String = call.argument("nick") ?: ""
|
val nick: String = call.argument("nick") ?: ""
|
||||||
val pass: String = call.argument("pass") ?: ""
|
val pass: String = call.argument("pass") ?: ""
|
||||||
Cwtch.createProfile(nick, pass)
|
val autostart: Boolean = call.argument("autostart") ?: true
|
||||||
|
Cwtch.createProfile(nick, pass, autostart)
|
||||||
}
|
}
|
||||||
"LoadProfiles" -> {
|
"LoadProfiles" -> {
|
||||||
val pass: String = call.argument("pass") ?: ""
|
val pass: String = call.argument("pass") ?: ""
|
||||||
|
@ -426,6 +428,7 @@ class MainActivity: FlutterActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
"DownloadFile" -> {
|
"DownloadFile" -> {
|
||||||
|
Log.d("MainActivity.kt", "Cwtch Download File Called...")
|
||||||
val profile: String = call.argument("ProfileOnion") ?: ""
|
val profile: String = call.argument("ProfileOnion") ?: ""
|
||||||
val conversation: Int = call.argument("conversation") ?: 0
|
val conversation: Int = call.argument("conversation") ?: 0
|
||||||
val filepath: String = call.argument("filepath") ?: ""
|
val filepath: String = call.argument("filepath") ?: ""
|
||||||
|
|
|
@ -11,7 +11,7 @@ abstract class Cwtch {
|
||||||
Future<void> ReconnectCwtchForeground();
|
Future<void> ReconnectCwtchForeground();
|
||||||
|
|
||||||
// ignore: non_constant_identifier_names
|
// ignore: non_constant_identifier_names
|
||||||
void CreateProfile(String nick, String pass);
|
void CreateProfile(String nick, String pass, bool autostart);
|
||||||
|
|
||||||
// ignore: non_constant_identifier_names
|
// ignore: non_constant_identifier_names
|
||||||
void ActivatePeerEngine(String profile);
|
void ActivatePeerEngine(String profile);
|
||||||
|
|
|
@ -290,13 +290,13 @@ class CwtchFfi implements Cwtch {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: non_constant_identifier_names
|
// ignore: non_constant_identifier_names
|
||||||
void CreateProfile(String nick, String pass) {
|
void CreateProfile(String nick, String pass, bool autostart) {
|
||||||
var createProfileC = library.lookup<NativeFunction<void_from_string_string_function>>("c_CreateProfile");
|
var createProfileC = library.lookup<NativeFunction<void_from_string_string_byte_function>>("c_CreateProfile");
|
||||||
// ignore: non_constant_identifier_names
|
// ignore: non_constant_identifier_names
|
||||||
final CreateProfile = createProfileC.asFunction<VoidFromStringStringFn>();
|
final CreateProfile = createProfileC.asFunction<VoidFromStringStringByteFn>();
|
||||||
final utf8nick = nick.toNativeUtf8();
|
final utf8nick = nick.toNativeUtf8();
|
||||||
final ut8pass = pass.toNativeUtf8();
|
final ut8pass = pass.toNativeUtf8();
|
||||||
CreateProfile(utf8nick, utf8nick.length, ut8pass, ut8pass.length);
|
CreateProfile(utf8nick, utf8nick.length, ut8pass, ut8pass.length, autostart ? 1 : 0);
|
||||||
malloc.free(utf8nick);
|
malloc.free(utf8nick);
|
||||||
malloc.free(ut8pass);
|
malloc.free(ut8pass);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,8 +71,8 @@ class CwtchGomobile implements Cwtch {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: non_constant_identifier_names
|
// ignore: non_constant_identifier_names
|
||||||
void CreateProfile(String nick, String pass) {
|
void CreateProfile(String nick, String pass, bool autostart) {
|
||||||
cwtchPlatform.invokeMethod("CreateProfile", {"nick": nick, "pass": pass});
|
cwtchPlatform.invokeMethod("CreateProfile", {"nick": nick, "pass": pass, "autostart": autostart});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: non_constant_identifier_names
|
// ignore: non_constant_identifier_names
|
||||||
|
|
|
@ -172,7 +172,7 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
|
||||||
|
|
||||||
// Enabled
|
// Enabled
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: Provider.of<ProfileInfoState>(context).onion.isNotEmpty,
|
visible: Provider.of<ProfileInfoState>(context).onion.isNotEmpty && !Provider.of<ProfileInfoState>(context).enabled,
|
||||||
child: SwitchListTile(
|
child: SwitchListTile(
|
||||||
title: Text(AppLocalizations.of(context)!.profileEnabled, style: TextStyle(color: Provider.of<Settings>(context).current().mainTextColor)),
|
title: Text(AppLocalizations.of(context)!.profileEnabled, style: TextStyle(color: Provider.of<Settings>(context).current().mainTextColor)),
|
||||||
subtitle: Text(AppLocalizations.of(context)!.profileEnabledDescription),
|
subtitle: Text(AppLocalizations.of(context)!.profileEnabledDescription),
|
||||||
|
@ -398,12 +398,11 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
|
||||||
// match (and are provided if the user has requested an encrypted profile).
|
// match (and are provided if the user has requested an encrypted profile).
|
||||||
if (_formKey.currentState!.validate()) {
|
if (_formKey.currentState!.validate()) {
|
||||||
if (Provider.of<ProfileInfoState>(context, listen: false).onion.isEmpty) {
|
if (Provider.of<ProfileInfoState>(context, listen: false).onion.isEmpty) {
|
||||||
// TODO: save autostart in create flow
|
|
||||||
if (usePassword == true) {
|
if (usePassword == true) {
|
||||||
Provider.of<FlwtchState>(context, listen: false).cwtch.CreateProfile(ctrlrNick.value.text, ctrlrPass.value.text);
|
Provider.of<FlwtchState>(context, listen: false).cwtch.CreateProfile(ctrlrNick.value.text, ctrlrPass.value.text, Provider.of<ProfileInfoState>(context, listen: false).autostart);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
} else {
|
} else {
|
||||||
Provider.of<FlwtchState>(context, listen: false).cwtch.CreateProfile(ctrlrNick.value.text, DefaultPassword);
|
Provider.of<FlwtchState>(context, listen: false).cwtch.CreateProfile(ctrlrNick.value.text, DefaultPassword, Provider.of<ProfileInfoState>(context, listen: false).autostart);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -251,7 +251,7 @@ class FileBubbleState extends State<FileBubble> {
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
Provider.of<ProfileInfoState>(context, listen: false).downloadInit(widget.fileKey(), (widget.fileSize / 4096).ceil());
|
Provider.of<ProfileInfoState>(context, listen: false).downloadInit(widget.fileKey(), (widget.fileSize / 4096).ceil());
|
||||||
Provider.of<FlwtchState>(context, listen: false).cwtch.SetMessageAttribute(profileOnion, conversation, 0, idx, "file-downloaded", "true");
|
Provider.of<FlwtchState>(context, listen: false).cwtch.SetMessageAttribute(profileOnion, conversation, 0, idx, "file-downloaded", "true");
|
||||||
ContactInfoState? contact = Provider.of<ProfileInfoState>(context).contactList.findContact(Provider.of<MessageMetadata>(context).senderHandle);
|
ContactInfoState? contact = Provider.of<ProfileInfoState>(context, listen: false).contactList.findContact(Provider.of<MessageMetadata>(context, listen: false).senderHandle);
|
||||||
if (contact != null) {
|
if (contact != null) {
|
||||||
Provider.of<FlwtchState>(context, listen: false).cwtch.CreateDownloadableFile(profileOnion, contact.identifier, widget.nameSuggestion, widget.fileKey());
|
Provider.of<FlwtchState>(context, listen: false).cwtch.CreateDownloadableFile(profileOnion, contact.identifier, widget.nameSuggestion, widget.fileKey());
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 1.9.0+35
|
version: 1.10.0+36
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.15.0 <3.0.0"
|
sdk: ">=2.15.0 <3.0.0"
|
||||||
|
|
Loading…
Reference in New Issue