Skip to content

Commit 96ce6fc

Browse files
authored
Alpha - 2 (#22)
* Tablet detection with KISS principle * Batch load settings translation * Batch load settings test * UA Translation fix * Batch load settings release * Update dependencies * Index page overflow fix testing * New text entries for testing * Export function placeholder UI * Fixed that absence of the username made the app unresponsive. * Translations for upcoming feature * Added Changelog * Changed dependencies and incremented app version * Updated the Readme * Removed obsolete permissions * Added saving indexed files to JSON
1 parent ec812a6 commit 96ce6fc

File tree

10 files changed

+1011
-801
lines changed

10 files changed

+1011
-801
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This app is made with crowdsourcing in mind. This means that after we finish our
1919
### Indexing
2020
This app helps you analyze what connections channels have. This is possible due to the continuous process of analyzing messages and resolving connections on reposts.
2121
When you index a channel, the app reads up to 50 messages from the channel, starting at the latest message, and checks if between those messages there is a repost of any channel. If the repost is found, then the app checks if it "knows" that channel (i.e. if this is the first repost from this channel among all indexed channels), if not - it gets info about the channel and its icon, if yes - increments amount of reposts for the connection.
22-
In the end, it results in a list of connections that this channel has against all other channels, and you can then go and index another channel to get connections of the connection and so on.
22+
In the end, it results in a list of connections that this channel has against all other channels, and you can then go and index another channel to get connections of the connection and so on. User can download indexed channel data.
2323

2424
### Relations map
2525
After indexing, the app creates a map of the indexed channels. If you have one channel indexed, it will look like a central node with connections radiating from it.

Diff for: android/app/src/debug/AndroidManifest.xml

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->
66
<uses-permission android:name="android.permission.INTERNET"/>
7-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
8-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
9-
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
107
<application
118
android:requestLegacyExternalStorage="true"/>
129
</manifest>

Diff for: android/settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pluginManagement {
1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
2121
id "com.android.application" version "7.3.0" apply false
22-
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
22+
id "org.jetbrains.kotlin.android" version "2.0.21" apply false
2323
}
2424

2525
include ":app"

Diff for: assets/config/en.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,12 @@
9696
"repo_desc": "App's GitHub repository",
9797
"settings_batches_title": "Request amount",
9898
"settings_batches_desc": "Request (MESSAGES) messages at once\nMore = faster, less = smoother",
99-
"settings_batches_tip" : "(MESSAGES)"
99+
"settings_batches_tip" : "(MESSAGES)",
100+
"export_data_title": "Export",
101+
"export_data_desc": "Select your preferred export format",
102+
"exporting_data_title": "Exporting",
103+
"exporting_data_desc": "Exporting now, hold on please. We'll save the file in your Downloads folder on device.",
104+
"exported_data_title": "Exported!",
105+
"exported_data_desc": "Exporting done, you can open the file now. It is in your Downloads folder on device.",
106+
"close": "Close"
100107
}

Diff for: assets/config/uk.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,12 @@
9595
"repo_desc": "Репозиторій додатку на GitHub",
9696
"settings_batches_title": "Завантаження повідомлень",
9797
"settings_batches_desc": "Запитувати (MESSAGES) повідомлень за раз\nБільше = ефективніше, меньше = плавніше",
98-
"settings_batches_tip" : "(MESSAGES)"
98+
"settings_batches_tip" : "(MESSAGES)",
99+
"export_data_title": "Експортувати",
100+
"export_data_desc": "Оберіть бажаний формат для експорту",
101+
"exporting_data_title": "Експортуємо",
102+
"exporting_data_desc": "Відбувається запис файлу. Після завершення дані будуть в папці Downloads на цьому девайсі.",
103+
"exported_data_title": "Експортовано!",
104+
"exported_data_desc": "Файл збережено. Він знаходиться в папці Downloads цього девайсу.",
105+
"close": "Закрити"
99106
}

Diff for: changelog.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Update 0.0.3 [3] (Alpha - 2)
2+
#### Export
3+
- You can now save indexed channels in `JSON` format
4+
#### Fixes
5+
- Fixed app being unresponsive if the @username is not set

