Commit Graph

64 Commits

Author SHA1 Message Date
that
fcdb76dd05 twrp-functions: remove unused functions
Change-Id: I3d072be9ef28f21ade466bc4c42caca8848f7c2a
2014-12-29 17:11:59 +01:00
Ethan Yonker
e3e8829e40 Update SuperSU to 2.40
The SuperSU install process is getting rather complicated, so we
will modify the install script slightly and use it to install
all the things and stop trying to check to see if root permissions
have been lost like we used to do.

Change-Id: Ibdb64c909d2bd16e12bb35b4f31f572cc29add47
2014-12-18 21:17:26 +01:00
Ethan Yonker
4b94cfd391 Attempt to set the proper uid/gid/contexts on new files and dirs
Files and folders that we create during backups, copy log, or MTP
operations often do not have the proper uid/gid/contexts assigned.
We will attempt to read the proper contexts from the settings
storage path and assign those same contexts to any files or dirs
that we create.

Change-Id: I769f9479854122b49b499de2175e6e2d026f8afd
2014-12-12 09:20:42 -06:00
Ethan Yonker
75bf041a8a Make the android-5.0 branch compile in 4.4 to 4.1
Migrate previous minzip to minzipold replacing the existing
minzipold. This will break compatibility with trees that do not
support selinux (ICS and older). Migrate former verifier files to
verifierold.

Add fuse.h to recovery source because older trees do not have it.

Add LOCAL_MODULE_TAGS where needed for 4.1 tree.

Change-Id: Iade57cb2b0115af7fce9f56aa98636b1744a1ef4
2014-12-02 10:34:15 -06:00
Ethan Yonker
d7f2092ea0 Fix up tw_reboot function
Change-Id: I53d329e493f4bcb3fe9ed177e7b2dede30ccf490
2014-11-07 10:33:08 -06:00
that
d43bf2dc77 fix some compiler warnings
Change-Id: I23c490e6228b0fcf656c76ac314c69508ba2329d
2014-11-04 15:33:04 +01:00
Jenkins
1710bf2547 display cpu temperature in twrp
use TW_NO_CPU_TEMP := true to disable display
use TW_CPU_CUSTOM_PATH := path to set custom path

Change-Id: Id260ecbb4ec36a78442387329944f67003d0f6a0
2014-10-14 15:08:11 +02:00
Tom Hite
5a9267283c performance profile support
Many device trees support the recovery.perf.mode property to
set various core frequencies and online/offline mode. TWRP is
highly threaded, and support for multiple cores on many operations
dramatically recudes the time, e.g., backups, zip flashes, etc.

p2: removed user notifications

Change-Id: I957b8ca40b241c0af0471327eeb329cce1816017
2014-10-08 19:35:32 +02:00
bigbiff bigbiff
c7eee6fef0 add mtp responder to TWRP.
Big thanks to Dees_Troy for helping with the implementation.

Change-Id: I6c9c522b9c9de5dc139e2ecb0141008182ba07f0
2014-09-02 21:44:49 -04:00
xNUTx
e85f02dd91 Support reading since_epoch and secondary brightness files
TWFunc::Fixup_Time_On_Boot: Will now try to read
/sys/class/rtc/rtc0/since_epoch to correct time, if that fails
it will try to use the ats files to correct time.

TWFunc::Set_Brightness: One single function to set brightness
from both the automated functions and the gui actions. It is
able to set a second brightness path if present, it will set
them both the same value. Many Sony devices have 2 brightness
files in the sysfs that must be set to properly set the
brightness.

Change-Id: I7ca582109085dfbcb46b8de73ad031e4b7903fca
2014-08-10 08:57:14 -05:00
Vojtech Bocek
03fd6c56fe Implement "take a screenshot" feature
* Like in android - press power+volume down, screenshots are saved
  in /sdcard/Pictures/Screenshots (if /sdcard is mounted) or /tmp

Change-Id: Iaefa15b11a1d5fdfac57d77388db1621f378a8d4
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-07-09 17:35:36 +02:00
Vojtech Bocek
67351dca66 Check the crash counter instead of date in TWFunc::Fixup_Time_On_Boot()
* Some devices (Sony) have RTC counting up from year 2009,

Change-Id: I2cf1928e1b05c7e8b184963f8130582e0319ddc4
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-07-09 15:57:59 +02:00
Ethan Yonker
1b7a31bd65 Track backup and restore progress
Track backup and restore progress based on the sizes of the files
as they are being added to the tar backup file. Update the
progress bar based on the sizes of the files.

