Skip to content

Commit

Permalink
Update analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
corbindavenport committed May 10, 2023
1 parent 26d62ca commit a4b3eff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:http/http.dart' as http;
import 'dart:io' as io;
import 'package:uuid/uuid.dart';
import 'dart:convert';
import 'package:dart_ipify/dart_ipify.dart';
import 'package:nexustools/sys.dart' as sys;

String macZip = 'https://dl.google.com/android/repository/platform-tools-latest-darwin.zip';
Expand Down Expand Up @@ -210,7 +211,8 @@ void connectAnalytics() async {
var cpu = await sys.getCPUArchitecture();
// Set data
var net = Uri.parse('https://plausible.io/api/event');
var netHeaders = {'user-agent': 'Nexus Tools', 'X-Forwarded-For': '127.0.0.1', 'Content-Type': 'application/json', 'User-Agent': 'Mozilla/5.0 ($realOS) AppleWebKit/500 (KHTML, like Gecko) Chrome/$appVersion $id'};
final ipv4 = await Ipify.ipv4();
var netHeaders = {'user-agent': 'Nexus Tools', 'X-Forwarded-For': ipv4, 'Content-Type': 'application/json', 'User-Agent': 'Mozilla/5.0 ($realOS) AppleWebKit/500 (KHTML, like Gecko) Chrome/$appVersion $id'};
var netBody = '{"name":"pageview","url":"app://localhost/$realOS/$cpu","domain":"nexustools.corbin.io"}';
// Send request
try {
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.2"
dart_ipify:
dependency: "direct dev"
description:
name: dart_ipify
sha256: "3b70d589504126107e81ad0703d91394cc8e2039cb0a11ebd92b9b824a5e9561"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
http:
dependency: "direct dev"
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ dev_dependencies:
io:
uuid:
archive: ^3.2.2
console:
console:
dart_ipify: ^1.1.1

0 comments on commit a4b3eff

Please sign in to comment.