Diff for: lib/main.dart

+916-752
Large diffs are not rendered by default.

Diff for: lib/tgback.dart

+22-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import 'package:device_info_plus/device_info_plus.dart';
66
import 'package:flutter/foundation.dart';
77
import 'package:flutter/material.dart';
88
import 'package:flutter/services.dart';
9+
import 'package:flutter_file_dialog/flutter_file_dialog.dart';
910
import 'package:fluttertoast/fluttertoast.dart';
1011
import 'package:graphview/GraphView.dart';
1112
import 'package:path_provider/path_provider.dart';
13+
import 'package:permission_handler/permission_handler.dart';
1214
import 'package:pretty_json/pretty_json.dart';
1315
import 'package:restart_app/restart_app.dart';
1416
import 'package:rxdart/rxdart.dart';
@@ -101,6 +103,8 @@ class tgProvider with ChangeNotifier {
101103

102104
bool isTablet = false;
103105

106+
bool isFileSaved = false;
107+
bool isFileRequested = false;
104108

105109
void init() async {
106110
if (Platform.isAndroid) {
@@ -196,9 +200,26 @@ class tgProvider with ChangeNotifier {
196200
notifyListeners();
197201
}
198202

203+
saveJSON(name, data) async {
204+
notifyListeners();
205+
if (!await FlutterFileDialog.isPickDirectorySupported()) {
206+
throw Exception("Picking directory not supported");
207+
}
208+
final pickedDirectory = await FlutterFileDialog.pickDirectory();
209+
if (pickedDirectory != null) {
210+
await FlutterFileDialog.saveFileToDirectory(
211+
directory: pickedDirectory,
212+
data: Uint8List.fromList(utf8.encode(prettyJson(data, indent: 2))),
213+
mimeType: "application/json",
214+
fileName: "$name.json",
215+
replace: true,
216+
);
217+
}
218+
}
219+
199220

200221
getConfigOnline() async {
201-
var remoteAssets = "https://raw.githubusercontent.com/Puzzaks/tgcrawl/dev/assets/config";
222+
var remoteAssets = "https://raw.githubusercontent.com/Puzzaks/tgcrawl/master/assets/config";
202223
status = "Loading configuration...";
203224
notifyListeners();
204225
final intros = await http.get(

Diff for: pubspec.lock

+47-39
Original file line numberDiff line numberDiff line change
@@ -93,31 +93,39 @@ packages:
9393
dependency: transitive
9494
description:
9595
name: file
96-
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
96+
sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
9797
url: "https://pub.dev"
9898
source: hosted
99-
version: "7.0.0"
99+
version: "7.0.1"
100100
file_picker:
101101
dependency: "direct main"
102102
description:
103103
name: file_picker
104-
sha256: "167bb619cdddaa10ef2907609feb8a79c16dfa479d3afaf960f8e223f754bf12"
104+
sha256: "16dc141db5a2ccc6520ebb6a2eb5945b1b09e95085c021d9f914f8ded7f1465c"
105105
url: "https://pub.dev"
106106
source: hosted
107-
version: "8.1.2"
107+
version: "8.1.4"
108108
flutter:
109109
dependency: "direct main"
110110
description: flutter
111111
source: sdk
112112
version: "0.0.0"
113+
flutter_file_dialog:
114+
dependency: "direct main"
115+
description:
116+
name: flutter_file_dialog
117+
sha256: "9344b8f07be6a1b6f9854b723fb0cf84a8094ba94761af1d213589d3cb087488"
118+
url: "https://pub.dev"
119+
source: hosted
120+
version: "3.0.2"
113121
flutter_plugin_android_lifecycle:
114122
dependency: transitive
115123
description:
116124
name: flutter_plugin_android_lifecycle
117-
sha256: "9ee02950848f61c4129af3d6ec84a1cfc0e47931abc746b03e7a3bc3e8ff6eda"
125+
sha256: "9b78450b89f059e96c9ebb355fa6b3df1d6b330436e0b885fb49594c41721398"
118126
url: "https://pub.dev"
119127
source: hosted
120-
version: "2.0.22"
128+
version: "2.0.23"
121129
flutter_test:
122130
dependency: "direct dev"
123131
description: flutter
@@ -260,10 +268,10 @@ packages:
260268
dependency: transitive
261269
description:
262270
name: path_provider_android
263-
sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7"
271+
sha256: c464428172cb986b758c6d1724c603097febb8fb855aa265aeecc9280c294d4a
264272
url: "https://pub.dev"
265273
source: hosted
266-
version: "2.2.10"
274+
version: "2.2.12"
267275
path_provider_ios:
268276
dependency: transitive
269277
description:
@@ -316,10 +324,10 @@ packages:
316324
dependency: transitive
317325
description:
318326
name: permission_handler_android
319-
sha256: "76e4ab092c1b240d31177bb64d2b0bea43f43d0e23541ec866151b9f7b2490fa"
327+
sha256: "71bbecfee799e65aff7c744761a57e817e73b738fedf62ab7afd5593da21f9f1"
320328
url: "https://pub.dev"
321329
source: hosted
322-
version: "12.0.12"
330+
version: "12.0.13"
323331
permission_handler_apple:
324332
dependency: transitive
325333
description:
@@ -332,10 +340,10 @@ packages:
332340
dependency: transitive
333341
description:
334342
name: permission_handler_html
335-
sha256: af26edbbb1f2674af65a8f4b56e1a6f526156bc273d0e65dd8075fab51c78851
343+
sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24"
336344
url: "https://pub.dev"
337345
source: hosted
338-
version: "0.1.3+2"
346+
version: "0.1.3+5"
339347
permission_handler_platform_interface:
340348
dependency: transitive
341349
description:
@@ -364,10 +372,10 @@ packages:
364372
dependency: transitive
365373
description:
366374
name: platform
367-
sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
375+
sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"
368376
url: "https://pub.dev"
369377
source: hosted
370-
version: "3.1.5"
378+
version: "3.1.6"
371379
plugin_platform_interface:
372380
dependency: transitive
373381
description:
@@ -396,10 +404,10 @@ packages:
396404
dependency: "direct main"
397405
description:
398406
name: restart_app
399-
sha256: "00d5ec3e9de871cedbe552fc41e615b042b5ec654385e090e0983f6d02f655ed"
407+
sha256: b37daeb1c02fcab30e19d9e30b6fdd215bd53577efd927042eb77cf6f09daadb
400408
url: "https://pub.dev"
401409
source: hosted
402-
version: "1.3.2"
410+
version: "1.2.1"
403411
rxdart:
404412
dependency: "direct main"
405413
description:
@@ -412,26 +420,26 @@ packages:
412420
dependency: "direct main"
413421
description:
414422
name: shared_preferences
415-
sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051"
423+
sha256: "95f9997ca1fb9799d494d0cb2a780fd7be075818d59f00c43832ed112b158a82"
416424
url: "https://pub.dev"
417425
source: hosted
418-
version: "2.3.2"
426+
version: "2.3.3"
419427
shared_preferences_android:
420428
dependency: transitive
421429
description:
422430
name: shared_preferences_android
423-
sha256: "480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e"
431+
sha256: "3b9febd815c9ca29c9e3520d50ec32f49157711e143b7a4ca039eb87e8ade5ab"
424432
url: "https://pub.dev"
425433
source: hosted
426-
version: "2.3.2"
434+
version: "2.3.3"
427435
shared_preferences_foundation:
428436
dependency: transitive
429437
description:
430438
name: shared_preferences_foundation
431-
sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f
439+
sha256: "07e050c7cd39bad516f8d64c455f04508d09df104be326d8c02551590a0d513d"
432440
url: "https://pub.dev"
433441
source: hosted
434-
version: "2.5.2"
442+
version: "2.5.3"
435443
shared_preferences_linux:
436444
dependency: transitive
437445
description:
@@ -529,26 +537,26 @@ packages:
529537
dependency: transitive
530538
description:
531539
name: typed_data
532-
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
540+
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
533541
url: "https://pub.dev"
534542
source: hosted
535-
version: "1.3.2"
543+
version: "1.4.0"
536544
url_launcher:
537545
dependency: "direct main"
538546
description:
539547
name: url_launcher
540-
sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3"
548+
sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603"
541549
url: "https://pub.dev"
542550
source: hosted
543-
version: "6.3.0"
551+
version: "6.3.1"
544552
url_launcher_android:
545553
dependency: transitive
546554
description:
547555
name: url_launcher_android
548-
sha256: e35a698ac302dd68e41f73250bd9517fe3ab5fa4f18fe4647a0872db61bacbab
556+
sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193"
549557
url: "https://pub.dev"
550558
source: hosted
551-
version: "6.3.10"
559+
version: "6.3.14"
552560
url_launcher_ios:
553561
dependency: transitive
554562
description:
@@ -561,10 +569,10 @@ packages:
561569
dependency: transitive
562570
description:
563571
name: url_launcher_linux
564-
sha256: e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af
572+
sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935"
565573
url: "https://pub.dev"
566574
source: hosted
567-
version: "3.2.0"
575+
version: "3.2.1"
568576
url_launcher_macos:
569577
dependency: transitive
570578
description:
@@ -593,10 +601,10 @@ packages:
593601
dependency: transitive
594602
description:
595603
name: url_launcher_windows
596-
sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185"
604+
sha256: "44cf3aabcedde30f2dba119a9dea3b0f2672fbe6fa96e85536251d678216b3c4"
597605
url: "https://pub.dev"
598606
source: hosted
599-
version: "3.1.2"
607+
version: "3.1.3"
600608
vector_math:
601609
dependency: transitive
602610
description:
@@ -609,10 +617,10 @@ packages:
609617
dependency: transitive
610618
description:
611619
name: vm_service
612-
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
620+
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
613621
url: "https://pub.dev"
614622
source: hosted
615-
version: "14.2.5"
623+
version: "14.2.4"
616624
web:
617625
dependency: transitive
618626
description:
@@ -625,10 +633,10 @@ packages:
625633
dependency: transitive
626634
description:
627635
name: win32
628-
sha256: "4d45dc9069dba4619dc0ebd93c7cec5e66d8482cb625a370ac806dcc8165f2ec"
636+
sha256: "84ba388638ed7a8cb3445a320c8273136ab2631cd5f2c57888335504ddab1bc2"
629637
url: "https://pub.dev"
630638
source: hosted
631-
version: "5.5.5"
639+
version: "5.8.0"
632640
win32_registry:
633641
dependency: transitive
634642
description:
@@ -641,10 +649,10 @@ packages:
641649
dependency: transitive
642650
description:
643651
name: xdg_directories
644-
sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d
652+
sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15"
645653
url: "https://pub.dev"
646654
source: hosted
647-
version: "1.0.4"
655+
version: "1.1.0"
648656
xml:
649657
dependency: "direct main"
650658
description:
@@ -654,5 +662,5 @@ packages:
654662
source: hosted
655663
version: "6.5.0"
656664
sdks:
657-
dart: ">=3.5.1 <4.0.0"
665+
dart: ">=3.5.0 <4.0.0"
658666
flutter: ">=3.24.0"

Diff for: pubspec.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: tgcrawl
22
description: "Project for Indexing of Telegram Channel Connections"
33
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
44

5-
version: 0.0.2+2
5+
version: 0.0.3+3
66

77
environment:
88
sdk: '>=2.19.3 <3.0.0'
@@ -28,8 +28,9 @@ dependencies:
2828
provider: ^6.0.5
2929
pretty_json: ^2.0.0
3030
graphview: ^1.2.0
31-
restart_app: ^1.3.2
31+
restart_app: 1.2.1
3232
fluttertoast: ^8.0.8
33+
flutter_file_dialog: ^3.0.2
3334

3435

3536

0 commit comments

Comments
 (0)