diff --git a/lib/controllers/stringcontroller.dart b/lib/controllers/stringcontroller.dart index b822973..a95388c 100644 --- a/lib/controllers/stringcontroller.dart +++ b/lib/controllers/stringcontroller.dart @@ -139,12 +139,12 @@ class StrController extends GetxController { var openPluginManagerStr = 'Open Plugin Manager'.obs; var loadPluginStr = 'Load Plugin'.obs; var zerohelloSiteDesStr = 'Say Hello to ZeroNet, a Dashboard to manage ' - 'all your ZeroNet Z(S)ites, You can view feed of other zites like ' - 'posts, comments of other users from ZeroTalk as well for your posts ' - 'and Stats like Total Requests sent and received from other peers on ZeroNet. ' + 'all your ZeroNetX Z(S)ites, You can view feed of other zites like ' + 'posts, comments of other users from ThreadIt as well for your posts ' + 'and Stats like Total Requests sent and received from other peers on ZeroNetX. ' 'You can also pause, clone or favourite, delete Zites from single page.' .obs; - var zeronetMobileSiteDesStr = 'Forum to report ZeroNet Mobile app issues. ' + var zeronetMobileSiteDesStr = 'Forum to report ZeroNetX app issues. ' 'Want a new feature in the app, Request a Feature. ' 'Facing any Bugs while using the app ? ' 'Just report problem here, we will take care of it. ' @@ -152,17 +152,17 @@ class StrController extends GetxController { 'Just dive into to this Zite.' .obs; var zeroTalkSiteDesStr = 'Need a forum to discuss something, ' - 'we got covered you here. ZeroTalk fits your need, ' + 'we got covered you here. ThreadIt fits your need, ' 'just post something to get opinion from others on Network. ' 'Have some queries ? don\'t hesitate to ask here.' 'Tired of Spam ? Who don\'t! You can mute individual users also.' .obs; var zeroblogSiteDesStr = 'Want to Know Where ZeroNet is Going ? ' - 'ZeroBlog gives you latest changes and improvements ' - 'made to ZeroNet, including Bug Fixes, ' - 'Speed Improvements of ZeroNet Core Software. ' + 'Scribe gives you latest changes and improvements ' + 'made to ZeroNetX, including Bug Fixes, ' + 'Speed Improvements of ZeroNetX Core Software. ' 'Also Provides varies links to ZeroNet Protocol and ' - 'how ZeroNet works underhood and much more things to know.' + 'how ZeroNetX works underhood and much more things to know.' .obs; var zeromailSiteDesStr = 'So you need a mail service, use ZeroMail, ' 'fully end-to-end encrypted mail service on ZeroNet, ' diff --git a/lib/others/constants.dart b/lib/others/constants.dart index 5694faf..d4a3a13 100644 --- a/lib/others/constants.dart +++ b/lib/others/constants.dart @@ -117,8 +117,8 @@ class Utils { static const String urlZeroNetMob = '15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk'; static const String urlTalk = 'Talk.ZeroNetwork.bit'; static const String btcUrlTalk = '1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT'; - static const String urlBlog = 'Blog.ZeroNetwork.bit'; - static const String btcUrlBlog = '1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8'; + static const String urlBlog = '1SCribeHs1nz8m3vXipP84oyXUy4nf2ZD'; + static const String btcUrlBlog = '1SCribeHs1nz8m3vXipP84oyXUy4nf2ZD'; static const String urlMail = 'Mail.ZeroNetwork.bit'; static const String btcUrlMail = '1MaiL5gfBM1cyb4a8e3iiL8L5gXmoAJu27'; static const String urlMe = 'Me.ZeroNetwork.bit'; @@ -137,6 +137,11 @@ class Utils { 'url': urlZeroNetMob, 'btcAddress': urlZeroNetMob, }, + 'Scribe': { + 'description': strController.zeroblogSiteDesStr.value, + 'url': urlBlog, + 'btcAddress': btcUrlBlog, + }, 'ZeroMe': { 'description': strController.zeromeSiteDesStr.value, 'url': urlMe, @@ -147,21 +152,11 @@ class Utils { 'url': urlSites, 'btcAddress': btcUrlSites, }, - 'ZeroBlog': { - 'description': strController.zeroblogSiteDesStr.value, - 'url': urlBlog, - 'btcAddress': btcUrlBlog, - }, 'ZeroMail': { 'description': strController.zeromailSiteDesStr.value, 'url': urlMail, 'btcAddress': btcUrlMail, }, - // 'ZeroTalk': { - // 'description': strController.zeroTalkSiteDesStr.value, - // 'url': urlTalk, - // 'btcAddress': btcUrlTalk, - // }, }; // 'ZeroName': '1Name2NXVi1RDPDgf5617UoW7xA6YrhM9F', diff --git a/lib/others/utils.dart b/lib/others/utils.dart index f9e4f76..6b8870a 100644 --- a/lib/others/utils.dart +++ b/lib/others/utils.dart @@ -118,33 +118,35 @@ bindUnZipIsolate() { bindUnZipIsolate(); return; } - unZipIsolateBound = true; - _unZipPort.listen((data) { - String name = data[0]; - int currentFile = data[1]; - int totalFiles = data[2]; - var percent = (currentFile / totalFiles) * 100; - if (percent.toInt() % 5 == 0) { - varStore.setLoadingStatus('${strController.installingStr.value} $name'); - varStore.setLoadingPercent(percent.toInt()); - } - if (percent == 100) { - percentUnZip = percentUnZip + 100; - } - var nooffiles = files(arch).length; - if (percentUnZip == nooffiles * 100) { - if (requiresPatching()) { - var patchFile = File(dataDir + '/$buildNumber.patched'); - if (!patchFile.existsSync()) { - patchFile.createSync(recursive: true); + if (!unZipIsolateBound) { + unZipIsolateBound = true; + _unZipPort.listen((data) { + String name = data[0]; + int currentFile = data[1]; + int totalFiles = data[2]; + var percent = (currentFile / totalFiles) * 100; + if (percent.toInt() % 5 == 0) { + varStore.setLoadingStatus('${strController.installingStr.value} $name'); + varStore.setLoadingPercent(percent.toInt()); + } + if (percent == 100) { + percentUnZip = percentUnZip + 100; + } + var nooffiles = files(arch).length; + if (percentUnZip == nooffiles * 100) { + if (requiresPatching()) { + var patchFile = File(dataDir + '/$buildNumber.patched'); + if (!patchFile.existsSync()) { + patchFile.createSync(recursive: true); + } } + printOut('Installation Completed', isNative: true); + makeExecHelper().then((value) => isExecPermitted = value); + uninstallModules(); + check(); } - printOut('Installation Completed', isNative: true); - makeExecHelper().then((value) => isExecPermitted = value); - uninstallModules(); - check(); - } - }); + }); + } } void _unbindUnZipIsolate() { @@ -286,14 +288,15 @@ unZipinBgWin() async { File item = File(dataDir + sep + 'ZeroNet-win.zip'); var name = item.path.split(sep).last; zeroNetState = state.INSTALLING; - await compute( - _unzipBytesAsyncWin, - UnzipParams( - name, - item.readAsBytesSync(), - dest: '', - ), - ); + if (item.existsSync()) + await compute( + _unzipBytesAsyncWin, + UnzipParams( + name, + item.readAsBytesSync(), + dest: '', + ), + ); check(); } @@ -307,32 +310,38 @@ void _unzipBytesAsyncWin(UnzipParams params) async { } printOut("UnZippingFiles......."); var out = dataDir + '/' + params.dest; - Archive archive = ZipDecoder().decodeBytes(params.bytes); - int totalfiles = archive.length; - int i = 0; - for (ArchiveFile file in archive) { - String filename = file.name; - printOut('$out$filename'); - i++; - final SendPort send = IsolateNameServer.lookupPortByName(isolateUnZipPort); - send.send([params.item, i, totalfiles]); - String outName = '$out' + filename; - if (file.isFile) { - List data = file.content; - // if (!File(outName).existsSync()) { - File f = File(outName); - if (!f.existsSync()) - f - ..createSync(recursive: true) - ..writeAsBytesSync(data); - // } - } else { - Directory(outName).exists().then((exists) { - if (!exists) Directory(outName)..create(recursive: true); - }); + try { + Archive archive = ZipDecoder().decodeBytes(params.bytes); + int totalfiles = archive.length; + int i = 0; + for (ArchiveFile file in archive) { + String filename = file.name; + printOut('$out$filename'); + i++; + final SendPort send = + IsolateNameServer.lookupPortByName(isolateUnZipPort); + send.send([params.item, i, totalfiles]); + String outName = '$out' + filename; + if (file.isFile) { + List data = file.content; + // if (!File(outName).existsSync()) { + File f = File(outName); + if (!f.existsSync()) + f + ..createSync(recursive: true) + ..writeAsBytesSync(data); + // } + } else { + Directory(outName).exists().then((exists) { + if (!exists) Directory(outName)..create(recursive: true); + }); + } } + File(installedMetaDir(metaDir.path, params.item)) + .createSync(recursive: true); + } catch (e) { + printOut(e.toString()); } - File(installedMetaDir(metaDir.path, params.item)).createSync(recursive: true); } void _unzipBytesAsync(UnzipParams params) async { diff --git a/lib/widgets/home_page.dart b/lib/widgets/home_page.dart index df51ce0..be7eeeb 100644 --- a/lib/widgets/home_page.dart +++ b/lib/widgets/home_page.dart @@ -22,6 +22,7 @@ class HomePage extends StatelessWidget { padding: EdgeInsets.only(bottom: 30), ), ZeroNetStatusWidget(), + if (PlatformExt.isDesktop) SizedBox(height: 8), ZeroNetUserStatusWidget(), Padding( padding: EdgeInsets.only(bottom: 15), @@ -334,7 +335,8 @@ class PopularZeroNetSites extends StatelessWidget { bool isZite1Exists = isZiteExitsLocally( Utils.initialSites[item1]['btcAddress'], ); - return isZite1Exists ? 0 : 1; + //TODO: Check if this breaks in mobile sorting + return !isZite1Exists ? 0 : 1; }); } for (var key in siteKeys) { @@ -371,6 +373,10 @@ class PopularZeroNetSites extends StatelessWidget { ), ], ), + if (PlatformExt.isDesktop) + SizedBox( + height: 10, + ), ListView( shrinkWrap: true, children: zeroSites, diff --git a/lib/widgets/settings_page.dart b/lib/widgets/settings_page.dart index 620930f..3224798 100644 --- a/lib/widgets/settings_page.dart +++ b/lib/widgets/settings_page.dart @@ -17,6 +17,7 @@ class SettingsPage extends StatelessWidget { child: Column( children: [ ZeroNetAppBar(), + if (PlatformExt.isDesktop) SizedBox(height: 8), ListView.builder( physics: BouncingScrollPhysics(), shrinkWrap: true,