diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index d126899..2f4ae46 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -20,7 +20,7 @@ add_library(samba_client include_directories(src/main/cpp) set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -std=c++0x -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIE") + "${CMAKE_CXX_FLAGS} -std=c++0x -O2 -D_FORTIFY_SOURCE=2 -D__USE_FILE_OFFSET64=1 -fstack-protector-all -fPIE") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pie") # Searches for a specified prebuilt library and stores the path as a diff --git a/app/build.gradle b/app/build.gradle index 15e4f49..cfb62a5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 26 - buildToolsVersion "26.0.2" + compileSdkVersion 27 + buildToolsVersion '27.0.3' defaultConfig { applicationId "com.google.android.sambadocumentsprovider" minSdkVersion 23 - targetSdkVersion 26 + targetSdkVersion 27 versionCode 102 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -49,11 +49,11 @@ android { } dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + implementation fileTree(include: ['*.jar'], dir: 'libs') + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) - compile 'com.android.support:appcompat-v7:25.4.0' - compile 'com.android.support:design:25.4.0' - testCompile 'junit:junit:4.12' + implementation 'com.android.support:appcompat-v7:27.1.1' + implementation 'com.android.support:design:27.1.1' + testImplementation 'junit:junit:4.12' } diff --git a/app/src/main/cpp/jni_helper/JniHelper.cc b/app/src/main/cpp/jni_helper/JniHelper.cc index 5c7a5cc..00a95e7 100644 --- a/app/src/main/cpp/jni_helper/JniHelper.cc +++ b/app/src/main/cpp/jni_helper/JniHelper.cc @@ -26,6 +26,7 @@ #include "credential_cache/CredentialCache.h" #include +#include #define CLASS_PREFIX "com/google/android/sambadocumentsprovider" diff --git a/app/src/main/cpp/samba_client/SambaClient.cc b/app/src/main/cpp/samba_client/SambaClient.cc index f548e2b..0598f89 100644 --- a/app/src/main/cpp/samba_client/SambaClient.cc +++ b/app/src/main/cpp/samba_client/SambaClient.cc @@ -21,6 +21,8 @@ #include #include +#include +#include #define TAG "NativeSambaClient" diff --git a/build.gradle b/build.gradle index b63c96e..fb1ceb9 100644 --- a/build.gradle +++ b/build.gradle @@ -3,9 +3,10 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' + classpath 'com.android.tools.build:gradle:3.1.1' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 11c5e72..7467eb0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Apr 17 15:35:09 PDT 2017 +#Fri Apr 06 21:08:46 CEST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip diff --git a/sambapatch.diff b/sambapatch.diff index 5e86413..88274a3 100644 --- a/sambapatch.diff +++ b/sambapatch.diff @@ -219,7 +219,7 @@ index 0000000..7d009da +# Create standalone tool chain +rm -rf $TOOLCHAIN +echo "Creating standalone toolchain..." -+$NDK/build/tools/make_standalone_toolchain.py --arch $PLATFORM_ARCH --api $ANDROID_VER --install-dir $TOOLCHAIN --unified-headers ++$NDK/build/tools/make_standalone_toolchain.py --arch $PLATFORM_ARCH --api $ANDROID_VER --install-dir $TOOLCHAIN + +# Configure Samba build +echo "Configuring Samba..." @@ -363,7 +363,7 @@ index 0000000..55a5f1e +} + +static void set_addr(struct ifaddrs_container *ifa, int family, const void *data, size_t byteCount) { -+ if (ifa->ifa.ifa_addr = NULL) { ++ if (ifa->ifa.ifa_addr == NULL) { + // Assume this is IFA_LOCAL, if not set_local_addr will fix it. + ifa->ifa.ifa_addr = copy_addr(family, data, byteCount, &ifa->addr, ifa->idx); + } else {