summaryrefslogtreecommitdiffstats
path: root/adb_install.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge up to android-8.1.0_r1 and fix conflictsEthan Yonker2017-12-151-130/+138
|\ | | | | | | Change-Id: I2dc060134d15ec9f015a606cb24ef8276f6af1fc
| * Don't write to /sys/class/android_usb/android0/enable with configfs.Tao Bao2017-05-111-7/+16
| | | | | | | | | | | | | | | | | | | | USB configfs doesn't use /s/c/a/a/enable. Trying to set that gives confusing message on screen when sideloading. Bug: 37713851 Test: adb sideload on device using with configfs. Test: adb sideload on marlin. Change-Id: Ifa55f90c2a5fe6bf9e7cee95882de9f6de686d73
| * adb_install: Stop passing RecoveryUI as a parameter.Tao Bao2017-05-011-96/+93
| | | | | | | | | | | | | | | | | | | | | | It's already a global declared in common.h which is included by adb_install.cpp. Remove '#include "minadbd/fuse_adb_provider.h"' that's not needed by adb_install.cpp (minadbd takes care of that). Test: mmma bootable/recovery Change-Id: I6d08b7abc706b4b05de2ef46a57ced2204ad297e
* | FBE for Pixel 2Ethan Yonker2017-11-281-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | Includes various minor fixes for building in Android 8 trees with r23+ tag Update FBE extended header in libtar to version 2 and include the entire ext4_encryption_policy structure now after translating the policy. See this post for more details: https://plus.google.com/u/1/+DeesTroy/posts/i33ygUi7tiu Change-Id: I2af981e51f459b17fcd895fb8c2d3f6c8200e24b
* | Update to AOSP 8.0 baseEthan Yonker2017-09-081-10/+13
|\| | | | | | | Change-Id: I29fe722b4eb9718765327902779046840a01433e
| * Replace _exit(-1) with _exit(EXIT_FAILURE).Tao Bao2017-02-031-1/+1
| | | | | | | | | | | | | | | | | | -1 is not a valid exit status. Also replace a few exit(1) with exit(EXIT_FAILURE). Test: mmma bootable/recovery Change-Id: I4596c8328b770bf95acccc06a4401bd5cabd4bfd
| * Switch to <android-base/properties.h>.Elliott Hughes2016-09-261-3/+4
| | | | | | | | | | | | | | Bug: http://b/23102347 Test: boot into recovery. Change-Id: Ib2ca560f1312961c21fbaa294bb068de19cb883e Merged-In: Ib2ca560f1312961c21fbaa294bb068de19cb883e
| * Merge \"Remove an abused global so we can actually see logging.\"Elliott Hughes2016-06-161-19/+11
| |\ | | | | | | | | | | | | | | | am: 37450d7f42 Change-Id: Id9c78be08f2822ec92d54ba11693d3e5adb7b5aa
| | * Remove an abused global so we can actually see logging.Elliott Hughes2016-06-161-19/+11
| | | | | | | | | | | | Change-Id: Ib97440bc0542003b84c45cb05f194ba20104dad6
* | | Make naming scheme more meaningfulEthan Yonker2016-08-291-1/+1
| | | | | | | | | | | | Change-Id: Ifcaf00c760ff452b0e85a88b54e91ca0f2f4644a
* | | Make it backwards compatible with 4.4Ethan Yonker2016-08-251-0/+4
| | | | | | | | | | | | Change-Id: I668604cddc8e8afbf78709f3f872bea4e9f4aa06
* | | Update to 7.0Ethan Yonker2016-08-241-1/+2
|\| | | | | | | | | | | Change-Id: I621cc47352f7ac552d9602485825ae3a6f9ae516
| * | Allow recovery to return error codesTianjie Xu2016-05-201-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Write error code, cause code, and retry count into last_install. So we can have more information about the reason of a failed OTA. Example of new last_install: @/cache/recovery/block.map package name 0 install result retry: 1 retry count (new) error: 30 error code (new) cause: 12 error cause (new) Details in: go/android-ota-errorcode Bug: 28471955 Change-Id: I00e7153c821e7355c1be81a86c7f228108f3dc37
| * recovery: Switch to clangTao Bao2015-06-031-1/+1
| | | | | | | | | | | | And a few trival fixes to suppress warnings. Change-Id: I38734b5f4434643e85feab25f4807b46a45d8d65
| * Check all lseek calls succeed.Elliott Hughes2015-04-301-1/+1
| | | | | | | | | | | | | | Also add missing TEMP_FAILURE_RETRYs on read, write, and lseek. Bug: http://b/20625546 Change-Id: I03b198e11c1921b35518ee2dd005a7cfcf4fd94b
* | Merge up to AOSP marshmallow-releaseEthan Yonker2015-10-091-5/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to maintain compatibility with older trees, we now have minadbd.old and minui.old. I had to use a TARGET_GLOBAL_CFLAG to handle ifdef issues in minui/minui.d because healthd includes minui/minui.h and there was no other alternative to make minui.h compatible with older trees without having to modify healthd rules which is outside of TWRP. Note that the new minui does not currently have support for qcom overlay graphics. Support for this graphics mode will likely be added in a later patch set. If you are building in a 6.0 tree and have a device that needs qcom overlay graphics, be warned, as off mode charging may not work properly. A dead battery in this case could potentially brick your device if it is unable to charge as healthd handles charging duties. Update rules for building toolbox and add rules for making toybox Use permissive.sh in init.rc which will follow symlinks so we do not have to worry about what binary is supplying the setenforce functionality (toolbox, toybox, or busybox). Fix a few warnings in the main recovery binary source code. Fix a few includes that were missing that prevented compiling in 6.0 Change-Id: Ia67aa2107d260883da5e365475a19bea538e8b97
| * | Check all lseek calls succeed.Elliott Hughes2015-04-301-1/+1
| |/ | | | | | | | | | | | | | | Also add missing TEMP_FAILURE_RETRYs on read, write, and lseek. Bug: http://b/20625546 Change-Id: I03b198e11c1921b35518ee2dd005a7cfcf4fd94b (cherry picked from commit 7bad7c4646ee8fd8d6e6ed0ffd3ddbb0c1b41a2f)
| * Switch minadb over to C++.Elliott Hughes2015-04-101-2/+0
| | | | | | | | Change-Id: I5afaf70caa590525627c676c88b445d3162de33e
| * Enable printf format argument checking.Elliott Hughes2015-04-091-1/+1
| | | | | | | | | | | | | | The original attempt missed the fact that Print is a member function, so the first argument is the implicit 'this'. Change-Id: I963b668c5432804c767f0a2e3ef7dea5978a1218
| * Rotate logs only when there are actual operationsTao Bao2015-04-081-0/+2
| | | | | | | | | | | | | | | | | | | | Currently it rotates the log files every time it boots into the recovery mode. We lose useful logs after ten times. This CL changes the rotation condition so that it will rotate only if it performs some actual operations that modify the flash (installs, wipes, sideloads and etc). Bug: 19695622 Change-Id: Ie708ad955ef31aa500b6590c65faa72391705940
| * Factor out option variables from int to bool typesTao Bao2015-03-251-1/+1
| | | | | | | | Change-Id: Ia897aa43e44d115bde6de91789b35723826ace22
| * recovery: Properly detect userdebug or eng buildsElliott Hughes2015-02-101-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recovery system behaves a little bit differently on userdebug or eng builds by presenting error reports to the user in the ui. This is controlled by checking the build fingerprint for the string :userdebug/ or :eng/. But with AOSP version numbers most AOSP builds blows the 92 char limit of ro.build.fingerprint and therefore the property is not set, so this condition will always be evaluated to false, for most builds. Instead of depending on the flaky ro.build.fingerprint this change uses ro.debuggable. Change-Id: I74bc00c655ac596aaf4b488ecea58f0a8de9c26b
* | fix adb sideloadthat2015-01-041-31/+23
| | | | | | | | | | | | | | | | | | | | - "Cancel" button handling requires another thread - simplify handling of child pid - merge duplicated code for reinjecting TWRP after installation - fix error that showed on host PC after sideload finished - fix problem where adbd sometimes does not stop correctly Change-Id: I536877f024b606756c6a3289c6ddfdba423a60d6
* | Update adb sideload featureEthan Yonker2014-11-081-24/+27
| | | | | | | | Change-Id: Ib503d0e87434e1a28430779302d6565211c26592
* | Fix up libaosprecoveryEthan Yonker2014-11-061-4/+6
| | | | | | | | Change-Id: I5a6d0c3c5f9a3a474464c0f06d6b09045459eebb
* | Merge in lollipop and attempt to fix merge conflictsEthan Yonker2014-11-061-8/+53
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will probably not compile and may need additional work. For tracking purposes so we know what might still need looking at as none of this has been compiled and tested, here is a list of the merge conflicts that I attempted to fix before pushing this set of changes: git pull aosp lollipop-release remote: Finding sources: 100% (992/992) remote: Total 992 (delta 473), reused 992 (delta 473) Receiving objects: 100% (992/992), 1.51 MiB | 516.00 KiB/s, done. Resolving deltas: 100% (473/473), completed with 42 local objects. From https://android.googlesource.com/platform/bootable/recovery * branch lollipop-release -> FETCH_HEAD * [new branch] lollipop-release -> aosp/lollipop-release Auto-merging verifier_test.cpp CONFLICT (content): Merge conflict in verifier_test.cpp Auto-merging verifier.h CONFLICT (content): Merge conflict in verifier.h Auto-merging verifier.cpp CONFLICT (content): Merge conflict in verifier.cpp Auto-merging updater/updater.c Auto-merging updater/install.c CONFLICT (content): Merge conflict in updater/install.c Auto-merging updater/Android.mk CONFLICT (content): Merge conflict in updater/Android.mk Auto-merging uncrypt/Android.mk CONFLICT (content): Merge conflict in uncrypt/Android.mk Auto-merging ui.cpp CONFLICT (content): Merge conflict in ui.cpp Auto-merging screen_ui.cpp Auto-merging roots.cpp CONFLICT (content): Merge conflict in roots.cpp CONFLICT (rename/delete): res-hdpi/images/progress_fill.png deleted in HEAD and renamed in cddb68b5eafbeba696d5276bda1f1a9f70bbde42. Version cddb68b5eafbeba696d5276bda1f1a9f70bbde42 of res-hdpi/images/progress_fill.png left in tree. CONFLICT (rename/delete): res-hdpi/images/progress_empty.png deleted in HEAD and renamed in cddb68b5eafbeba696d5276bda1f1a9f70bbde42. Version cddb68b5eafbeba696d5276bda1f1a9f70bbde42 of res-hdpi/images/progress_empty.png left in tree. CONFLICT (rename/delete): res-hdpi/images/icon_error.png deleted in HEAD and renamed in cddb68b5eafbeba696d5276bda1f1a9f70bbde42. Version cddb68b5eafbeba696d5276bda1f1a9f70bbde42 of res-hdpi/images/icon_error.png left in tree. Auto-merging recovery.cpp CONFLICT (content): Merge conflict in recovery.cpp Auto-merging minui/resources.c CONFLICT (content): Merge conflict in minui/resources.c Auto-merging minui/minui.h CONFLICT (content): Merge conflict in minui/minui.h Auto-merging minui/graphics.c CONFLICT (content): Merge conflict in minui/graphics.c Auto-merging minui/Android.mk CONFLICT (content): Merge conflict in minui/Android.mk Removing minelf/Retouch.h Removing minelf/Retouch.c Auto-merging minadbd/usb_linux_client.c CONFLICT (content): Merge conflict in minadbd/usb_linux_client.c Auto-merging minadbd/adb.h CONFLICT (content): Merge conflict in minadbd/adb.h Auto-merging minadbd/adb.c CONFLICT (content): Merge conflict in minadbd/adb.c Auto-merging minadbd/Android.mk CONFLICT (content): Merge conflict in minadbd/Android.mk Removing make-overlay.py Auto-merging install.h CONFLICT (content): Merge conflict in install.h Auto-merging etc/init.rc CONFLICT (content): Merge conflict in etc/init.rc Auto-merging bootloader.h Auto-merging applypatch/applypatch.c Auto-merging applypatch/Android.mk CONFLICT (content): Merge conflict in applypatch/Android.mk Auto-merging adb_install.cpp CONFLICT (content): Merge conflict in adb_install.cpp Auto-merging Android.mk CONFLICT (content): Merge conflict in Android.mk Automatic merge failed; fix conflicts and then commit the result. Change-Id: I3e0e03e48ad8550912111c7a5c9a140ed0267e2c
| * refactor fuse sideloading codeDoug Zongker2014-07-101-5/+6
| | | | | | | | | | | | | | | | | | Split the adb-specific portions (fetching a block from the adb host and closing the connections) out from the rest of the FUSE filesystem code, so that we can reuse the fuse stuff for installing off sdcards as well. Change-Id: I0ba385fd35999c5f5cad27842bc82024a264dd14
| * sideload without holding the whole package in RAMDoug Zongker2014-07-021-16/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement a new method of sideloading over ADB that does not require the entire package to be held in RAM (useful for low-RAM devices and devices using block OTA where we'd rather have more RAM available for binary patching). We communicate with the host using a new adb service called "sideload-host", which makes the host act as a server, sending us different parts of the package file on request. We create a FUSE filesystem that creates a virtual file "/sideload/package.zip" that is backed by the ADB connection -- users see a normal file, but when they read from the file we're actually fetching the data from the adb host. This file is then passed to the verification and installation systems like any other. To prevent a malicious adb host implementation from serving different data to the verification and installation phases of sideloading, the FUSE filesystem verifies that the contents of the file don't change between reads -- every time we fetch a block from the host we compare its hash to the previous hash for that block (if it was read before) and cause the read to fail if it changes. One necessary change is that the minadbd started by recovery in sideload mode no longer drops its root privileges (they're needed to mount the FUSE filesystem). We rely on SELinux enforcement to restrict the set of things that can be accessed. Change-Id: Ida7dbd3b04c1d4e27a2779d88c1da0c7c81fb114
* | Move all AOSP code out of recovery binaryDees_Troy2013-04-041-20/+16
| | | | | | | | | | | | Improves license compatibility between GPL and Apache Change-Id: I2b165aa575bb6213af6b07936f99610c113443f0
* | Update tablet layouts with ADB sideloadDees_Troy2012-09-241-1/+1
| |
* | Add init.htc.rc and modify ADB sideload messagesDees_Troy2012-09-211-0/+10
| |
* | Improve adb sideload - use storage vs tmpDees_Troy2012-09-191-15/+3
| |
* | Improve adb sideload -- add cancelDees_Troy2012-09-191-1/+15
| | | | | | | | | | Also copy zip from /tmp to storage and remove from /tmp to prevent running out of RAM.
* | Update backup and restore code, adb sideloadDees_Troy2012-09-171-1/+3
|/ | | | | | | Fixed a problem with using make_ext4fs by making its lib a dynamic lib. Added ADB sideload zip install feature - no way to cancel it yet. Improve backup and restore code.
* support "sideload over ADB" modeDoug Zongker2012-01-101-0/+110
Rather than depending on the existence of some place to store a file that is accessible to users on an an unbootable device (eg, a physical sdcard, external USB drive, etc.), add support for sideloading packages sent to the device with adb. This change adds a "minimal adbd" which supports nothing but receiving a package over adb (with the "adb sideload" command) and storing it to a fixed filename in the /tmp ramdisk, from where it can be verified and sideloaded in the usual way. This should be leave available even on locked user-build devices. The user can select "apply package from ADB" from the recovery menu, which starts minimal-adb mode (shutting down any real adbd that may be running). Once minimal-adb has received a package it exits (restarting real adbd if appropriate) and then verification and installation of the received package proceeds. Change-Id: I6fe13161ca064a98d06fa32104e1f432826582f5