From 48152acca15f01afb55136bd80d97f394c332348 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Thu, 4 Apr 2024 10:52:53 -0700 Subject: [PATCH] android updates and minor flutter 3.19.3 fixes --- .drone.yml | 8 ++--- .gitignore | 2 +- android/app/build.gradle | 25 +++++++-------- android/{ => app}/cwtch/build.gradle | 0 android/app/src/main/AndroidManifest.xml | 7 ++-- .../kotlin/im/cwtch/flwtch/MainActivity.kt | 4 --- .../main/kotlin/im/cwtch/flwtch/SplashView.kt | 15 --------- .../res/drawable-v21/launch_background.xml | 8 ++--- .../main/res/drawable/launch_background.xml | 10 +++--- .../app/src/main/res/layout/splash_view.xml | 19 ----------- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 544 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 442 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 721 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 1031 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 1443 -> 0 bytes .../main/res/raw/cwtch_animated_logo_op.json | 1 - .../app/src/main/res/values-night/styles.xml | 18 ----------- android/build.gradle | 22 ++----------- android/settings.gradle | 30 +++++++++++++----- fetch-libcwtch-go.sh | 4 +-- lib/cwtch/cwtchNotifier.dart | 5 ++- lib/main.dart | 5 ++- lib/models/appstate.dart | 15 +++++++++ lib/views/torstatusview.dart | 1 + 24 files changed, 77 insertions(+), 122 deletions(-) rename android/{ => app}/cwtch/build.gradle (100%) delete mode 100644 android/app/src/main/kotlin/im/cwtch/flwtch/SplashView.kt delete mode 100644 android/app/src/main/res/layout/splash_view.xml delete mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 android/app/src/main/res/raw/cwtch_animated_logo_op.json delete mode 100644 android/app/src/main/res/values-night/styles.xml diff --git a/.drone.yml b/.drone.yml index 09758ea6..1628053f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -208,7 +208,7 @@ clone: steps: - name: clone - image: openpriv/flutter-desktop:windows-sdk30-fstable-3.13.4 + image: openpriv/flutter-desktop:windows-sdk30-fstable-3.19.3 environment: buildbot_key_b64: from_secret: buildbot_key_b64 @@ -226,7 +226,7 @@ steps: - git checkout $Env:DRONE_COMMIT - name: fetch - image: openpriv/flutter-desktop:windows-sdk30-fstable-3.10.2 + image: openpriv/flutter-desktop:windows-sdk30-fstable-3.19.3 commands: - git describe --tags --abbrev=1 > VERSION - git log -1 --format=%cd --date=format:'%Y-%m-%d-%H-%M' > COMMIT_DATE @@ -234,7 +234,7 @@ steps: - .\fetch-libcwtch-go.ps1 - name: build-windows - image: openpriv/flutter-desktop:windows-sdk30-fstable-3.13.4 + image: openpriv/flutter-desktop:windows-sdk30-fstable-3.19.3 commands: - flutter pub get - $Env:version += type .\VERSION @@ -291,7 +291,7 @@ steps: - move *.sha512.txt deploy\$Env:builddir - name: deploy-windows - image: openpriv/flutter-desktop:windows-sdk30-fstable-3.13.4 + image: openpriv/flutter-desktop:windows-sdk30-fstable-3.19.3 when: event: push status: [ success ] diff --git a/.gitignore b/.gitignore index 611204b2..65babc31 100644 --- a/.gitignore +++ b/.gitignore @@ -59,7 +59,7 @@ package. # Compiled Libs linux/tor linux/libCwtch.so -android/cwtch/cwtch.aar +android/app/cwtch/cwtch.aar android/app/src/main/jniLibs/*/libtor.so *.dylib integration_test/gherkin_suite_test.g.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index 2c4c8b1d..896cb4b5 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -21,10 +22,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - // key.properties MUST have password placeholders filled in (via drone with secrets) and cwtch-upload.jks file must be added (from drone secret) def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') @@ -33,7 +30,7 @@ if (keystorePropertiesFile.exists()) { } android { - compileSdkVersion 33 + compileSdkVersion 34 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -54,7 +51,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "im.cwtch.flwtch" minSdkVersion 19 - targetSdkVersion 33 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -93,11 +90,11 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation project(':cwtch') + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.21" // same as kotlin version in settings.gradle + implementation fileTree( dir: 'cwtch') + implementation files ('cwtch/cwtch.aar') implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2" - implementation "com.airbnb.android:lottie:5.2.0" implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0" implementation "com.android.support.constraint:constraint-layout:2.0.4" diff --git a/android/cwtch/build.gradle b/android/app/cwtch/build.gradle similarity index 100% rename from android/cwtch/build.gradle rename to android/app/cwtch/build.gradle diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index a7f8e23c..223271b2 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ + @@ -58,9 +59,9 @@ Allows app to use ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS --> - + diff --git a/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt b/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt index 5fc51764..68964baf 100644 --- a/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt +++ b/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt @@ -1,6 +1,5 @@ package im.cwtch.flwtch -import SplashView import android.annotation.TargetApi import android.content.BroadcastReceiver import android.content.Context @@ -19,7 +18,6 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager import androidx.work.* import cwtch.Cwtch import io.flutter.embedding.android.FlutterActivity -import io.flutter.embedding.android.SplashScreen import io.flutter.embedding.engine.FlutterEngine import io.flutter.plugin.common.ErrorLogResult import io.flutter.plugin.common.MethodCall @@ -32,8 +30,6 @@ import java.util.concurrent.TimeUnit import kotlinx.coroutines.* class MainActivity: FlutterActivity() { - override fun provideSplashScreen(): SplashScreen? = SplashView() - // Channel to get app info private val CHANNEL_APP_INFO = "test.flutter.dev/applicationInfo" diff --git a/android/app/src/main/kotlin/im/cwtch/flwtch/SplashView.kt b/android/app/src/main/kotlin/im/cwtch/flwtch/SplashView.kt deleted file mode 100644 index 82f4726a..00000000 --- a/android/app/src/main/kotlin/im/cwtch/flwtch/SplashView.kt +++ /dev/null @@ -1,15 +0,0 @@ -import android.content.Context -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import im.cwtch.flwtch.R -import io.flutter.embedding.android.SplashScreen - -class SplashView : SplashScreen { - override fun createSplashView(context: Context, savedInstanceState: Bundle?): View? = - LayoutInflater.from(context).inflate(R.layout.splash_view, null, false) - - override fun transitionToFlutter(onTransitionComplete: Runnable) { - onTransitionComplete.run() - } -} \ No newline at end of file diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml index f74085f3..c6ce3f9c 100644 --- a/android/app/src/main/res/drawable-v21/launch_background.xml +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -1,12 +1,12 @@ - + - + android:src="@mipmap/knott" /> + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml index 304732f8..c62dd18a 100644 --- a/android/app/src/main/res/drawable/launch_background.xml +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -1,12 +1,10 @@ - + - + diff --git a/android/app/src/main/res/layout/splash_view.xml b/android/app/src/main/res/layout/splash_view.xml deleted file mode 100644 index 8794c810..00000000 --- a/android/app/src/main/res/layout/splash_view.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b0906d62b1847e87f15cdcacf6a4f29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a35cc66c3c1fd44f5a5526c1b78be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a88e3f88bea192c3a370d44689c3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb28e45604e46eeda8dd24651419bc0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` diff --git a/android/app/src/main/res/raw/cwtch_animated_logo_op.json b/android/app/src/main/res/raw/cwtch_animated_logo_op.json deleted file mode 100644 index 84c07d87..00000000 --- a/android/app/src/main/res/raw/cwtch_animated_logo_op.json +++ /dev/null @@ -1 +0,0 @@ -{"v":"4.8.0","meta":{"g":"LottieFiles AE 3.1.1","a":"","k":"","d":"","tc":""},"fr":29.9700012207031,"ip":0,"op":100.000004073084,"w":1000,"h":1000,"nm":"Comp 1","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":0,"nm":"hart","refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":270,"ix":10},"p":{"a":0,"k":[500,500,0],"ix":2},"a":{"a":0,"k":[500,500,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":1000,"h":1000,"ip":58.0000023623884,"op":208.000008472014,"st":58.0000023623884,"bm":0},{"ddd":0,"ind":2,"ty":0,"nm":"hart","refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":180,"ix":10},"p":{"a":0,"k":[500,500,0],"ix":2},"a":{"a":0,"k":[500,500,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":1000,"h":1000,"ip":43.0000017514259,"op":193.000007861051,"st":43.0000017514259,"bm":0},{"ddd":0,"ind":3,"ty":0,"nm":"hart","refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":90,"ix":10},"p":{"a":0,"k":[500,500,0],"ix":2},"a":{"a":0,"k":[500,500,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":1000,"h":1000,"ip":28.0000011404634,"op":178.000007250089,"st":28.0000011404634,"bm":0},{"ddd":0,"ind":4,"ty":0,"nm":"hart","refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[500,500,0],"ix":2},"a":{"a":0,"k":[500,500,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":1000,"h":1000,"ip":13.0000005295009,"op":163.000006639126,"st":13.0000005295009,"bm":0}]},{"id":"comp_1","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[517,337.5,0],"ix":2},"a":{"a":0,"k":[81.5,48.5,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"hasMask":true,"masksProperties":[{"inv":false,"mode":"a","pt":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-161.75,0.001],[-161.75,96.551],[-38.785,96.602],[0.965,0.001],[-49.452,0.001]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":2.728,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-23.107,0],[-23.107,96.551],[101.679,96.616],[139.608,0],[89.191,0]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":3.183,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-18.486,0],[-18.486,96.551],[106.686,96.613],[170.894,0.365],[106.453,0]],"c":true}]},{"t":5.00000020365417,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[0,0],[0,96.55],[126.715,96.601],[199.465,97.751],[175.5,0]],"c":true}]}],"ix":1},"o":{"a":0,"k":100,"ix":3},"x":{"a":0,"k":0,"ix":4},"nm":"Mask 1"}],"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-5.2,-1.8],[-2.1,-2],[-2,-5.4],[0.4,-3.3],[2.2,-5.1],[0,0],[23,23],[20.2,-4.1],[2,-1.2],[0,0],[-5.4,-6.9],[0,0],[-8.6,5.3],[-3.8,0.5]],"o":[[5,1.8],[5.9,5.9],[2,5.5],[-0.5,4.4],[0,0],[16.4,-30.3],[-13.2,-13.2],[-14,2.8],[0,0],[3.1,6],[0,0],[4.3,-4.1],[5.2,-3.2],[6.9,-1.1]],"v":[[34.743,-23.825],[45.143,-17.025],[56.842,-0.325],[58.242,12.975],[54.042,27.275],[71.042,44.275],[61.342,-33.125],[11.042,-46.825],[-15.857,-36.525],[-81.357,28.875],[-68.558,48.275],[-18.357,-1.825],[3.243,-19.225],[16.742,-24.825]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[81.357,48.275],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":150.000006109625,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[479,385.5,0],"ix":2},"a":{"a":0,"k":[83.5,93.5,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"hasMask":true,"masksProperties":[{"inv":false,"mode":"a","pt":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":5,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[133.25,102.75],[103.75,118.98],[171.5,100.656],[166.583,186.406],[194.833,112.75],[160.315,85]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":7,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[74.028,57.083],[94.389,125.23],[105.028,192.517],[166.583,186.406],[182.277,62.639],[140.537,47.222]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":9,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[7.778,16.833],[-2.111,-3.02],[-8.722,190.017],[166.583,186.406],[182.277,62.639],[140.537,47.222]],"c":true}]},{"t":11.0000004480392,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[93.028,-1.667],[-2.111,-3.02],[-8.722,190.017],[166.583,186.406],[182.277,62.639],[140.537,47.222]],"c":true}]}],"ix":1},"o":{"a":0,"k":100,"ix":3},"x":{"a":0,"k":0,"ix":4},"nm":"Mask 1"}],"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[13.2,-13.2],[-19.1,-32.4],[-7.1,-8.5],[-29.7,-23.6],[-13.6,13.6],[-5.1,5.9],[0,0],[6.3,-6.3],[11.7,-9.9],[0,0],[0,0],[12.3,15.1],[3.9,8.1],[0.3,5.6],[-2.1,5.2],[-5.5,5.5],[-5,1.8],[-6.9,-1.3],[0,0],[-4,-2.3],[0,0],[9.9,2]],"o":[[-24.2,24.2],[4.6,7.8],[16.3,19.5],[19.4,-15.4],[6.3,-6.3],[0,0],[-5,5.9],[-9,9],[0,0],[0,0],[-21.5,-18.1],[-7.8,-9.6],[-3.4,-7],[-0.2,-2.7],[2.1,-5],[2.1,-2.1],[5.2,-1.9],[0,0],[3,0.6],[0,0],[-4.8,-2.4],[-20.2,-4.2]],"v":[[-63.208,-78.097],[-70.508,3.703],[-52.809,28.303],[16.392,93.203],[66.191,49.403],[83.292,31.103],[67.092,14.903],[50.092,33.303],[18.892,61.703],[16.392,63.803],[13.892,61.703],[-37.008,11.603],[-54.708,-15.097],[-60.309,-34.097],[-58.309,-46.197],[-47.008,-61.897],[-36.609,-68.697],[-18.609,-69.597],[-18.508,-69.597],[-8.109,-65.297],[10.092,-83.497],[-12.909,-91.697]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[83.291,93.203],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":5.00000020365417,"op":155.000006313279,"st":5.00000020365417,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[554.5,376,0],"ix":2},"a":{"a":0,"k":[50,48,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"hasMask":true,"masksProperties":[{"inv":false,"mode":"a","pt":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":11,"s":[{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[0,0],[0,95.1],[0,95.1],[0,0]],"c":true}]},{"t":16.0000006516934,"s":[{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[0,0],[0,95.1],[99.2,95.1],[99.2,0]],"c":true}]}],"ix":1},"o":{"a":0,"k":100,"ix":3},"x":{"a":0,"k":0,"ix":4},"nm":"Mask 1"}],"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[3.7,-3.5],[0,0],[-6,3.9]],"o":[[-7.1,4.8],[0,0],[6.4,-5.2],[0,0]],"v":[[-31.9,-47.55],[-49.6,-32.95],[30.9,47.55],[49.6,33.95]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[49.6,47.55],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":11.0000004480392,"op":161.000006557664,"st":11.0000004480392,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"harts","refId":"comp_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[500,500,0],"ix":2},"a":{"a":0,"k":[500,500,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":80,"s":[100,100,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":82,"s":[110,110,100]},{"t":90.0000036657751,"s":[0,0,100]}],"ix":6}},"ao":0,"w":1000,"h":1000,"ip":0,"op":100.000004073084,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"OUTLINE","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[500.436,500.35,0],"ix":2},"a":{"a":0,"k":[243,243,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":10,"s":[118,118,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":13,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":80,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":82,"s":[110,110,100]},{"t":90.0000036657751,"s":[0,0,100]}],"ix":6,"x":"var $bm_rt;\n$bm_rt = transform.scale;"}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[2.7,6.3],[-1.8,8.7],[20.9,20.9],[23.8,0],[7.7,-2],[1.4,10.9],[16.7,16.8],[22.9,0],[6.8,-1.4],[6.2,-2.6],[8.7,1.8],[6.5,0],[16.3,-16.2],[1.9,-20.9],[-2.7,-10.3],[7.5,0],[19.7,-19.7],[-6.2,-30.8],[-2.6,-6.2],[1.8,-8.7],[-20.9,-20.9],[-23.8,0],[-7.7,2],[-1.4,-10.9],[-16.7,-16.8],[-22.9,0],[-6.8,1.4],[-6.2,2.7],[-8.7,-1.8],[-6.6,0],[-16.3,16.2],[-1.9,20.9],[2.7,10.3],[-7.5,0],[-19.7,19.7],[6.3,30.8]],"o":[[2.6,-6.3],[6.3,-30.8],[-19.7,-19.7],[-7.5,0],[2.9,-11.3],[-2.5,-19.8],[-16.2,-16.3],[-6.6,0],[-8.7,1.8],[-6.3,-2.6],[-6.9,-1.4],[-22.9,0],[-17.6,17.6],[-0.9,9.9],[-7.7,-2],[-23.8,0],[-20.9,20.9],[1.8,8.7],[-2.6,6.3],[-6.2,30.8],[19.7,19.7],[7.5,0],[-2.9,11.3],[2.5,19.8],[16.2,16.2],[6.6,0],[8.7,-1.8],[6.3,2.6],[6.9,1.4],[22.9,0],[17.6,-17.6],[0.9,-9.9],[7.7,2],[23.8,0],[20.9,-20.9],[-1.7,-8.8]],"v":[[233.38,-0.05],[240.48,-22.75],[217.78,-102.85],[152.28,-132.55],[129.48,-129.55],[131.78,-162.75],[102.78,-217.85],[42.98,-242.65],[22.78,-240.55],[0.08,-233.45],[-22.72,-240.55],[-42.92,-242.65],[-102.82,-217.85],[-132.22,-159.75],[-129.52,-129.55],[-152.32,-132.55],[-217.82,-102.85],[-240.52,-22.75],[-233.42,-0.05],[-240.52,22.75],[-217.82,102.85],[-152.32,132.55],[-129.52,129.55],[-131.82,162.75],[-102.82,217.85],[-43.02,242.65],[-22.82,240.55],[-0.12,233.45],[22.58,240.55],[42.88,242.65],[102.78,217.85],[132.18,159.75],[129.48,129.55],[152.28,132.55],[217.78,102.85],[240.48,22.75]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.141176470588,0.141176470588,0.145098039216,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[242.564,242.65],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":100.000004073084,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml deleted file mode 100644 index 449a9f93..00000000 --- a/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/android/build.gradle b/android/build.gradle index cd6c32c0..bc157bd1 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,18 +1,3 @@ -buildscript { - ext.kotlin_version = '1.8.21' - repositories { - google() - // jCenter() no longer exists... https://blog.gradle.org/jcenter-shutdown - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.0.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - - } -} - allprojects { repositories { google() @@ -28,7 +13,6 @@ subprojects { project.evaluationDependsOn(':app') } -//removed due to gradle namespace conflicts that are beyond erinn's mere mortal understanding -//task clean(type: Delete) { -// delete rootProject.buildDir -//} +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/android/settings.gradle b/android/settings.gradle index f847febc..cf00f3cb 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app', ':cwtch' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.4.2" apply false + id "org.jetbrains.kotlin.android" version "1.8.21" apply false +} + +include ":app" diff --git a/fetch-libcwtch-go.sh b/fetch-libcwtch-go.sh index d934214e..35295a7b 100755 --- a/fetch-libcwtch-go.sh +++ b/fetch-libcwtch-go.sh @@ -3,6 +3,6 @@ VERSION=`cat LIBCWTCH-GO.version` echo $VERSION -curl --fail https://build.openprivacy.ca/files/libCwtch-autobindings-$VERSION/android/cwtch.aar --output android/cwtch/cwtch.aar +curl --fail https://build.openprivacy.ca/files/libCwtch-autobindings-$VERSION/android/cwtch.aar --output android/app/cwtch/cwtch.aar # FIXME...at some point we need to support different linux architectures...for now rely on existing expectations and rename x64 lib -curl --fail https://build.openprivacy.ca/files/libCwtch-autobindings-$VERSION/linux/libCwtch.x64.so --output linux/libCwtch.so \ No newline at end of file +curl --fail https://build.openprivacy.ca/files/libCwtch-autobindings-$VERSION/linux/libCwtch.x64.so --output linux/libCwtch.so diff --git a/lib/cwtch/cwtchNotifier.dart b/lib/cwtch/cwtchNotifier.dart index 842689fa..65e67921 100644 --- a/lib/cwtch/cwtchNotifier.dart +++ b/lib/cwtch/cwtchNotifier.dart @@ -59,9 +59,7 @@ class CwtchNotifier { switch (type) { case "CwtchStarted": - flwtchState.cwtch.getCwtchDir().then((dir) { - globalSettings.themeloader.LoadThemes(dir); - }); + if (data["Reload"] == "true" && profileCN.num > 0) { // don't reload... @@ -310,6 +308,7 @@ class CwtchNotifier { break; case "UpdateGlobalSettings": settings.handleUpdate(jsonDecode(data["Data"])); + appState.settingsLoaded = true; break; case "UpdatedProfileAttribute": if (data["Key"] == "public.profile.name") { diff --git a/lib/main.dart b/lib/main.dart index 34212601..63abded5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -107,6 +107,9 @@ class FlwtchState extends State with WindowListener { Future.delayed(const Duration(milliseconds: 100), () { print("initState delayed: invoking cwtch.Start()"); cwtch.Start(); + cwtch.getCwtchDir().then((dir) { + globalSettings.themeloader.LoadThemes(dir); + }); }); print("initState: starting connectivityListener"); if (EnvironmentConfig.TEST_MODE == false) { @@ -185,7 +188,7 @@ class FlwtchState extends State with WindowListener { title: 'Cwtch', showSemanticsDebugger: settings.useSemanticDebugger, theme: mkThemeData(settings), - home: (!appState.cwtchInit || appState.modalState != ModalState.none) ? SplashView() : ProfileMgrView(), + home: (!appState.loaded) ? SplashView() : ProfileMgrView(), ), ); }, diff --git a/lib/models/appstate.dart b/lib/models/appstate.dart index 45bc8709..bd5e9a14 100644 --- a/lib/models/appstate.dart +++ b/lib/models/appstate.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:cwtch/config.dart'; +import 'package:cwtch/main.dart'; import 'package:flutter/widgets.dart'; enum ModalState { none, storageMigration, shutdown } @@ -17,6 +18,8 @@ class AppState extends ChangeNotifier { bool _unreadMessagesBelow = false; bool _disableFilePicker = false; bool _focus = true; + bool _settingsLoaded = false; + bool _themesLoaded = false; StreamController _profilesUnreadNotifyControler = StreamController(); late Stream profilesUnreadNotify; @@ -85,6 +88,18 @@ class AppState extends ChangeNotifier { notifyListeners(); } + set settingsLoaded(bool newVal) { + _settingsLoaded = newVal; + notifyListeners(); + } + + set themesLoaded(bool newVal) { + _themesLoaded = newVal; + notifyListeners(); + } + + bool get loaded => cwtchInit && _settingsLoaded && globalSettings.themeloader.themes.length > 0 && modalState == ModalState.none; + bool isLandscape(BuildContext c) => MediaQuery.of(c).size.width > MediaQuery.of(c).size.height; void notifyProfileUnread() { diff --git a/lib/views/torstatusview.dart b/lib/views/torstatusview.dart index beb2c601..c09117a9 100644 --- a/lib/views/torstatusview.dart +++ b/lib/views/torstatusview.dart @@ -31,6 +31,7 @@ class _TorStatusView extends State { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: Provider.of(context).theme.backgroundMainColor, appBar: AppBar( title: Text(AppLocalizations.of(context)!.torNetworkStatus), ),