Skip to content

Commit

Permalink
Use git submodules to pull dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuele-f committed Jan 21, 2021
1 parent d207f79 commit fad1ee8
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 38 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "submodules/nDPI"]
path = submodules/nDPI
url = https://github.com/ntop/nDPI
[submodule "submodules/zdtun"]
path = submodules/zdtun
url = https://github.com/emanuele-f/zdtun
5 changes: 3 additions & 2 deletions .idea/vcs.xml

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

11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ PCAPdroid integrates [nDPI](https://github.com/ntop/nDPI) to detect the applicat

## Building

1. Clone this repo locally
2. Clone https://github.com/emanuele-f/zdtun beside this repository
3. Clone https://github.com/ntop/nDPI beside this repository
4. Link the cmake file into nDPI: from this repo execute: `ln -s $(readlink -f nDPI/CMakeLists.txt) ../nDPI`
4. Inside the nDPI directory, run `git checkout 3.4-stable; ./autogen.sh; ./configure --disable-gcrypt`
6. Build the `zdtun` and `ndpi` modules first
7. Then build the `app` module
1. Clone this repo
2. Run `git submodule update --init`
3. Build the `zdtun` and `ndpi` modules first
4. Then build the `app` module
11 changes: 5 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,17 @@ android {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(path: ':zdtun')
implementation project(path: ':ndpi')
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.viewpager:viewpager:1.0.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'com.google.android.material:material:1.2.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation project(path: ':zdtun')
implementation 'cat.ereza:customactivityoncrash:2.2.0'
implementation project(path: ':ndpi')
implementation 'org.nanohttpd:nanohttpd:2.3.1'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
testImplementation 'junit:junit:4.12'
}
17 changes: 0 additions & 17 deletions nDPI/CMakeLists.txt

This file was deleted.

6 changes: 3 additions & 3 deletions ndpi/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
compileSdkVersion 30
buildToolsVersion "29.0.2"


defaultConfig {
Expand All @@ -23,7 +23,7 @@ android {
}
externalNativeBuild {
cmake {
path file('../../nDPI/CMakeLists.txt')
path file('src/main/CMakeLists.txt')
}
}

Expand Down
10 changes: 10 additions & 0 deletions ndpi/src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 2.8.11)
include(ExternalProject)

set(CMAKE_VERBOSE_MAKEFILE ON)
set(ROOTDIR ../../../../../submodules/nDPI)
add_definitions(-DNDPI_LIB_COMPILATION)

ExternalProject_Add(libndpi
SOURCE_DIR ${ROOTDIR}
CONFIGURE_COMMAND ./autogen.sh COMMAND ./configure --disable-gcrypt)
1 change: 1 addition & 0 deletions submodules/nDPI
Submodule nDPI added at 75898a
1 change: 1 addition & 0 deletions submodules/zdtun
Submodule zdtun added at 5f6331
6 changes: 3 additions & 3 deletions zdtun/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
compileSdkVersion 30
buildToolsVersion "29.0.2"


defaultConfig {
Expand All @@ -23,7 +23,7 @@ android {
}
externalNativeBuild {
cmake {
path file('../../zdtun/CMakeLists.txt')
path file('../submodules/zdtun/CMakeLists.txt')
}
}
}
Expand Down

0 comments on commit fad1ee8

Please sign in to comment.