Permalink
Browse files

Create module for tcpdump binary

Contains tcpdump binary and libpcap library dependance.
Dedicated module improves build time and separes concerns.
  • Loading branch information...
PerfectSlayer committed May 6, 2018
1 parent 1979a5f commit d776ebdcd183c360834d69ca797307114cedf440
Showing 565 changed files with 75 additions and 47 deletions.
View
@@ -1,8 +1,10 @@
apply plugin: 'com.android.application'
repositories {
jcenter()
google()
}
dependencies {
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
@@ -12,13 +14,13 @@ dependencies {
implementation 'com.android.support:support-fragment:27.1.1'
implementation 'com.evernote:android-job:1.2.4'
implementation project(':libraries:RootCommands')
implementation project(':tcpdump')
implementation project(':webserver')
implementation 'net.sf.trove4j:trove4j:3.0.3'
implementation 'org.sufficientlysecure:html-textview:2.0'
implementation 'org.sufficientlysecure:donations:2.4'
}
def getGitSha1 = { ->
def stdout = new ByteArrayOutputStream()
exec {
@@ -29,12 +31,6 @@ def getGitSha1 = { ->
}
android {
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
compileSdkVersion 27
buildToolsVersion '27.0.3'
@@ -79,47 +75,8 @@ android {
abortOnError false
}
externalNativeBuild {
ndkBuild {
path 'jni/Android.mk'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
/**
* Task to rename executables from hello_world to libhello_world_exec.so
* If they look like libraries, they are packaged in the apk and deployed on the device in the lib folder!
*
* http://www.gradle.org/docs/current/userguide/working_with_files.html
*/
task renameDebugExecutables(type: Sync) {
from('build/intermediates/ndkBuild/debug/obj/local') {
rename(/(.+)/, 'lib$1_exec.so')
}
into 'libs'
exclude '*/objs'
exclude '*/*.a'
}
task renameReleaseExecutables(type: Sync) {
from('build/intermediates/ndkBuild/release/obj/local') {
rename(/(.+)/, 'lib$1_exec.so')
}
into 'libs'
exclude '*/objs'
exclude '*/*.a'
}
gradle.projectsEvaluated {
if (project.hasProperty('packageDebug')) {
packageDebug.dependsOn renameDebugExecutables
}
if (project.hasProperty('packageRelease')) {
packageRelease.dependsOn renameReleaseExecutables
}
}
View
@@ -1,2 +1,2 @@
include ':app', ':webserver'
include ':app', ':tcpdump', ':webserver'
include ':libraries:RootCommands'
View
@@ -0,0 +1,3 @@
/.externalNativeBuild
/build
/libs
View
@@ -0,0 +1,63 @@
apply plugin: 'com.android.library'
android {
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
externalNativeBuild {
ndkBuild {
path 'jni/Android.mk'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
}
/**
* Task to rename executables from hello_world to libhello_world_exec.so
* If they look like libraries, they are packaged in the apk and deployed on the device in the lib folder!
*
* http://www.gradle.org/docs/current/userguide/working_with_files.html
*/
task renameDebugExecutables(type: Sync) {
from('build/intermediates/ndkBuild/debug/obj/local') {
rename(/(.+)/, 'lib$1_exec.so')
}
into 'libs'
exclude '*/objs*'
exclude '*/*.a'
}
task renameReleaseExecutables(type: Sync) {
from('build/intermediates/ndkBuild/release/obj/local') {
rename(/(.+)/, 'lib$1_exec.so')
}
into 'libs'
exclude '*/objs'
exclude '*/*.a'
}
gradle.projectsEvaluated {
if (project.hasProperty('assembleDebug')) {
assembleDebug.dependsOn renameDebugExecutables
}
if (project.hasProperty('assembleRelease')) {
assembleRelease.dependsOn renameReleaseExecutables
}
}
View
@@ -0,0 +1,3 @@
include jni/libpcap/Android.mk
include jni/tcpdump/Android.mk
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.

0 comments on commit d776ebd

Please sign in to comment.