Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ced264e
Remove old https solution and add large scale https with bloom filter
subsymbolic Jul 20, 2018
8caf81b
Tidy up, remove unneeded companion references
subsymbolic Jul 26, 2018
64046e7
Update tooling
subsymbolic Jul 26, 2018
7785241
Move bloom filter from project to submodule.
subsymbolic Jul 26, 2018
388e1c9
Tidy up test names
subsymbolic Jul 27, 2018
3498c36
Add comments to indicate final urls
subsymbolic Jul 27, 2018
832c700
Update submodule
subsymbolic Jul 27, 2018
4413fb0
Update submodule to use https to see if BitRise copes with this better
subsymbolic Jul 30, 2018
11c2067
Tidy up post-merge
subsymbolic Jul 30, 2018
0e2fcd1
Update submodule and tidy up tests
subsymbolic Aug 1, 2018
b601e82
Update dependency
subsymbolic Aug 1, 2018
9630543
Fix junit import
subsymbolic Aug 1, 2018
541f98f
Merge branch 'develop' into feature/large_scale_https_upgrades
subsymbolic Aug 1, 2018
2124dc5
Merge branch 'develop' into feature/large_scale_https_upgrades
subsymbolic Aug 8, 2018
671af10
Update to final urls
subsymbolic Aug 10, 2018
b63ef34
Merge branch 'develop' into feature/large_scale_https_upgrades
subsymbolic Aug 10, 2018
bee47a1
Remove additional whitelist clear
subsymbolic Aug 10, 2018
2b8e67f
Remove old branch from module
subsymbolic Aug 10, 2018
85a05f3
Improve variable name
subsymbolic Aug 10, 2018
5ce6fc5
Update bitrise config to include avd version
subsymbolic Aug 13, 2018
15967f6
Rename constants for better clarity
subsymbolic Aug 13, 2018
e090202
Simplify upgrade threading and add logging
subsymbolic Aug 14, 2018
1eaf1c4
Update bloom to point to release tag
subsymbolic Aug 14, 2018
844d00e
Update timestamp call
subsymbolic Aug 15, 2018
0086bda
Increase architecture components to 1.1.1
subsymbolic Aug 15, 2018
e60eec5
Add transaction for full updates (where we delete then insert new rec…
subsymbolic Aug 15, 2018
0651883
Make query case consistent with rest of project
subsymbolic Aug 15, 2018
6d52256
Another update to case
subsymbolic Aug 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "app/libs/OnionKit"]
path = app/libs/OnionKit
url = https://github.com/guardianproject/NetCipher.git
[submodule "app/src/main/cpp/third-party/bloom_cpp"]
path = app/src/main/cpp/third-party/bloom_cpp
url = https://github.com/duckduckgo/bloom_cpp.git
23 changes: 17 additions & 6 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,23 @@ add_library( # Sets the name of the library.

# Provides a relative path to your source file(s).
src/main/cpp/adblockclient-lib.cpp
src/main/cpp/ad-block/ad_block_client.cc
src/main/cpp/ad-block/cosmetic_filter.cc
src/main/cpp/ad-block/filter.cc
src/main/cpp/bloom-filter-cpp/BloomFilter.cpp
src/main/cpp/bloom-filter-cpp/hashFn.cpp
src/main/cpp/hashset-cpp/HashSet.cpp
src/main/cpp/third-party/ad-block/ad_block_client.cc
src/main/cpp/third-party/ad-block/cosmetic_filter.cc
src/main/cpp/third-party/ad-block/filter.cc
src/main/cpp/third-party/bloom-filter-cpp/BloomFilter.cpp
src/main/cpp/third-party/bloom-filter-cpp/hashFn.cpp
src/main/cpp/third-party/hashset-cpp/HashSet.cpp
)

add_library( # Sets the name of the library.
https-bloom-lib

# Sets the library as a shared library.
SHARED

# Provides a relative path to your source file(s).
src/main/cpp/https-bloom-lib.cpp
src/main/cpp/third-party/bloom_cpp/src/BloomFilter.cpp
)

