Commit Graph

3661 Commits

Author SHA1 Message Date
Matt Mower ff2c6b2d52 Update MTP debugging tags
Change-Id: I8cf8b32d5a98ac2470386cbaf70cfc87f44e94f6
2017-02-23 20:01:07 +01:00
Matt Mower a8e6d83155 Do not unconditionally remove MTP storage on unmount
* It is not necessary to Remove_MTP_Storage() for a partition if an
  MTP_Storage_ID has not been assigned.
* The hack to force-set tw_mtp_enabled=1 should no longer be necessary
  now that we're checking whether MTP really needs to be disabled for
  a volume before running Disable_MTP().

Change-Id: I1b7233eedd9da7c6be0c67fc60243f3837105173
2017-02-23 19:42:48 +01:00
Matt Mower 84830ce015 Only change USB mode to mtp when ready for MTP
Commit 'Do not toggle USB ID during MTP startup if not needed' changed
the default USB mode to 'mtp,adb'. Depending on the device, this can
result in an unfortunate side effect of crashing an ORS sideload
midway through the process (it's not clear to me whether the kernel or
the connected computer is responsible). Only put USB into mtp mode
when MTP storage is starting-up.

The hack to change the USB mode to adb when a user compiles TWRP
without MTP support is no longer necessary now that 'adb' is the
startup mode.

Change-Id: I8ed13d6ab8e85621533997b8c37ef7ebec0fcf85
2017-02-23 12:30:59 -06:00
D. Andrei Măceș 9ce12ec20d build: [FIXUP] Addendum for BusyBox get/setprop & API 24 vs 25
Change-Id: I9c909bc990210fc3ec2ed3edf0ac106248f613ba
2017-02-23 16:00:44 +01:00
MinSeong Kim 663ad8e9d0 Fix "ordered comparison between pointer and zero".
From Clang 4.x releases, DR583 and DR1512 will be addressed.
This patch, in advance, fixes the error(s).

Test: `mmma bootable/recovery`
Change-Id: I29dc85ae681307c322ab3a698c3f3bbad1c784ee
Signed-off-by: MinSeong Kim <minseong.kim@linaro.org>
2017-02-23 15:27:05 +01:00
SevenMaxs c7a2f934b5 Update Russian localization
Added new strings (Scripts language_helper.py and compare_xml.py were used).

Change-Id: Id6f220d17e748cd10ff8ff8b21c2e40d84be5ec9
2017-02-21 11:12:50 +03:00
nijel8 2dd66f4962 cryptfs: Fix encryption issue due to stack corruption.
Ioctl BLKGETSIZE expects pointer to unsigned long as argument.

On 64bit target using pointer to unsigned int can cause stack
corruption due to type mismatch.

props to https://github.com/aopp/android_system_vold/commit/f8b8787317fc94439b63bc891eeda83f7ae2f4f6

Change-Id: I1d76c65e29479c8f0cd44b6892069b21b8249b95
2017-02-19 21:34:12 +01:00
Ethan Yonker 91758440d3 Add a listxattr tool for listing xattrs
Change-Id: Ib80bab2b605ce77cd8fdc717d8bcfa8085516679
2017-02-16 21:54:51 -06:00
Ethan Yonker 8d039f7bd8 libtar: support backing up and restoring new Android user.* xattr
Support for backing up and restoring user.default, user.inode_cache, and
user.inode_code_cache xattrs introduced in Android 7.x

Change-Id: I6e0aa7fc9cd30ed004ef28ebb58d60a82e518123
2017-02-16 21:50:05 -06:00
Matt Mower 9cc33c8391 Partition: Remove unused has_data_media variable
Change-Id: Ic1a3aa2b57db5539ce6f6740a63bfe6d33890d70
2017-02-16 17:09:44 +01:00
Matt Mower 0c00571d49 GUI: Fix typo in warning message
Change-Id: I991ad86a453273139bcafbb9f68898631dfb6b51
2017-02-16 17:07:43 +01:00
Matt Mower d821c96c52 Symlink file_contexts --> file_contexts.bin
The presence of /file_contexts is still important to TWRP:
- files written while in adb shell only pick up contexts if
  /file_contexts is present
- fixContexts looks for /file_contexts
- if !USE_EXT4 (is this possible), then make_ext4fs looks for
  /file_contexts when wiping

In the event than file_contexts.bin also becomes more important in the
future, leave it in place and create a symlink to it.

Change-Id: Ic87852248d42d5ea6bf936df160efa41294b6520
2017-02-16 17:06:48 +01:00
Matt Mower 6244806a62 Fix bldr msg file open mode when offset specified
It was pointed out to me by gmrt that O_APPEND is incorrect, as lseek
before writing would be undone (perhaps we avoided this issue due to
an inability to write beyond the end of a partition) and O_RDWR is not
necessary to lseek. When AOSP switched from fopen to open, they also
removed the full partition wipe (fopen in wb mode) before each write,
so this is no longer an issue. Completely restore the original AOSP
file access mode flags.

