Skip to content

Commit

Permalink
fix: analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
terminalsin committed Dec 29, 2024
1 parent fcad96a commit ff796d5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dev.skidfuscator.obfuscator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ dependencies {

implementation project(':sdk')
implementation 'com.github.lukfor:magic-progress:0.3.2'
implementation 'com.github.matomo-org:matomo-java-tracker:3.0.6'
implementation("org.piwik.java.tracking:matomo-java-tracker:3.4.0")

api 'com.github.Col-E:jphantom:1.4.3'
implementation 'dev.dirs:directories:26'
implementation 'de.femtopedia.dex2jar:dex2jar:2.4.24'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
import org.topdank.byteengineer.commons.data.JarContents;

import java.io.File;
import java.io.IOException;
import java.net.URI;

import java.net.URL;
Expand Down Expand Up @@ -383,7 +384,10 @@ public void run() {

private void _runAnalytics() {
final MatomoTracker tracker = new MatomoTracker(
TrackerConfiguration.builder().apiEndpoint(URI.create("https://analytics.skidfuscator.dev/matomo.php")).build()
TrackerConfiguration
.builder()
.apiEndpoint(URI.create("https://analytics.ghast.dev/matomo.php"))
.build()
);
final MatomoRequest request = MatomoRequest.request()
.siteId(1)
Expand All @@ -392,6 +396,17 @@ private void _runAnalytics() {
.campaignName("community")
.campaignKeyword("launch")
.pluginJava(true)
.userId(MiscUtil.getHwid())
.additionalParameters(Map.of(
"version", VERSION,
"java_version", String.valueOf(MiscUtil.getJavaVersion()),
"os", System.getProperty("os.name"),
"os_version", System.getProperty("os.version"),
"os_arch", System.getProperty("os.arch")
))
.serverTime(System.currentTimeMillis())
.customAction(true)
.apiVersion(VERSION)
.eventAction("launch")
.eventCategory("skidfuscator/community")
.eventName("Java")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.experimental.UtilityClass;

import java.lang.reflect.Array;
import java.util.Base64;
import java.util.List;
import java.util.Locale;

Expand Down Expand Up @@ -62,4 +63,13 @@ public String toCamelCase(final String s) {
s.toUpperCase(Locale.ROOT).replace(' ', '_')
);
}

public static String getHwid(){
return "%s (%s [%s] C: %d)".formatted(
System.getProperty("user.name"),
System.getProperty("os.name"),
System.getProperty("os.arch"),
Runtime.getRuntime().availableProcessors()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void test2() throws Exception {
.config(new File(TestSkidfuscator.class.getResource("/config/runtime_new.hocon").getFile()))
.jmod(MiscUtil.getJavaVersion() > 8)
.phantom(true)
.analytics(false)
.analytics(true)
.debug(true)
.build();

Expand Down

0 comments on commit ff796d5

Please sign in to comment.