Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
d4894fa
Fix: Ejected expo
earlfranciss Apr 5, 2025
be9aeab
Enh: backend requirement text file
earlfranciss Apr 5, 2025
e254cae
Fix: Procfile gunicorn
earlfranciss Apr 5, 2025
1452f9a
Fix: app module run for backend
earlfranciss Apr 5, 2025
b61383e
Fix: Gunicorn app module
earlfranciss Apr 5, 2025
041180d
Fix: gitignore and Read SMS functionality
earlfranciss Apr 13, 2025
dd02449
Add: Read SMS Functionality
earlfranciss Apr 14, 2025
cc37674
Fix: Merged Screens and Fixed URL Classification Model
earlfranciss Apr 21, 2025
1e7a863
Edit: backend app.py
earlfranciss Apr 22, 2025
03869a2
Fix: Removed Secret Key
earlfranciss Apr 22, 2025
7635852
Fix: backend/app folder rename to fix backend server
earlfranciss Apr 22, 2025
002cb10
Fix: secret key error
earlfranciss Apr 22, 2025
c037da3
Fix: Secret Key added to backend server
earlfranciss Apr 22, 2025
378a7c4
Edit: Added console logs
earlfranciss Apr 22, 2025
20c7d18
Add: Spam detection
earlfranciss Apr 24, 2025
fa89d99
Add: Merged WebView Display
earlfranciss Apr 24, 2025
1b3f4af
Fix: Display result
earlfranciss Apr 24, 2025
5d7b7e2
Fix: modules
earlfranciss Apr 24, 2025
5a62033
Add: App logo
earlfranciss Apr 24, 2025
4bc2145
Add: Changes during defense
earlfranciss Apr 28, 2025
76c4416
Updated-AutoLogin
shwlma Apr 28, 2025
530c6e8
Fix: Remove Delete in Details modal
loloilois Apr 29, 2025
867ed37
Update Notifications.js
ainZurr Apr 29, 2025
e617fb1
Merge branch 'earl3' into miranda2
earlfranciss Apr 30, 2025
d0a1a76
Merge pull request #51 from earlfranciss/miranda2
earlfranciss Apr 30, 2025
af5fe0b
Fix: Remove Edit Profile
loloilois Apr 30, 2025
6ba5bf1
Merge branch 'miranda2' of https://github.com/earlfranciss/SwiftShiel…
loloilois Apr 30, 2025
ac8026b
Added Export in Analytics using XLSX/Excel extension
Apr 30, 2025
c2c0efd
Alert Sound-v1 (network err)
ainZurr Apr 30, 2025
40b30e5
Add: sound file support update sourcesets
ainZurr May 1, 2025
0bc81e8
Merge branch 'earl3' into binangkal/export
earlfranciss May 1, 2025
15d5c3e
Merge pull request #53 from earlfranciss/binangkal/export
earlfranciss May 1, 2025
6ebf09f
Merge pull request #52 from earlfranciss/miranda2
earlfranciss May 1, 2025
c3d44fc
Add: Alert notif sound
ainZurr May 1, 2025
804c2fa
Merge branch 'earl3' into hans3
earlfranciss May 1, 2025
3dff8de
Merge pull request #57 from earlfranciss/sheilmae3
shwlma May 1, 2025
7782f1f
Fix: Gmail Scanning
earlfranciss May 1, 2025
b3a6c3f
Merge pull request #58 from earlfranciss/testNewGmail
earlfranciss May 1, 2025
6886bfa
Debug: google-login
earlfranciss May 1, 2025
6180d2b
Debug: userid in google-callback
earlfranciss May 1, 2025
2d5ddfa
Debug: session expires
earlfranciss May 1, 2025
8464d29
Debug: console logs for user-id
earlfranciss May 1, 2025
37c4def
Debug: fixing userID
earlfranciss May 1, 2025
3c6689f
Fix: google-callback return url
earlfranciss May 1, 2025
ba61073
Fix: exchange_auth_code's app.config
earlfranciss May 1, 2025
1f4ed30
Fix: exchange_auth_code userID error
earlfranciss May 1, 2025
52d68bb
Fix: authCode json
earlfranciss May 1, 2025
79f0cc4
Debug: logs
earlfranciss May 1, 2025
4c5c27a
Debug: redirect uri's in exchange_auth_code
earlfranciss May 2, 2025
5d97db3
Debug: use of redirect uri
earlfranciss May 2, 2025
c7f2504
Debug: scope fix
earlfranciss May 2, 2025
74ade9b
Merge branch 'earl3' of https://github.com/earlfranciss/SwiftShield i…
ainZurr May 2, 2025
88370d2
Merge branch 'hans3' of https://github.com/earlfranciss/SwiftShield i…
ainZurr May 2, 2025
d11ee3c
line graph, bar graph, themeContext color
May 2, 2025
8665988
fix: merge conflict
ainZurr May 2, 2025
b222e00
fixes
May 2, 2025
6c569b0
fixes
May 2, 2025
0117644
Merge branch 'earl3' into binangkal/analytics-linegraph
earlfranciss May 2, 2025
cc704ff
fixes merge
May 2, 2025
5450d59
fixes merge
May 2, 2025
fb6db74
Merge pull request #59 from earlfranciss/binangkal/analytics-linegraph
notchilibaguette May 2, 2025
75b7dce
Revert "line graph, bar graph, themeContext color"
notchilibaguette May 2, 2025
112611c
Merge pull request #60 from earlfranciss/revert-59-binangkal/analytic…
earlfranciss May 2, 2025
1716d39
Merge pull request #54 from earlfranciss/hans3
earlfranciss May 2, 2025
bf23962
Add: Warning and Notification sound
earlfranciss Sep 27, 2025
08bd64e
Merge branch 'earl3' of https://github.com/earlfranciss/SwiftShield i…
earlfranciss Sep 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ app-example
__pycache__/
*.pyc

