Skip to content

Commit b8e0381

Browse files
authored
Merge pull request #2 from MrSnou/bugFixes/v0.2-SecurityImprovements
SLA v0.2 - Bug fixes, new features, first public MVP version.
2 parents 2d44995 + 982970b commit b8e0381

15 files changed

Lines changed: 455 additions & 40 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
TO-DO.md
22
dist
33
target/
4+
app.log
45
.mvn/wrapper/maven-wrapper.jar
56
!**/src/main/**/target/
67
!**/src/test/**/target/

HowToRun.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## 🖥️ Installation (2 clicks — for recruiters)
2+
3+
The application is distributed as a **standalone EXE** built with `jpackage`.
4+
5+
### ✔ Requirements
6+
Nothing except:
7+
- Windows 10/11 (Currently on win 10 System Logs are not working - TODO)
8+
- Local user profile
9+
- Windows PowerShell (built-in on Windows 10/11)
10+
11+
> **Java is bundled inside the EXE**.
12+
> You do NOT need to install Java.
13+
14+
### ✔ Running the app
15+
1. Download `SystemLogAnalyzer.rar`
16+
2. unpack it with winrar anywhere.
17+
3. Double-click on SystemLogAnalyzer.exe
18+
4. (Optional) If Security logs are selected → confirm Windows UAC popup
19+
20+
That's all.
21+
22+
## 📦 How it works
23+
24+
### 1. Choose:
25+
- directory for storing exported CSVs
26+
- directory for saving reports
27+
- log types (Application / System / Security)
28+
29+
### 2. The app:
30+
- runs PowerShell → exports CSV
31+
- parses records
32+
- loads them into a JavaFX table
33+
34+
### 3. You can:
35+
- filter
36+
- search
37+
- inspect details
38+
- refresh logs anytime
39+
40+
All without touching Event Viewer manually.

HowToRun_PL.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## 🖥️ Instalacja (2 kliknięcia — dla rekruterów)
2+
3+
Aplikacja jest dystrybuowana jako **samodzielny plik EXE** zbudowany przy użyciu `jpackage`.
4+
5+
### ✔ Wymagania
6+
Nic poza:
7+
- Windows 10/11
8+
- Lokalnym profilem użytkownika
9+
- Windows PowerShell (built-in on Windows 10/11)
10+
11+
> **Java jest dołączona do pliku EXE**.
12+
> NIE musisz instalować Javy.
13+
14+
### ✔ Uruchamianie aplikacji
15+
1. Pobierz `SystemLogAnalyzer.exe`
16+
2. Wypakuj program w dowolne miejsce
17+
3. Kliknij go dwukrotnie na SystemLogAnalyzer.exe
18+
4. (Opcjonalnie) Jeśli wybrano dzienniki zabezpieczeń → potwierdź wyskakujące okienko UAC systemu Windows
19+
20+
To wszystko.
21+
22+
## 📦 Jak to działa
23+
24+
### 1. Wybierz:
25+
- katalog do przechowywania wyeksportowanych plików CSV
26+
- katalog do zapisywania raportów
27+
- typy logów (Aplikacja/System/Zabezpieczenia)
28+
29+
### 2. Aplikacja:
30+
- uruchamia program PowerShell → eksportuje plik CSV
31+
- analizuje rekordy
32+
- ładuje je do tabeli JavaFX
33+
34+
### 3. Możesz:
35+
- filtrować
36+
- wyszukiwać
37+
- sprawdzać szczegóły
38+
- odświeżać logi w dowolnym momencie
39+
40+
Wszystko to bez ręcznego uruchamiania Podglądu zdarzeń.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# System Log Analyzer (Work in progress — v0.1 MVP)
1+
# System Log Analyzer (Work in progress — v0.2)
22

33
**System Log Analyzer** A standalone Windows desktop application for IT professionals to export,
44
parse and analyze Windows Event Logs with a fast, clean and modern UI.

pom.xml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<dependencies>
2020

21-
<!-- CZYSTY SPRING (bez Boot) -->
21+
<!-- Clear Spring -->
2222
<dependency>
2323
<groupId>org.springframework</groupId>
2424
<artifactId>spring-context</artifactId>
@@ -46,12 +46,19 @@
4646
<version>25-ea+1</version>
4747
</dependency>
4848

49+
<!-- JNA core + platform for elevating app to admin permissions -->
50+
<dependency>
51+
<groupId>net.java.dev.jna</groupId>
52+
<artifactId>jna</artifactId>
53+
<version>5.13.0</version>
54+
</dependency>
55+
4956
</dependencies>
5057

5158
<build>
5259
<plugins>
5360

54-
<!-- Kompilator Javy -->
61+
<!-- Java compilator -->
5562
<plugin>
5663
<groupId>org.apache.maven.plugins</groupId>
5764
<artifactId>maven-compiler-plugin</artifactId>
@@ -71,7 +78,7 @@
7178
</configuration>
7279
</plugin>
7380

74-
<!-- Wyłącz testy przy build -->
81+
<!-- mvn skip tests (because there is none . . . yet!)-->
7582
<plugin>
7683
<groupId>org.apache.maven.plugins</groupId>
7784
<artifactId>maven-surefire-plugin</artifactId>

