Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support newproject in recovery #4

Open
wants to merge 1 commit into
base: lollipop-5.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added tools/releasetools/ls
Binary file not shown.
14 changes: 14 additions & 0 deletions tools/target_files_from_device.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ OUTPUT_OTA_PACKAGE=$OUT_DIR/vendor_ota.zip
FROM_OTA=0
ROOT_STATE="system_root"

FROM_RECOVERY=0
######## Error Exit Num ##########
ERR_USB_NOT_CONNECTED=151
ERR_DEVICE_NOT_ROOTED=152
Expand Down Expand Up @@ -83,10 +84,19 @@ function waitForDeviceOnline {
fi
}

function checkRecovery {
if adb devices | grep -i "recovery" > /dev/null; then
FROM_RECOVERY=1
adb shell mount -o remount,rw /system
else
FROM_RECOVERY=0
fi
}
# check system root state
function checkRootState {
echo ">> Check root state of phone ..."
waitForDeviceOnline
if [ $FROM_RECOVERY == 0 ];then
SECURE_PROP=$(adb shell cat /default.prop | grep -o "ro.secure=\w")
DEBUG_PROP=$(adb shell cat /default.prop | grep -o "ro.debuggable=\w")

Expand All @@ -101,6 +111,9 @@ function checkRootState {
else
echo "<< ERROR: Not a root phone, please root this device firstly!!"
exit $ERR_DEVICE_NOT_ROOTED;
fi
else
ROOT_STATE="kernel_root"
fi

echo "<< Check root state of phone done."
Expand Down Expand Up @@ -302,6 +315,7 @@ function zipTargetFiles {

# pull files and info from phone and build a target file
function targetFromPhone {
checkRecovery
checkRootState
copyTargetFilesTemplate

Expand Down