Skip to content

Latest commit

 

History

History
executable file
·
117 lines (71 loc) · 7.07 KB

README.md

File metadata and controls

executable file
·
117 lines (71 loc) · 7.07 KB

CheckMyDigitalFootprint

GIF

CheckMyDigitalFootprint is an application that allows a user to regulate the email services they have subscribed to, preventing unwanted emails and clutter from rendering their inbox unusable.

CheckMyDigitalFootprint works by using the Gmail API to search through a users emails. Emails that are scanned as "subscription" are then parsed for sender, loaded into the application, and designated as "keep" or "discard" based on the users preference. This is done through parsing the raw email data the Gmail API returns which includes a "From" header and a "List-Unsubscribe" header. Only emails that include the unsubscribe option at the bottom of the email will have the "List-Unsubscribe" field. Parsing of emails was decoded using base64url encoding.

Features

The application has additional features which improve ease of access for the user. These are the save and load file features. The save and load features allow the user to easily access credentials which the Gmail API requires authorization for every time a new user attempts to use their API. CheckMyDigitalFootprint also remembers previous saved file paths so you don't have to load files on each start up. Additionally, data is stored as an xml.

Multithreading is used by the application in order to improve the scan time of emails and prevent lag. Alongside with batch calling this results in a very quick process by which the user is able to scan through their entire inbox and there is no evident lag to the emails coming in. Furthermore, multithreading allows us to add different features to the application such as pause and resume which would not have been possible without it due to input lag.

Batch requesting was an additional feature which was necessary for our application to run correctly. Initially we were looping through a users inbox, but by using batches we designated work to the API instead in sending us groups of emails. This resulted in a much faster process as the email ID did not have to be verified every time and is now processed in batches which are returned at once.

To ensure further optimization, all data is also loaded into an ObservableMap (JavaFX's equivalent of HashMap) upon starting the application that acts as a lookup table. When the application then scans through your inbox it checks to see if the listserv already exists in the data store without having to iterate through an entire List.

User Manual

A user will load the application, allow the Gmail API to access their email account and press scan. There are pause and resume buttons which allow the user to interact with the scanning process. Emails that are designated as subscription will be parsed by the application for the sender and that sender will be loaded into the application where the user can designate them as keep or discard. Save and load buttons allow the user to keep authorization credentials.

Setup

Please ensure you have the following:

Run Executable .jar

In the root there is an executable jar: CheckMyDigitalFootprint.jar.

Then run with the following command:

java --module-path="<PATH-TO-JAVAFX-SDK-LIB-FOLDER>/javafx-sdk-11.0.1/lib" \
--add-modules=javafx.controls \
--add-exports=javafx.graphics/com.sun.javafx.util=ALL-UNNAMED \
--add-exports=javafx.base/com.sun.javafx.reflect=ALL-UNNAMED \
--add-exports=javafx.base/com.sun.javafx.beans=ALL-UNNAMED \
--add-exports=javafx.graphics/com.sun.glass.utils=ALL-UNNAMED \
--add-exports=javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED -jar CheckMyDigitalFootprint.jar

Ensure that you have replaced the correct jar name and <PATH-TO-JAVAFX-SDK-LIB-FOLDER> with your own file path to the JavaFX 11 SDK. It should look something like this: /users/my_name/downloads/javafx-sdk-11.0.1/lib.

Setup for Gradle

Then in settings.gradle, set the Java home field to your Java 11 JDK directory:

E.g:

org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home

Then in the project root folder, run:

gradle build
gradle run

Setup for Eclipse

Additional setup is required for Eclipse. Ensure that the following are installed:

With the following plugins:

Open the project from File > Open Projects from File System... and make the changes to settings.gradle.

You will also need to add the JavaFX 11 library by right clicking the project Build Path > Configure Build Path > Libraries > Add Library > User Library.

Also ensure that Java 11 is set as the JRE.

Then right click project folder again and click on Configure > Add Gradle Nature. Eclipse should now recognise the project as a Gradle project. Then right click again and click on Gradle > Refresh Gradle Project to install the dependencies.

One last step before you run the application: goto Run > Run Configurations > Arguments and under VM Arguments paste in the following ensuring that you copy in your own JavaFX11 SDK jar path:

--module-path="<PATH_TO_JAVAFX_11_SDK>/javafx-sdk-11.0.1/lib" \
--add-modules=javafx.controls \
--add-exports=javafx.graphics/com.sun.javafx.util=ALL-UNNAMED \
--add-exports=javafx.base/com.sun.javafx.reflect=ALL-UNNAMED \
--add-exports=javafx.base/com.sun.javafx.beans=ALL-UNNAMED \
--add-exports=javafx.graphics/com.sun.glass.utils=ALL-UNNAMED \
--add-exports=javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED

Finally you will be able to get the application running! (If you haven't noticed it's much easier to just use Gradle ;))

Testing

All tests utilize the TestFX framework. They can be found under src/main/test.

Gmail API Key Setup

On first load of the application you will be prompted to upload a Gmail API key. This is to give you a peace of mind that we're not out to steal your data in any way or form!

Gmail API keys can be downloaded as a credentials.json file. It will require you to enable the Gmail API from your Google account. Please click on the blue "ENABLE THE GMAIL API" button here.

Scanning your inbox

Once your API key is loaded you're ready to start scanning. Simply press the big purple "Scan" button and start scanning away! All listserver email addresses automatically goto the "Delete List", but you may choose to decide to keep some. If so, simply click on the cell and move to the keep list.

Ensure that after each scan you save your data so that you don't have to restart again the next time you reload the app.

Enjoy!