Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

fix seek on 32bit platforms #54

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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'
}
1 change: 1 addition & 0 deletions app/src/main/cpp/jni_helper/JniHelper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "credential_cache/CredentialCache.h"

#include <stdlib.h>
#include <errno.h>

#define CLASS_PREFIX "com/google/android/sambadocumentsprovider"

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/cpp/samba_client/SambaClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include <stdlib.h>
#include <string>
#include <string.h>
#include <errno.h>

#define TAG "NativeSambaClient"

Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions sambapatch.diff
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down Expand Up @@ -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 {
Expand Down