summaryrefslogtreecommitdiffstats
path: root/twrpTarMain
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2016-11-30 19:29:37 +0100
committerEthan Yonker <dees_troy@teamw.in>2016-11-30 20:19:08 +0100
commit3fdcda46629e8e7fc19e89c51350b1e6f151e05e (patch)
treec392e0fdcf8e61e5abfb88099fd8d9b1f1ff8a70 /twrpTarMain
parentFix adb shell in 7.0 tree (diff)
downloadandroid_bootable_recovery-3fdcda46629e8e7fc19e89c51350b1e6f151e05e.tar
android_bootable_recovery-3fdcda46629e8e7fc19e89c51350b1e6f151e05e.tar.gz
android_bootable_recovery-3fdcda46629e8e7fc19e89c51350b1e6f151e05e.tar.bz2
android_bootable_recovery-3fdcda46629e8e7fc19e89c51350b1e6f151e05e.tar.lz
android_bootable_recovery-3fdcda46629e8e7fc19e89c51350b1e6f151e05e.tar.xz
android_bootable_recovery-3fdcda46629e8e7fc19e89c51350b1e6f151e05e.tar.zst
android_bootable_recovery-3fdcda46629e8e7fc19e89c51350b1e6f151e05e.zip
Diffstat (limited to 'twrpTarMain')
-rw-r--r--twrpTarMain/Android.mk8
-rw-r--r--twrpTarMain/twrpTarMain.cpp13
2 files changed, 11 insertions, 10 deletions
diff --git a/twrpTarMain/Android.mk b/twrpTarMain/Android.mk
index 71b9bcd00..f948708d9 100644
--- a/twrpTarMain/Android.mk
+++ b/twrpTarMain/Android.mk
@@ -8,14 +8,14 @@ LOCAL_SRC_FILES:= \
../twrp-functions.cpp \
../twrpTar.cpp \
../tarWrite.c \
- ../twrpDU.cpp \
+ ../exclude.cpp \
../progresstracking.cpp \
../gui/twmsg.cpp
LOCAL_CFLAGS:= -g -c -W -DBUILD_TWRPTAR_MAIN
LOCAL_C_INCLUDES += bionic
-LOCAL_STATIC_LIBRARIES := libc libtar_static
+LOCAL_STATIC_LIBRARIES := libc libtar_static libz
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
LOCAL_C_INCLUDES += external/stlport/stlport bionic/libstdc++/include
LOCAL_STATIC_LIBRARIES += libstlport_static
@@ -52,13 +52,13 @@ LOCAL_SRC_FILES:= \
../twrp-functions.cpp \
../twrpTar.cpp \
../tarWrite.c \
- ../twrpDU.cpp \
+ ../exclude.cpp \
../progresstracking.cpp \
../gui/twmsg.cpp
LOCAL_CFLAGS:= -g -c -W -DBUILD_TWRPTAR_MAIN
LOCAL_C_INCLUDES += bionic
-LOCAL_SHARED_LIBRARIES := libc libtar
+LOCAL_SHARED_LIBRARIES := libc libtar libz
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
LOCAL_C_INCLUDES += external/stlport/stlport bionic/libstdc++/include
LOCAL_SHARED_LIBRARIES += libstlport_static
diff --git a/twrpTarMain/twrpTarMain.cpp b/twrpTarMain/twrpTarMain.cpp
index ff35f47ce..df40426e4 100644
--- a/twrpTarMain/twrpTarMain.cpp
+++ b/twrpTarMain/twrpTarMain.cpp
@@ -19,14 +19,12 @@
#include "../twrp-functions.hpp"
#include "../twrpTar.hpp"
-#include "../twrpDU.hpp"
+#include "../exclude.hpp"
#include "../progresstracking.hpp"
#include "../gui/gui.hpp"
#include "../gui/twmsg.h"
#include <string.h>
-twrpDU du;
-
void gui_msg(const char* text)
{
if (text) {
@@ -166,11 +164,14 @@ int main(int argc, char **argv) {
}
}
+ TWExclude exclude;
+ exclude.add_absolute_dir("/data/media");
tar.has_data_media = has_data_media;
tar.setdir(Directory);
tar.setfn(Tar_Filename);
- tar.setsize(du.Get_Folder_Size(Directory));
+ tar.setsize(exclude.Get_Folder_Size(Directory));
tar.use_compression = use_compression;
+ tar.backup_exclusions = &exclude;
#ifndef TW_EXCLUDE_ENCRYPTED_BACKUPS
if (userdata_encryption && !use_encryption) {
printf("userdata encryption set without encryption option\n");
@@ -186,14 +187,14 @@ int main(int argc, char **argv) {
}
#endif
if (action == 1) {
- if (tar.createTarFork(&progress, tar_fork_pid) != 0) {
+ if (tar.createTarFork(&tar_fork_pid) != 0) {
sync();
return -1;
}
sync();
printf("\n\ntar created successfully.\n");
} else if (action == 2) {
- if (tar.extractTarFork(&progress) != 0) {
+ if (tar.extractTarFork() != 0) {
sync();
return -1;
}