venv
venv

backend/client_secret_web.json
backend/client_secret.json
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/AndroidProjectSystem.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/SwiftShield.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/R.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/R2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/base.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/base2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/gradle_wrapper.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reanimated-disable-native-build=true
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable"
}
114 changes: 114 additions & 0 deletions BackgroundTaskHandler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import config from './src/config/config';
import axios from 'axios';

// Import utility for URL extraction if needed locally (alternative to backend)
// import { extractUrlsFromText } from '../utils/helpers';


const sendSmsToBackend = async (smsData) => {
if (!smsData || !smsData.body) {
console.log('[BackgroundTask] Received incomplete SMS data:', smsData);
return null; // Indicate no result
}
console.log(`[BackgroundTask] Processing SMS from ${smsData.sender}: ${smsData.body.substring(0, 50)}...`);

// --- OPTION 1: Call Backend for Extraction AND Classification ---
// (Using the unified /predict/scan endpoint that handles body)
const endpoint = `${config.BASE_URL}/scan`;
const payload = {
body: smsData.body,
sender: smsData.sender
};
console.log(`[BackgroundTask] Sending to ${endpoint} with payload:`, JSON.stringify(payload));
try {
const response = await fetch(endpoint, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
});
if (!response.ok) {
const errorText = await response.text();
console.error(`[BackgroundTask] Backend Scan Error (${response.status}):`, errorText);
throw new Error(`Backend error: ${response.status}`);
}
const data = await response.json();
console.log("[BackgroundTask] Unified Scan Result:", data);
// Add sender back for potential notification generation
data.sender = smsData.sender;
return data; // Return the classification result
} catch (error) {
console.error("[BackgroundTask] Error during unified scan fetch:", error.message);
return null; // Indicate error
}

// --- OPTION 2: Call Backend ONLY for Extraction ---
/*
const extractionEndpoint = `${config.BASE_URL}/sms/classify_content`;
const extractionPayload = { body: smsData.body, sender: smsData.sender };
console.log(`[BackgroundTask] Requesting URL extraction from ${extractionEndpoint}`);
try {
const extractionResponse = await fetch(extractionEndpoint, { ... });
if (!extractionResponse.ok) throw new Error(...);
const extractionData = await extractionResponse.json();
const extractedUrls = extractionData.extracted_urls || [];
console.log("[BackgroundTask] Extracted URLs:", extractedUrls);

if (extractedUrls.length > 0) {
// If URLs found, scan the FIRST one (or loop and aggregate results)
const urlToScan = extractedUrls[0];
const scanEndpoint = `${config.BASE_URL}/predict/scan`;
const scanPayload = { url: urlToScan };
console.log(`[BackgroundTask] Scanning extracted URL: ${urlToScan}`);
const scanResponse = await fetch(scanEndpoint, { method: 'POST', ... });
if (!scanResponse.ok) throw new Error(...);
const scanData = await scanResponse.json();
scanData.sender = smsData.sender; // Add sender back
return scanData; // Return the URL scan result
} else {
console.log("[BackgroundTask] No URLs found in SMS body.");
// Return a "safe" result for non-URL text if desired
return { classification: "safe", prediction: 1, sender: smsData.sender, reason: "No URL found" };
}
} catch (error) {
console.error("[BackgroundTask] Error during SMS processing pipeline:", error.message);
return null;
}
*/
};

// --- Main Headless Task Function ---
// This function is called by the OS when triggered by the native service
module.exports = async (taskData) => {
console.log('[BackgroundTask] Task Received:', taskData);

// Check the type of task (e.g., from SMS or another trigger)
// This structure depends on what your Native Service sends
if (taskData && taskData.type === 'SMS_RECEIVED' && taskData.message) {
const smsMessage = taskData.message; // { originatingAddress: '...', body: '...' }

// Process the SMS data
const classificationResult = await sendSmsToBackend(smsMessage);

// If phishing detected by backend, trigger a system notification
if (classificationResult && classificationResult.prediction === 0) { // Assuming 0 = Phishing
console.log('[BackgroundTask] Phishing detected! Scheduling notification.');
try {
// Use NotificationService directly (ensure it's initialized properly for background use if needed)
const NotificationService = require('../services/NotificationService'); // Import service here
const title = "⚠️ Phishing Alert!";
const body = `Suspicious content detected in SMS from ${smsMessage.originatingAddress || 'Unknown Sender'}.`;
NotificationService.scheduleNotification(title, body, classificationResult); // Pass result data
} catch (notifError) {
console.error('[BackgroundTask] Failed to schedule notification:', notifError);
}
} else if (classificationResult) {
console.log('[BackgroundTask] SMS processed, result:', classificationResult.classification);
} else {
console.log('[BackgroundTask] SMS processing failed or no result.');
}
}
// Add handlers for other potential task types here (e.g., background fetch)

console.log('[BackgroundTask] Task Finished.');
// A Headless JS task should return a Promise, but often just completing is enough
};
7 changes: 7 additions & 0 deletions FeatureFlagsSetup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// FeatureFlagsSetup.js
import { NativeModules } from 'react-native';

// Disable bridgeless architecture feature
if (NativeModules.ReactNativeFeatureFlags) {
NativeModules.ReactNativeFeatureFlags.setBridgelessArchitectureEnabled(false);
}
Binary file added REQUIREMENT.txt
Binary file not shown.
25 changes: 0 additions & 25 deletions REQUIREMENTS.txt

This file was deleted.

107 changes: 61 additions & 46 deletions ai-models/Classifier.ipynb

Large diffs are not rendered by default.

Loading