# Searches for a specified prebuilt library and stores the path as a
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ android {

ext {
supportLibrary = "27.1.1"
architectureComponents = "1.1.0"
architectureComponents = "1.1.1"
architectureComponentsExtensions = "1.1.1"
androidKtx = "0.3"
dagger = "2.14.1"
Expand Down
302 changes: 302 additions & 0 deletions app/schemas/com.duckduckgo.app.global.db.AppDatabase/4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,302 @@
{
"formatVersion": 1,
"database": {
"version": 4,
"identityHash": "a80686f1ea7760530a37dec6214a19f4",
"entities": [
{
"tableName": "disconnect_tracker",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `category` TEXT NOT NULL, `networkName` TEXT NOT NULL, `networkUrl` TEXT NOT NULL, PRIMARY KEY(`url`))",
"fields": [
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "category",
"columnName": "category",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "networkName",
"columnName": "networkName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "networkUrl",
"columnName": "networkUrl",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"url"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "https_bloom_filter_spec",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `errorRate` REAL NOT NULL, `totalEntries` INTEGER NOT NULL, `sha256` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "errorRate",
"columnName": "errorRate",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "totalEntries",
"columnName": "totalEntries",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "sha256",
"columnName": "sha256",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "https_whitelisted_domain",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`domain` TEXT NOT NULL, PRIMARY KEY(`domain`))",
"fields": [
{
"fieldPath": "domain",
"columnName": "domain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"domain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "network_leaderboard",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`networkName` TEXT NOT NULL, `domainVisited` TEXT NOT NULL, PRIMARY KEY(`networkName`, `domainVisited`))",
"fields": [
{
"fieldPath": "networkName",
"columnName": "networkName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "domainVisited",
"columnName": "domainVisited",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"networkName",
"domainVisited"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "site_visited",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`domain` TEXT NOT NULL, PRIMARY KEY(`domain`))",
"fields": [
{
"fieldPath": "domain",
"columnName": "domain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"domain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "app_configuration",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `appConfigurationDownloaded` INTEGER NOT NULL, PRIMARY KEY(`key`))",
"fields": [
{
"fieldPath": "key",
"columnName": "key",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "appConfigurationDownloaded",
"columnName": "appConfigurationDownloaded",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"key"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "tabs",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`tabId` TEXT NOT NULL, `url` TEXT, `title` TEXT, PRIMARY KEY(`tabId`))",
"fields": [
{
"fieldPath": "tabId",
"columnName": "tabId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"tabId"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_tabs_tabId",
"unique": false,
"columnNames": [
"tabId"
],
"createSql": "CREATE INDEX `index_tabs_tabId` ON `${TABLE_NAME}` (`tabId`)"
}
],
"foreignKeys": []
},
{
"tableName": "tab_selection",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `tabId` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`tabId`) REFERENCES `tabs`(`tabId`) ON UPDATE NO ACTION ON DELETE SET NULL )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "tabId",
"columnName": "tabId",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_tab_selection_tabId",
"unique": false,
"columnNames": [
"tabId"
],
"createSql": "CREATE INDEX `index_tab_selection_tabId` ON `${TABLE_NAME}` (`tabId`)"
}
],
"foreignKeys": [
{
"table": "tabs",
"onDelete": "SET NULL",
"onUpdate": "NO ACTION",
"columns": [
"tabId"
],
"referencedColumns": [
"tabId"
]
}
]
},
{
"tableName": "bookmarks",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `title` TEXT, `url` TEXT NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
}
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"a80686f1ea7760530a37dec6214a19f4\")"
]
}
}
4 changes: 4 additions & 0 deletions app/src/androidTest/java/com/duckduckgo/app/FileUtilities.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ object FileUtilities {
fun loadText(resourceName: String): String =
javaClass.classLoader.getResource(resourceName).openStream().bufferedReader().use { it.readText() }


fun loadLines(resourceName: String): List<String> =
javaClass.classLoader.getResource(resourceName).openStream().bufferedReader().use { it.readLines() }

}
Loading