Skip to content

Commit 8e8e0bb

Browse files
author
Sujal Charak
committed
Merge remote-tracking branch 'origin/main' into feature/privacy-ai-advanced
2 parents fc37055 + e95d406 commit 8e8e0bb

7 files changed

Lines changed: 35 additions & 7 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
<div align="center">
2+
<img src="resources/icon.png" alt="Privacy Radar Icon" width="128" height="128">
3+
14
# Privacy Radar
25

6+
</div>
7+
38
**Privacy Radar** is a comprehensive privacy monitoring application built with Electron, React, and TypeScript. It provides real-time network traffic analysis and system permission monitoring to help users understand and control their digital privacy.
49

510
## Overview
2.93 MB
Binary file not shown.

docs/SDD Document - 1st Draft.docx

1.67 MB
Binary file not shown.

docs/SDD Document - Final.pdf

1.41 MB
Binary file not shown.

src/main/app/window-manager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BrowserWindow, shell } from 'electron'
1+
import { app, BrowserWindow, shell } from 'electron'
22
import { join } from 'path'
33
import { is, optimizer } from '@electron-toolkit/utils'
44

@@ -21,6 +21,7 @@ export function createMainWindow(): BrowserWindow {
2121
shell.openExternal(details.url)
2222
return { action: 'deny' }
2323
})
24+
app.setAppUserModelId('Privacy Radar')
2425

2526
if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
2627
mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL'])

src/renderer/src/components/ExportReports.tsx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
import { CardContent, CardHeader, Card, CardTitle } from './ui/card'
2-
import { useState } from 'react'
2+
import { useEffect, useState } from 'react'
33
import { Button } from './ui/button'
44
import Excel from 'exceljs'
55
import FileSaver from 'file-saver'
66
import { Bounce, ToastContainer, toast } from 'react-toastify'
77
import 'react-toastify/dist/ReactToastify.css'
88
import { Database, Download, MoveRight } from 'lucide-react'
99

10+
async function fetchTables(
11+
setTables: React.Dispatch<React.SetStateAction<string[]>>
12+
): Promise<void> {
13+
console.log('Fetching table names from database...')
14+
const [tableNames, error_message] = await window.api.queryDatabase(
15+
"SELECT name FROM sqlite_master WHERE type='table'"
16+
)
17+
console.log('Received table names:', tableNames, 'Error message:', error_message)
18+
if (!error_message && Array.isArray(tableNames)) {
19+
setTables((tableNames as { name: string }[]).map((table) => table.name))
20+
}
21+
}
22+
1023
async function exportReports(sqlQuery: string): Promise<void> {
1124
if (!sqlQuery || sqlQuery.trim() === '') {
1225
toast.error('Please enter a valid SQL query.')
@@ -46,9 +59,13 @@ async function exportReports(sqlQuery: string): Promise<void> {
4659
}
4760
}
4861
}
49-
5062
function ExportReports({ darkMode }: { darkMode: boolean }): React.JSX.Element {
5163
const [inputValue, setInputValue] = useState('')
64+
const [tables, setTables] = useState(Array<string>())
65+
66+
useEffect(() => {
67+
fetchTables(setTables)
68+
}, [])
5269

5370
return (
5471
<Card className="flex flex-col">
@@ -63,12 +80,10 @@ function ExportReports({ darkMode }: { darkMode: boolean }): React.JSX.Element {
6380
<CardContent className="flex-1 overflow-auto no-scrollbar pr-2">
6481
<div className="w-full mb-4 border border-default-medium rounded-base bg-neutral-secondary-medium shadow-xs">
6582
<div className="px-4 py-2 bg-neutral-secondary-medium rounded-t-base">
66-
<label htmlFor="comment" className="sr-only">
67-
SELECT * FROM application_snapshots
68-
</label>
6983
<textarea
84+
title={tables.join('\n')}
7085
id="comment"
71-
className="block w-full px-0 text-sm text-heading bg-neutral-secondary-medium border-0 focus:ring-0 placeholder:text-body"
86+
className="block w-full px-0 text-sm text-heading bg-neutral-secondary-medium border-0 focus:ring-0"
7287
placeholder="Enter your query here..."
7388
required
7489
onChange={(e) => setInputValue(e.target.value)}

src/renderer/src/components/SystemMonitor.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ export function SystemMonitor(): React.JSX.Element {
6969
return updated.some((e) => e.id === event.id) ? updated : [event, ...updated]
7070
})
7171
} else {
72+
const NOTIFICATION_TITLE = (event.service || 'System Monitor') + ' Access Alert'
73+
const NOTIFICATION_BODY = event.appName + ' has ' + event.service + ' permission.'
74+
75+
new Notification(NOTIFICATION_TITLE, {
76+
body: NOTIFICATION_BODY,
77+
icon: '../../resources/icon.ico'
78+
})
7279
setActiveSessions((prev) => {
7380
const exists = prev.find((s) => s.id === event.id)
7481
if (exists) {

0 commit comments

Comments
 (0)