From 9b12ebf8b1ea319c1660a65102c9b119e3b83d5a Mon Sep 17 00:00:00 2001 From: Davide Depau Date: Thu, 16 Aug 2018 13:39:37 +0200 Subject: [PATCH] Include dmg2img executable in build --- .gitmodules | 9 +++++++++ app/build.gradle | 1 + dmg2img/CMakeLists.txt | 18 ++++++++++++++++++ dmg2img/build.gradle | 22 ++++++++++++++++++++++ dmg2img/src/c/bzip2 | 1 + dmg2img/src/c/dmg2img | 1 + dmg2img/src/c/libressl | 1 + dmg2img/src/main/AndroidManifest.xml | 3 +++ settings.gradle | 2 +- 9 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 dmg2img/CMakeLists.txt create mode 100644 dmg2img/build.gradle create mode 160000 dmg2img/src/c/bzip2 create mode 160000 dmg2img/src/c/dmg2img create mode 160000 dmg2img/src/c/libressl create mode 100644 dmg2img/src/main/AndroidManifest.xml diff --git a/.gitmodules b/.gitmodules index f72f0ab..46f629d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,12 @@ [submodule "libaums"] path = libaums url = https://github.com/Depau/libaums.git +[submodule "dmg2img"] + path = dmg2img/src/c/dmg2img + url = https://github.com/Depau/dmg2img-cmake.git +[submodule "app/src/c/bzip2"] + path = dmg2img/src/c/bzip2 + url = https://github.com/LuaDist/bzip2.git +[submodule "app/src/c/libressl"] + path = dmg2img/src/c/libressl + url = https://github.com/libressl-portable/portable.git diff --git a/app/build.gradle b/app/build.gradle index 2581221..6ebe23b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,6 +32,7 @@ dependencies { implementation 'com.android.support:recyclerview-v7:28.0.0-rc01' // implementation 'com.github.mjdev:libaums:0.5.5' implementation project(':libaums') + implementation project(':dmg2img') testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' diff --git a/dmg2img/CMakeLists.txt b/dmg2img/CMakeLists.txt new file mode 100644 index 0000000..34d6ef0 --- /dev/null +++ b/dmg2img/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.4) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/main/assets/bin/${ANDROID_ABI}") + +execute_process( + COMMAND truncate -s 0 crypto/compat/getpagesize.c + WORKING_DIRECTORY src/c/libressl) + +execute_process( + COMMAND ./autogen.sh + WORKING_DIRECTORY src/c/libressl) + +include_directories(src/c/bzip2) +include_directories(src/c/libressl/include) + +add_subdirectory(src/c/bzip2) +add_subdirectory(src/c/libressl) +add_subdirectory(src/c/dmg2img) \ No newline at end of file diff --git a/dmg2img/build.gradle b/dmg2img/build.gradle new file mode 100644 index 0000000..8ece2fd --- /dev/null +++ b/dmg2img/build.gradle @@ -0,0 +1,22 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 28 + defaultConfig { + externalNativeBuild { + cmake { + targets "crypto", "bz2", "ssl", "tls", "dmg2img" + } + } + } + externalNativeBuild { + cmake { + path "CMakeLists.txt" + } + } + sourceSets { + main { + assets.srcDirs = ['src/main/assets'] + } + } +} \ No newline at end of file diff --git a/dmg2img/src/c/bzip2 b/dmg2img/src/c/bzip2 new file mode 160000 index 0000000..55ff707 --- /dev/null +++ b/dmg2img/src/c/bzip2 @@ -0,0 +1 @@ +Subproject commit 55ff70772d3bbe5e911d4ce970368cb630461c63 diff --git a/dmg2img/src/c/dmg2img b/dmg2img/src/c/dmg2img new file mode 160000 index 0000000..1d75292 --- /dev/null +++ b/dmg2img/src/c/dmg2img @@ -0,0 +1 @@ +Subproject commit 1d7529285a7bdeb4f1eb158d9305494d682e323d diff --git a/dmg2img/src/c/libressl b/dmg2img/src/c/libressl new file mode 160000 index 0000000..4dbf285 --- /dev/null +++ b/dmg2img/src/c/libressl @@ -0,0 +1 @@ +Subproject commit 4dbf285573d5254e5169be44e45c7685a336b6e8 diff --git a/dmg2img/src/main/AndroidManifest.xml b/dmg2img/src/main/AndroidManifest.xml new file mode 100644 index 0000000..dd279fd --- /dev/null +++ b/dmg2img/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 2547323..77a9903 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ -include ':app', ':libaums' +include ':app', ':libaums', ':dmg2img' project(':libaums').projectDir = new File('libaums/libaums') \ No newline at end of file