Change-Id: I42b4efc5f499360ce5b761d3a2a5d4dac4cdfb65
2017-02-16 05:19:59 +01:00
z31s1g d1d3cb6ef0 DE language update
Change-Id: I20b8e99bf011e8f3894f20fef1a5d46cca4cd3b6
2017-02-12 16:51:50 +01:00
big biff 116f6700e3 Merge "languages: update italian translation" into android-7.1 2017-02-10 17:36:40 +01:00
Stefano Gottardo 650d29f8c4 languages: update italian translation
Change-Id: I03c194ccf270ef9dfb910626741d6be76945df05
2017-02-10 14:23:13 +01:00
SevenMaxs 5cec2d8b77 Update ru.xml for TWRP ver. 3.0.3.0
Added new strings and minor fix for Russian localization.

Change-Id: I696b9088813a543e5b05366552a6630828dd12df
2017-02-10 13:32:20 +01:00
Ethan Yonker 01f4e035aa Improve backup display names with emulated storage
-Change backup display name to say that we are excluding storage
-Add warning message during backup of any partition with data media
-Also eliminate unused variable from twrpTar class

Maybe this will make the people in issue 276 happy, but probably not because
they already lost their data, or because the warning text is yellow instead of
red.
https://github.com/TeamWin/Team-Win-Recovery-Project/issues/276

Change-Id: I98303fe7f6b7a25fea029637c90145258d41ee46
2017-02-07 21:30:01 -06:00
Dees Troy b5e7ca96ef Merge "Fix crash during check for TWRP app" into android-7.1 2017-02-08 04:23:49 +01:00
big biff e1a11463bd Merge "Adjust & Improve Chinese translations for zh_CN/TW again" into android-7.1 2017-02-07 13:50:06 +01:00
Ethan Yonker 5128d299a5 Fix crash during check for TWRP app
Make sure that opendir succeeds before continuing.

Change-Id: I3c96002ab830f4df2041044d411a7bac42a5b8f4
2017-02-05 23:27:54 -05:00
Matt Mower 0c88b84681 Fill uid/gid for screenshots at compile time
It's not necessary to rely on the success of a call to getpwnam() for
the uid/gid of a file stored to sdcard (or external storage). Use the
definitions in system/core/include/private/android_filesystem_config.h

Change-Id: I979cfa0c74ecc927b88b0967cc56a66da237cc60
2017-02-03 05:32:00 +01:00
Matt Mower d4a1118152 GUI: Improve automatic determination of TW_THEME
* If TW_THEME is not defined, then check both DEVICE_RESOLUTION and
  TARGET_SCREEN_WIDTH x TARGET_SCREEN_HEIGHT for width/height. Use
  the determined width and height to automatically select landscape,
  portrait, or watch, as well as associated mdpi/hdpi.

* Improve the display of the error message so it fits in a standard 80
  character width terminal without line wraps.

* Write relevant errors for missing themes that clarify what went
  wrong.

Change-Id: I94b02349ce38bf6a9cecde403d78ff2490821d8a
2017-02-02 12:07:26 -06:00
Matt Mower 8df3191bee Allow custom bootloader msg offset in block misc
Globally define BOARD_RECOVERY_BLDRMSG_OFFSET with a decimal integer
to offset the read/write location in misc where the bootloader message
should appear. Example:

  BOARD_GLOBAL_CFLAGS := -DBOARD_RECOVERY_BLDRMSG_OFFSET=2048

Edify commands get_stage and set_stage need to be aware of the
custom bootloader msg offset because they write the stage directly
to the BCB.

Change-Id: Ifdb5ffe3e893a651be59ae63e3a0ebadd828c9f2
2017-02-02 17:03:12 +01:00
nkk71 6e4114f8b7 gui: Fix Android.mk for TW_CUSTOM_THEME
Change-Id: I7814e3960914ebefdc03cf9cf6f44e193efea932
2017-02-02 16:16:52 +01:00
maxwen e7c8856555 recovery: adjust mkfs.f2fs location
middle finger ahead

Change-Id: I14a036a5a79121056e6185f367fc6d61bcec46d2
2017-01-24 16:18:58 +01:00
that 6b9ad62b6c orscmd: add minimal getcap and setcap tools
These are mostly intended for debugging and for emergency repairs.
Optimized for minimal code size and dependencies, not for usability.

Change-Id: I671850a03151dd716c715f953f0b2bc8dbacffe7
2017-01-21 15:48:00 +01:00
Matt Mower 0c347d597a Support power key on slideout
Change-Id: Ic1cba57b6d0fbefee2391d06d140da9e4e3dbb32
2017-01-21 15:31:24 +01:00
Matt Mower 3267662c54 Whitespace cleanup in Themes
Commit 'Copy Kernel Logs' did not adhere to tab spacing.

Change-Id: Ie036aa6b973e01f992199787c64b54a6ccb73a7e
2017-01-21 15:31:01 +01:00
Ethan Yonker 16159166af Disable relocations on orscmd to fix compile error in Omni 7.1
ERROR: Missing or empty .rel.dyn or .rela.dyn section
ERROR: Failed to load as ELF

This change fixes the compile error by disabling relocations. Thanks to
mdmower for pointing out the best fix.