Change-Id: Idf649efa1db3e91830b4b2add86203a3f30042ff
2014-07-09 08:52:18 -05:00
Matt Mower
fb1c4ffaaf Whitespace and minor code cleanup
This is by no means comprehensive, but is quite a bit better already.

Change-Id: Ibc8654a5dfb0eec39cbd0b64bdb52bb4fbfe2f7e
2014-06-04 09:13:37 -05:00
Vojtech Bocek
0b7fe504dc Add support for actions triggered by key combination
Change-Id: I9dfa7de40229f00412d63fc9c1eb3a809a6eb2e6
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-04-16 17:51:17 +02:00
Vojtech Bocek
05f87d6cca Fix skipping of relative paths and lost+found in twrpDU
Change-Id: Ib79029fd6237502338b041a6bc2f9e539536d6ad
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-03-13 14:55:12 +01:00
Dees Troy
3e254b9c89 Change qcom time error messages to info
Change-Id: I5a22b2df87920333974d8d18fb29f4ff1627a405
2014-03-06 20:24:54 +00:00
Ethan Yonker
92d48e0696 Check auto generated backup names for invalid characters
Change name to date/time only if the auto generated backup name
contains any invalid characters.

Change-Id: I73e9e546373088ee7852fa31015060ce95a1d020
2014-02-26 12:06:08 -06:00
bigbiff bigbiff
731df79eb7 fix slash between directories
add fixing contexts of Android directory for apps that store stuff here
fix data/data contexts to be recursive

Change-Id: I1122559c83845c3af0a351a4034cd7ad6da83fa5
2014-02-22 20:12:02 -05:00
Ethan Yonker
af2897c4c2 ifdef some functions that depend on other TWRP parts
End goal is to create a twrpTar binary that can run from the
command line.

Change-Id: I14f07a425b7755bd09dbce95a5918da1430964fc
2014-02-12 15:08:31 +00:00
Ethan Yonker
0385f51857 Update SuperSU
Change-Id: I0f450357595e7f5f56a7c120b899101faf7f6360
2014-02-07 21:54:33 -06:00
Ethan Yonker
b555789d44 Separate out function for reading /system/build.prop values
Change-Id: I9e398aa3f4f5be0728435ffdab333d4090cdab22
2014-02-07 21:43:20 -06:00
Vojtech Bocek
e5ffcd1af2 Add option to print render time of each frame to log file
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: Id158a6375fbadf4cdf0a8c7d143759e602419e7f
2014-02-06 21:18:08 +01:00
Vojtech Bocek
d0e38bc2f4 Load RTC offset on Qualcomm Krait chips, fixes the broken time & date
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: I04ad07f3e6be961003e063be8c648e191e2f9431
2014-02-04 18:27:05 +01:00
bigbiff bigbiff
34684ff313 Create a TWRP Disk Usage Class to retain state about a directory and whether we should skip it in other classes like twrpTar.
Moved Get_Folder_Size to this new class.

Change-Id: If0a0220f900eb109581f2eeaf7b76e3f7d6886f1
2013-12-19 18:02:44 +00:00
Dees Troy
3be70a897e Update licenses to all match 2013-10-22 14:25:12 +00:00
Dees Troy
a829d5deb2 Remove trailing spaces on auto generated backup names
Trailing spaces sometimes cause folder creation depending on what
file system is in use (e.g. vfat).
2013-10-17 00:26:34 +00:00
Dees Troy
9d7fdf5274 Improvements to Update_Log_File
Change-Id: I5596759b0cb39e4448b6be382f9224feed70a5ea
2013-09-19 20:52:45 +00:00
Vojtech Bocek
a2e7016ee1 Never generate empty backup name
* Backup would then go to /sdcard/TWRP/*serial_num*/
  (without any subfolder) and restore would not be able to find it.

Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2013-09-17 17:06:09 +02:00
Vojtech Bocek
05534209f1 Add TWFunc::Exec_Cmd() with no 'result' agrument
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: Id8acff1ac9b3c7e4b562c80562a8ff42a1d132b9
2013-09-12 15:36:40 +00:00
Dees Troy
b21cc64ca8 Pull ROM info from build.prop for backup names
Change-Id: I7847fca22b5d4f0a35da41625b15bd677a1e9768
2013-09-12 09:11:13 -05:00
Vojtech Bocek
37aeb8d678 Really fix TWFunc::tw_chmod() for 3-character mode string
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: I8f03d46235e1c71e8ee510309c9418cde802f50b
2013-08-29 21:35:02 -05:00
Dees_Troy
a7939bbdc8 Update SuperSU for 4.3 SELinux, 2.6.1.0
Change-Id: Ib7f882db8a8c61d1156c03468208205124132b6c
2013-08-30 01:53:54 +00:00
bigbiff bigbiff
616afed985 ignore lost+found in all the places 2013-08-28 15:06:18 +00:00
Vojtech Bocek
fafb0c541b Unify indentation and little clean-up in TWRP files
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2013-08-24 07:56:48 -05:00
Vojtech Bocek
00b260587c Fix TWFunc::tw_chmod() for 3-character mode string 2013-08-24 07:52:45 -05:00
Dees_Troy
29a0635b93 Revert "Rewrite TWFunc::Exec_Cmd() to use pipe() instead of popen()"
This reverts commit c5754cf935.
popen already uses fork and pipe and __popen works on more devices.
2013-08-24 07:42:48 -05:00
Vojtech Bocek
c5754cf935 Rewrite TWFunc::Exec_Cmd() to use pipe() instead of popen()
* popen causes crashes on some devices
2013-07-03 13:28:00 -05:00
Dees_Troy
83bd483f3d Support encrypted backup files
Also includes features merged from:

