Fredrik Fornwall
8 years ago
7 changed files with 185 additions and 15 deletions
@ -1,7 +1,8 @@ |
|||
TERMUX_PKG_VERSION=5.3.2 |
|||
TERMUX_PKG_HOMEPAGE=http://www.rarlab.com/ |
|||
TERMUX_PKG_DESCRIPTION="Tool for extracting files from .rar archives" |
|||
TERMUX_PKG_VERSION=5.4.5 |
|||
TERMUX_PKG_SRCURL=http://www.rarlab.com/rar/unrarsrc-${TERMUX_PKG_VERSION}.tar.gz |
|||
TERMUX_PKG_SHA256=e470c584332422893fb52e049f2cbd99e24dc6c6da971008b4e2ae4284f8796c |
|||
TERMUX_PKG_DEPENDS="libandroid-support" |
|||
TERMUX_PKG_FOLDERNAME=unrar |
|||
TERMUX_PKG_BUILD_IN_SRC=yes |
|||
|
@ -0,0 +1,75 @@ |
|||
diff -u -r ../unrar/cmddata.cpp ./cmddata.cpp
|
|||
--- ../unrar/cmddata.cpp 2016-08-14 21:17:47.000000000 +0200
|
|||
+++ ./cmddata.cpp 2017-01-31 12:55:33.898965827 +0100
|
|||
@@ -43,7 +43,7 @@
|
|||
} |
|||
|
|||
|
|||
-#if !defined(SFX_MODULE) && !defined(_ANDROID)
|
|||
+#if !defined(SFX_MODULE)
|
|||
void CommandData::ParseCommandLine(bool Preprocess,int argc, char *argv[]) |
|||
{ |
|||
*Command=0; |
|||
@@ -85,7 +85,7 @@
|
|||
#endif |
|||
|
|||
|
|||
-#if !defined(SFX_MODULE) && !defined(_ANDROID)
|
|||
+#if !defined(SFX_MODULE)
|
|||
void CommandData::ParseArg(wchar *Arg) |
|||
{ |
|||
if (IsSwitch(*Arg) && !NoMoreSwitches) |
|||
@@ -177,7 +177,7 @@
|
|||
} |
|||
|
|||
|
|||
-#if !defined(SFX_MODULE) && !defined(_ANDROID)
|
|||
+#if !defined(SFX_MODULE)
|
|||
void CommandData::ParseEnvVar() |
|||
{ |
|||
char *EnvStr=getenv("RAR"); |
|||
@@ -192,7 +192,7 @@
|
|||
|
|||
|
|||
|
|||
-#if !defined(SFX_MODULE) && !defined(_ANDROID)
|
|||
+#if !defined(SFX_MODULE)
|
|||
// Preprocess those parameters, which must be processed before the rest of |
|||
// command line. Return 'false' to stop further processing. |
|||
void CommandData::PreprocessArg(const wchar *Arg) |
|||
@@ -230,7 +230,7 @@
|
|||
#endif |
|||
|
|||
|
|||
-#if !defined(GUI) && !defined(SFX_MODULE) && !defined(_ANDROID)
|
|||
+#if !defined(GUI) && !defined(SFX_MODULE)
|
|||
void CommandData::ReadConfig() |
|||
{ |
|||
StringList List; |
|||
@@ -265,7 +265,7 @@
|
|||
#endif |
|||
|
|||
|
|||
-#if !defined(SFX_MODULE) && !defined(_ANDROID)
|
|||
+#if !defined(SFX_MODULE)
|
|||
void CommandData::ProcessSwitchesString(const wchar *Str) |
|||
{ |
|||
wchar *Par; |
|||
@@ -279,7 +279,7 @@
|
|||
#endif |
|||
|
|||
|
|||
-#if !defined(SFX_MODULE) && !defined(_ANDROID)
|
|||
+#if !defined(SFX_MODULE)
|
|||
void CommandData::ProcessSwitch(const wchar *Switch) |
|||
{ |
|||
|
|||
@@ -909,7 +909,7 @@
|
|||
#endif |
|||
|
|||
|
|||
-#if !defined(SFX_MODULE) && !defined(_ANDROID)
|
|||
+#if !defined(SFX_MODULE)
|
|||
void CommandData::BadSwitch(const wchar *Switch) |
|||
{ |
|||
mprintf(St(MUnknownOption),Switch); |
@ -0,0 +1,29 @@ |
|||
diff -u -r ../unrar/file.cpp ./file.cpp
|
|||
--- ../unrar/file.cpp 2016-08-14 21:17:47.000000000 +0200
|
|||
+++ ./file.cpp 2017-01-31 12:53:12.968683760 +0100
|
|||
@@ -121,12 +121,6 @@
|
|||
hNewFile=fdopen(handle,UpdateMode ? UPDATEBINARY:READBINARY); |
|||
#endif |
|||
} |
|||
-#ifdef _ANDROID
|
|||
- // If we open an existing file in r&w mode and external card is read-only
|
|||
- // for usual file API.
|
|||
- if (hNewFile==FILE_BAD_HANDLE && UpdateMode && errno!=ENOENT)
|
|||
- hNewFile=JniOpenFile(Name);
|
|||
-#endif
|
|||
if (hNewFile==FILE_BAD_HANDLE && errno==ENOENT) |
|||
ErrorType=FILE_NOTFOUND; |
|||
#endif |
|||
@@ -196,12 +190,6 @@
|
|||
WideToChar(Name,NameA,ASIZE(NameA)); |
|||
#ifdef FILE_USE_OPEN |
|||
hFile=open(NameA,(O_CREAT|O_TRUNC) | (WriteMode ? O_WRONLY : O_RDWR)); |
|||
-#ifdef _ANDROID
|
|||
- if (hFile==FILE_BAD_HANDLE)
|
|||
- hFile=JniCreateFile(Name); // If external card is read-only for usual file API.
|
|||
- if (hFile!=FILE_BAD_HANDLE)
|
|||
- JniFileNotify(Name,false);
|
|||
-#endif
|
|||
#else |
|||
hFile=fopen(NameA,WriteMode ? WRITEBINARY:CREATEBINARY); |
|||
#endif |
@ -0,0 +1,45 @@ |
|||
diff -u -r ../unrar/filefn.cpp ./filefn.cpp
|
|||
--- ../unrar/filefn.cpp 2016-08-14 21:17:47.000000000 +0200
|
|||
+++ ./filefn.cpp 2017-01-31 12:52:24.009280586 +0100
|
|||
@@ -29,12 +29,6 @@
|
|||
WideToChar(Name,NameA,ASIZE(NameA)); |
|||
mode_t uattr=SetAttr ? (mode_t)Attr:0777; |
|||
int ErrCode=mkdir(NameA,uattr); |
|||
-#ifdef _ANDROID
|
|||
- if (ErrCode==-1 && errno!=ENOENT)
|
|||
- ErrCode=JniMkdir(Name) ? 0 : -1; // If external card is read-only for usual file API.
|
|||
- if (ErrCode!=-1)
|
|||
- JniFileNotify(Name,false);
|
|||
-#endif
|
|||
if (ErrCode==-1) |
|||
return errno==ENOENT ? MKDIR_BADPATH:MKDIR_ERROR; |
|||
return MKDIR_SUCCESS; |
|||
@@ -426,15 +420,6 @@
|
|||
WideToChar(SrcName,SrcNameA,ASIZE(SrcNameA)); |
|||
WideToChar(DestName,DestNameA,ASIZE(DestNameA)); |
|||
bool Success=rename(SrcNameA,DestNameA)==0; |
|||
-#ifdef _ANDROID
|
|||
- if (!Success)
|
|||
- Success=JniRename(SrcName,DestName); // If external card is read-only for usual file API.
|
|||
- if (Success)
|
|||
- {
|
|||
- JniFileNotify(SrcName,true);
|
|||
- JniFileNotify(DestName,false);
|
|||
- }
|
|||
-#endif
|
|||
return Success; |
|||
#endif |
|||
} |
|||
@@ -455,12 +440,6 @@
|
|||
char NameA[NM]; |
|||
WideToChar(Name,NameA,ASIZE(NameA)); |
|||
bool Success=remove(NameA)==0; |
|||
-#ifdef _ANDROID
|
|||
- if (!Success)
|
|||
- Success=JniDelete(Name);
|
|||
- if (Success)
|
|||
- JniFileNotify(Name,true);
|
|||
-#endif
|
|||
return Success; |
|||
#endif |
|||
} |
@ -0,0 +1,12 @@ |
|||
diff -u -r ../unrar/rar.hpp ./rar.hpp
|
|||
--- ../unrar/rar.hpp 2016-08-14 21:17:47.000000000 +0200
|
|||
+++ ./rar.hpp 2017-01-31 12:49:39.451286637 +0100
|
|||
@@ -87,8 +87,5 @@
|
|||
|
|||
|
|||
|
|||
-#ifdef _ANDROID
|
|||
-#include "GUI/rarjni.hpp"
|
|||
-#endif
|
|||
|
|||
#endif |
@ -0,0 +1,14 @@ |
|||
diff -u -r ../unrar/strfn.cpp ./strfn.cpp
|
|||
--- ../unrar/strfn.cpp 2016-08-14 21:17:47.000000000 +0200
|
|||
+++ ./strfn.cpp 2017-01-31 12:50:41.922525083 +0100
|
|||
@@ -21,10 +21,6 @@
|
|||
DestSize=SrcLength; |
|||
OemToCharBuffA(Src,Dest,(DWORD)DestSize); |
|||
Dest[DestSize-1]=0; |
|||
-#elif defined(_ANDROID)
|
|||
- wchar DestW[NM];
|
|||
- JniCharToWide(Src,DestW,ASIZE(DestW),true);
|
|||
- WideToChar(DestW,Dest,DestSize);
|
|||
#else |
|||
if (Dest!=Src) |
|||
strncpyz(Dest,Src,DestSize); |
Loading…
Reference in new issue