Change-Id: I60e637158c324295c42c480139d6d38157ba0d31
2017-01-21 15:24:43 +01:00
Ethan Yonker b386f71078 ifdef overlay graphics
Change-Id: If3173ddbfaccb95cc48636240ee3a918dac1e23f
2017-01-21 08:23:09 -06:00
James Christopher Adduono c51bd35040 Try mounting different filesystems during decryption
Based on Dees_Troy's approach.

Change-Id: Id9aafb6d0c64ab43e2711720a26e30ac86b90235
2017-01-21 00:31:36 -05:00
Matt Mower 37a7ab6943 Add another license header
* Missed this one in the first sweep

Change-Id: I5f2753f93ce3e9888c553de4c2e510137e818a29
2017-01-20 01:27:40 +01:00
Ethan Yonker 5e1a7f932c Fix detection of TWRP app in /data
Change-Id: Icab9db0ceb63edba021cc190eea2ebbc87cf3442
2017-01-18 16:44:54 -06:00
Dees Troy 88040ccb0e Merge "gui: bump theme version to 2" into android-7.1 2017-01-18 22:52:38 +01:00
that 74bff7f73f gui: bump theme version to 2
Commit 9472ba1d introduced new behavior for KEY_POWER which
needs a corresponding change in the theme to call the
setbacklight action whenever the power button is pressed.

Change-Id: Iacd46436b04aba1ecb1adbb684c56c3ef994bfe0
2017-01-18 22:32:36 +01:00
Matt Mower 3626bdc800 bldrmsg: Only emmc /misc is supported
Change-Id: Ic0716557a87ec0638e2dbed1c3f743231e8b2f8e
2017-01-18 21:10:34 +01:00
Matt Mower c39b1b4e51 gui: Initialize button render position
Change-Id: I716ae0664ea454706cb940d1bfd38259da53d176
2017-01-18 21:10:04 +01:00
Matt Mower 91584b2603 HardwareKeyboard: Update event logging
Use LOGERR(), consistent with rest of TWRP.

Change-Id: I75a44d807a17aea6027830d58c37ac130fee12a7
2017-01-18 21:09:42 +01:00
Matt Mower b68bff01d3 GUI: Mark local flip() function as static
Change-Id: Ib92e294872c1408cc749fdb0db3bbf56579eb070
2017-01-18 13:04:35 -06:00
Matt Mower 908a27728c fb2png: Update/Cleanup headers
* Include relevant headers for all used functions
* Add prototype for fb_dump() to fb.h since used in c-files
* Alphabetize includes

Change-Id: Ifdbaceadb12576b607b654835ae93bc88e2c3268
2017-01-18 13:04:35 -06:00
Matt Mower 18bdccb790 init: Remove duplicate trigger of load_system_props_action
Change-Id: I29ba5c4d78be24de3dabc0083fe291fb2b65fa54
2017-01-18 13:04:35 -06:00
Matt Mower 06543e35e0 Add missing file descriptor closes
Change-Id: I7154a022833a5e092facd7c5df776719b9fcc929
2017-01-18 13:04:35 -06:00
Matt Mower 173cdb9ad8 Restore TW_BACKUP_AVG_IMG_RATE handling
Preserving the average BPS across partitions appears to have been
wiped out by the adb backup patch set. Restore it.

Change-Id: Id05c12ff61260b642ee7acd979132a2cba026d87
2017-01-18 13:04:35 -06:00
Matt Mower 840576155a Move sh selection out of GUI makefile
* The TWRP_SH_TARGET variable is only used if TW_USE_TOOLBOX == false,
  so it doesn't really need to be defined.
* Move the busybox sh symlink creation nearer to the toolbox/busybox
  build rules and take advantage of LOCAL_POST_INSTALL_CMD which has
  been around since Android 4.3.

Change-Id: I7850f9c3e113d43ad519dd5c9a7d25e36ec1c426
2017-01-18 13:04:35 -06:00
Matt Mower c55b9a7893 Move pigz symlinks out of GUI makefile
* Unify the building of pigz and its symlinks under the same module.
  LOCAL_POST_INSTALL_CMD has been around since Android 4.3, use it.

Change-Id: I6a1f74216b6f5a5283fc17839b9b6f19571f3be5
2017-01-18 13:04:35 -06:00
Matt Mower e04eee73e9 Add missing license headers
Change-Id: I7f807a2f140068181524d8e868d029b4d94c70e8
2017-01-18 20:02:43 +01:00
James Christopher Adduono 9eb2769841 flashutils: additional emmc check
Some devices are missing /proc/emmc!

Change-Id: I38ae9e01b8bb0764250998a1a6fef7c754b8e9ce
2017-01-18 20:01:29 +01:00
Matt Mower 9472ba1d39 gui: Actions: Toggle backlight on power key
Create GUIAction to handle KEY_POWER with a screen backlight toggle.

Change-Id: Iad0a7923b4a776e0336722db74d6fc46cd0107a2
2017-01-18 19:55:33 +01:00
Matt Mower 874136434a SELinux can be assumed for Android 4.4+
Change-Id: I7410a0c8e439eec90a955ee9201efd9a92bb9635
2017-01-18 12:40:26 -06:00