src/main/java/com/project/system_log_analyzer/SystemLogAnalyzerApp.java

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,61 @@
88
import javafx.stage.Stage;
99
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
1010

11+
import java.io.FileNotFoundException;
12+
import java.io.FileOutputStream;
13+
import java.io.PrintStream;
14+
1115
public class SystemLogAnalyzerApp extends Application {
1216

17+
private boolean app_Log = false;
18+
1319
private AnnotationConfigApplicationContext springContext;
1420

21+
private static Boolean elevatedFlag = false; // Admin permissions
22+
1523
@Override
1624
public void init() {
1725
springContext = new AnnotationConfigApplicationContext(SpringConfig.class);
26+
27+
if (app_Log) { // debug app.log in main directory
28+
PrintStream out = null;
29+
try {
30+
out = new PrintStream(new FileOutputStream("app.log", true), true);
31+
} catch (FileNotFoundException e) {
32+
throw new RuntimeException(e);
33+
}
34+
System.setOut(out);
35+
System.setErr(out);
36+
}
37+
38+
39+
1840
}
1941

2042
@Override
2143
public void start(Stage primaryStage) throws Exception {
2244
FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/WelcomeView.fxml"));
2345
loader.setControllerFactory(springContext::getBean);
2446

25-
Parent root = loader.load();
47+
boolean elevated = getParameters().getRaw().contains("--elevated");
48+
elevatedFlag = elevated; // Admin profile checker
2649

50+
System.out.println("ARGS = " + getParameters().getRaw()); // Admin permission check to debug file
51+
52+
com.project.system_log_analyzer.config.appConfig cfg = springContext.getBean(com.project.system_log_analyzer.config.appConfig.class);
53+
54+
if (elevated) {
55+
cfg.setCsvSecurity(true);
56+
}
57+
58+
try {
59+
cfg.setCsvSecurity(elevated);
60+
IO.println("Elevated mode: " + elevated);
61+
} catch (Exception e) {
62+
System.err.println("Could not set elevated flag in appConfig: " + e.getMessage());
63+
}
64+
65+
Parent root = loader.load();
2766
SpringConfig.APP_READY = true;
2867

2968
Scene scene = new Scene(root);
@@ -37,6 +76,10 @@ public void stop() {
3776
springContext.close();
3877
}
3978

79+
public static boolean isElevated() {
80+
return Boolean.TRUE.equals(elevatedFlag);
81+
}
82+
4083
public static void main(String[] args) {
4184
launch(args);
4285
}

src/main/java/com/project/system_log_analyzer/config/SpringConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.project.system_log_analyzer.config;
22

33

4+
import com.project.system_log_analyzer.SystemLogAnalyzerApp;
5+
import org.springframework.context.annotation.Bean;
46
import org.springframework.context.annotation.ComponentScan;
57
import org.springframework.context.annotation.Configuration;
68

src/main/java/com/project/system_log_analyzer/config/appConfig.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,33 @@ public class appConfig {
99
private boolean csvApplication;
1010
private boolean csvSystem;
1111
private boolean csvSecurity;
12+
private boolean noLogs;
13+
private boolean saveInExeDir;
14+
private boolean relaunch;
15+
16+
public boolean isRelaunch() {
17+
return relaunch;
18+
}
19+
20+
public void setRelaunch(boolean relaunch) {
21+
this.relaunch = relaunch;
22+
}
23+
24+
public boolean isNoLogs() {
25+
return noLogs;
26+
}
27+
28+
public void setNoLogs(boolean noLogs) {
29+
this.noLogs = noLogs;
30+
}
31+
32+
public boolean isSaveInExeDir() {
33+
return saveInExeDir;
34+
}
35+
36+
public void setSaveInExeDir(boolean saveInExeDir) {
37+
this.saveInExeDir = saveInExeDir;
38+
}
1239

1340
public boolean isCsvSecurity() {
1441
return csvSecurity;

src/main/java/com/project/system_log_analyzer/controller/MainWindowFXController.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ public void onRefreshClick() {
175175
refreshButton.setDisable(true);
176176
logTable.setDisable(true);
177177
loadingLabel.setText("Refreshing logs… Please wait. (Time of loading depends on number of logs)");
178+
logTable.getSelectionModel().clearSelection();
179+
logTable.getFocusModel().focus(-1); // Details unexpected pop-up || Fixed
180+
onClearFilters(); // Clear all filters
178181

179182
Task<List<LogEvent>> task = new Task<List<LogEvent>>() {
180183
@Override
@@ -222,6 +225,8 @@ protected List<LogEvent> call() throws Exception {
222225
}
223226
@FXML
224227
public void onSearchChanged() {
228+
logTable.getSelectionModel().clearSelection();
229+
logTable.getFocusModel().focus(-1); // Details unexpected pop-up || Fixed
225230
applyFilters();
226231
}
227232

@@ -244,6 +249,9 @@ public void onFilterChanged() {
244249
private void applyFilters() {
245250
if (logs == null) return;
246251

252+
logTable.getSelectionModel().clearSelection();
253+
logTable.getFocusModel().focus(-1);
254+
247255
String input = searchField.getText().toLowerCase().trim();
248256

249257
// input correctness check

0 commit comments

Comments
 (0)