Rearrange opening of output and input files for error handling

If the file could not be opened, the process would log an error
to the log file but the GUI would report success. Rearrange the
process so that the GUI shows an error.

Change-Id: I96af0b934c8f6f463d56656647b16accd1d40654
Only split archives when split_archives is set

In some cases, statfs used on partitions like /system does not
report a size that would trigger a split archive, but using stat
on the individual files shows a larger size that statfs that
would trigger a split. This patch prevents us from trying to split
an archive unless we explicitly decided to split in advance.

Change-Id: I67f5cd343f12333e1189100cf0ec1c20c15b7cc2
Fix touch on Sprint HTC One m8

Change-Id: Ia9fba3be16a33b3cb0c4a3458398a2e60ba7f001
Add find file class to search for files

Scan a folder for a file based on file name. First scan the files
in the current path, then search real directories and finally
search symlinks in that order. Goal is to locate important sysfs
files for things like brightness, battery capacity, lun files, etc

This implementation just scans for the brightness file for the LCD

Change-Id: I8ed3e74a2e2851d58b443718b6e92b50a5491f08
Force zip verification in OEM builds

Change-Id: Ie894b5f5cda64f83b1bb58bb977024230b0337f2
Improve handling of shell symlink in recovery ramdisk

Change-Id: I06351f8ecdfe5b119bbae0d6800258adef844c66
Allow device files to specify a custom theme

Change-Id: I360f93e70c6a48eed502a5aacd6d8d654ca7b570
Enable rk30xx hack

Fix problem with erase/restore mtd partitions on Rockchip SoC

Change-Id: I3320f711446441cf79e38e9ffb5dfdb6b1717a55
Simplify twrpTar skip dir checks, DU code cleanup

* Remove unused parent variable from twruDU constructor

* Replace manual checks for /data/media with DU's check_skip_dirs()
  function

* Remove check_skip_dirs(A,B) function which duplicates the
  functionality of check_skip_dirs(A)

* Remove redundant trailing slash removal from
  check_absolute_skip_dirs(); this function is only accessed through
  check_skip_dirs()

Change-Id: Icfe8d71de36e33db6749fc5896dd3eafbcf7c9a4
Support .md5sum extension for package verification

Change-Id: Idb6df99251726e5415b415ea6ae55337b96b2dbb
More MD5 verification error handling

Distinguish between skipped md5 verification cases:
 - .md5/.md5sum file not found
 - .md5/.md5sum file unreadable

Change-Id: I912e3d9ebe64e78bed76eab8aa468d619b45972f
Add HTC charging LED support

Original implementation by Tom Hite, only slightly modified by Matt
Mower.

Change-Id: Ibc73bf04f122f5de1702f8beeccc468a9a1a2e95