diff --git a/libresource/ResourceTypes.cpp b/libresource/ResourceTypes.cpp index 8474fb242b..44b69bde3e 100644 --- a/libresource/ResourceTypes.cpp +++ b/libresource/ResourceTypes.cpp @@ -41,6 +41,9 @@ #include "utils/String16.h" #include "utils/String8.h" +#ifdef __TERMUX__ +#undef __ANDROID__ +#endif #ifdef __ANDROID__ #include #endif diff --git a/libresource/utils/TypeHelpers.h b/libresource/utils/TypeHelpers.h index 1554f52ee1..62bed865ac 100644 --- a/libresource/utils/TypeHelpers.h +++ b/libresource/utils/TypeHelpers.h @@ -195,7 +195,7 @@ template typename std::enable_if::value>::type inline move_forward_type(TYPE* d, const TYPE* s, size_t n = 1) { - memmove(d, s, n*sizeof(TYPE)); + memmove((void *)d, (void *)s, n*sizeof(TYPE)); } template @@ -222,7 +222,7 @@ template typename std::enable_if::value>::type inline move_backward_type(TYPE* d, const TYPE* s, size_t n = 1) { - memmove(d, s, n*sizeof(TYPE)); + memmove((void *)d, (void *)s, n*sizeof(TYPE)); } template diff --git a/selfextract.sh b/selfextract.sh index 4b681bcacd..fc0b600be9 100644 --- a/selfextract.sh +++ b/selfextract.sh @@ -4,7 +4,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -export TMPDIR=`mktemp -d /tmp/redex.XXXXXX` +TERMUX_TMP="" +if pwd | grep -q "termux"; then +TERMUX_TMP="/data/data/com.termux/cache" +mkdir -p $TERMUX_TMP/tmp +fi + +export TMPDIR=`mktemp -d "$TERMUX_TMP/tmp/redex.XXXXXX"` ARCHIVE=`awk '/^__ARCHIVE_BELOW__/ { print NR + 1; exit 0 }' $0` tail -n+$ARCHIVE $0 | tar xz -C $TMPDIR diff --git a/tools/redexdump/RedexDump.cpp b/tools/redexdump/RedexDump.cpp index 55cfbbc2ba..cdf4fb6cd8 100644 --- a/tools/redexdump/RedexDump.cpp +++ b/tools/redexdump/RedexDump.cpp @@ -68,7 +68,7 @@ int main(int argc, char* argv[]) { uint32_t ddebug_offset = 0; int no_headers = 0; - char c; + int c; static const struct option options[] = { {"all", no_argument, nullptr, 'a'}, {"string", no_argument, nullptr, 's'},