Update twrpTar by kokotas

Revised function entryExists().
Added function to get archive's uncompressed size.
Added option to exclude item(s) from the archive.
Revised forks()

http://review.teamw.in/#/c/590/

Change-Id: I01fa2c81643161984eff2625247af75990684bd9
2013-06-22 16:16:55 -05:00
Dees_Troy
2673cec07a Move all AOSP code out of recovery binary
Improves license compatibility between GPL and Apache

Change-Id: I2b165aa575bb6213af6b07936f99610c113443f0
2013-04-04 18:57:34 +00:00
bigbiff bigbiff
cdcfee48b9 use md5.c for computation of md5sums
create a framework for computing digests and reading digests in TWRP
add space for backwards compatibility with bb md5sum
Change-Id: Ia18e3f430eed5eba22e5052d39b9b8d88ecd4536
2013-03-07 08:07:34 -05:00
jt1134
113ee73445 fixes for fakeflash zips
For some reason fakeflash doesn't like to have superuser/su
in /res, move it to its own subdir in /supersu. This allows
a fakeflash zip built with 'make recoveryzip' to work correctly.

Change-Id: I32e2e0f6dba55281d5c917e931c3ef0034964bcb
2013-02-27 18:50:44 +00:00
Dees_Troy
a4438784eb Fix compiling on CM7 2013-02-22 18:49:47 +00:00
Dees_Troy
6ef6635ad3 Check for root and root perms and offer to install/fix
Also fix sort order for file selector by date and file sizes

Change-Id: Idff9fe4232c19d4ed1082e78fabe6f921aa0a114
2013-02-21 18:23:43 +00:00
bigbiff bigbiff
8a68c31ffc This adds a 60 second screen timeout for TWRP. Might consider making this configurable in the future.
Will also set overlay to lockscreen so we don't have inadvetent screen selections.
Touching the screen will bring the display back up.
add back check script for poweroff
move diff time function to twrp-functions.cpp
make sure we chmod after copy_file
add read_file and write_file functions to twrp-functions.cpp
make single thread
try to force update screen
add forceRender
drop caches after tar processing

Change-Id: I3c5c509dd39dbb05451bbfe5d8b56d53c90d8d1b
2013-02-13 13:16:03 -06:00
Dees_Troy
e34c133ec6 Add write buffer for tar writes
update fuse to 2.9.2

catch return from unlink so that we don't print error messages when things work
Change-Id: I1115039a0fa5d9d73f78ef1abd79755d7ffd9d96
2013-02-07 08:21:17 -05:00
Vojtech Bocek
2e97ec58b9 Use only std::string in TWFunc::Get_Folder_Size
* Fixes crash which could occur with too deep path because
  of too much memory allocated on stack
2013-02-02 13:22:42 +01:00
Dees_Troy
3f5c4e8dfe Fix fail over to vfat from exfat
Fix issues with MD5 checking using chdir and leaving the working
dir in a subfolder that prevented unmounting sometimes.

Change-Id: I01a563d722f474297ed3f7a30064c3a61748ade3
2013-02-01 16:56:34 +00:00
Dees_Troy
b05ddeedd3 exFAT improvements, fixes
Move Exec_Cmd to libcrecovery __popen
Provide opt out build flag for exFAT
Default fstype to exfat on external storage if exfat support is
present and fstype is vfat or auto
Fix invalid unmount errors
Improve handling of unencrypted sdcards on Samsung devices
2013-01-28 20:45:11 +00:00
Dees_Troy
3ee47bc2ab file manager updates for exFAT
Change-Id: I06fa6120a975cbc3d4eef9bc2ca034ec716740ee
2013-01-28 15:20:03 +00:00