Skip to content

Commit a2a804b

Browse files
committed
fix tmpfile
1 parent b928ba2 commit a2a804b

5 files changed

Lines changed: 9 additions & 3 deletions

File tree

app/conanfile.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[requires]
2-
odrcore/5.0.2
2+
odrcore/5.0.3
33

44
[generators]
55
CMakeToolchain
@@ -9,3 +9,4 @@ CMakeDeps
99
odrcore/*:shared=True
1010
odrcore/*:with_pdf2htmlEX=True
1111
odrcore/*:with_wvWare=False
12+
odrcore/*:with_tmpfile_hack=True

app/conanprofile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ compiler.cppstd=20
99
compiler.libcxx=c++_shared
1010
&:build_type=RelWithDebInfo
1111
odrcore/*:build_type=RelWithDebInfo
12-
build_type=Release
12+
build_type=RelWithDebInfo
1313

1414
[conf]
1515
tools.android:ndk_path=@NDK_PATH@

app/src/main/cpp/CoreWrapper.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,15 @@ Java_at_tomtasche_reader_background_CoreWrapper_setGlobalParams(JNIEnv *env, jcl
8888
std::string fontconfigDataPath = getStringField(env, paramsClass, params, "fontconfigDataPath");
8989
std::string popplerDataPath = getStringField(env, paramsClass, params, "popplerDataPath");
9090
std::string pdf2htmlexDataPath = getStringField(env, paramsClass, params, "pdf2htmlexDataPath");
91+
std::string customTmpfilePath = getStringField(env, paramsClass, params, "customTmpfilePath");
9192

9293
odr::GlobalParams::set_odr_core_data_path(odrCoreDataPath);
9394
odr::GlobalParams::set_fontconfig_data_path(fontconfigDataPath);
9495
odr::GlobalParams::set_poppler_data_path(popplerDataPath);
9596
odr::GlobalParams::set_pdf2htmlex_data_path(pdf2htmlexDataPath);
97+
odr::GlobalParams::set_custom_tmpfile_path(customTmpfilePath);
98+
99+
setenv("TMPDIR", customTmpfilePath.c_str(), 1);
96100
}
97101

98102
JNIEXPORT jobject JNICALL

app/src/main/java/at/tomtasche/reader/background/CoreLoader.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import android.webkit.MimeTypeMap;
88

99
import java.io.File;
10-
import java.util.Objects;
1110

1211
import at.tomtasche.reader.nonfree.AnalyticsManager;
1312
import at.tomtasche.reader.nonfree.ConfigManager;

app/src/main/java/at/tomtasche/reader/background/CoreWrapper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public static class GlobalParams {
1818
public String fontconfigDataPath;
1919
public String popplerDataPath;
2020
public String pdf2htmlexDataPath;
21+
public String customTmpfilePath;
2122
}
2223

2324
public static native void setGlobalParams(GlobalParams params);
@@ -41,6 +42,7 @@ public static void initialize(Context context) {
4142
globalParams.fontconfigDataPath = fontconfigDataDirectory.getAbsolutePath();
4243
globalParams.popplerDataPath = popplerDataDirectory.getAbsolutePath();
4344
globalParams.pdf2htmlexDataPath = pdf2htmlexDataDirectory.getAbsolutePath();
45+
globalParams.customTmpfilePath = context.getCacheDir().getAbsolutePath();
4446
CoreWrapper.setGlobalParams(globalParams);
4547
}
4648

0 commit comments

Comments
 (0)