Refactored code

This commit is contained in:
butomo1989
2018-08-02 11:42:19 +02:00
parent d13e60a122
commit 91a4e270c6
2 changed files with 28 additions and 21 deletions
Regular → Executable
+20 -20
View File
@@ -1,30 +1,30 @@
#!/bin/bash
BOOT ()
{
A=$(adb wait-for-device shell getprop sys.boot_completed | tr -d '\r')
while [[ $A != "1" ]]; do
sleep 1;
A=$(adb wait-for-device shell getprop sys.boot_completed | tr -d '\r')
done;
function wait_emulator_to_be_ready () {
boot_completed=false
while [ "$boot_completed" == false ]; do
status=$(adb wait-for-device shell getprop sys.boot_completed | tr -d '\r')
echo "Boot Status: $boot_completed"
if [ "$boot_completed" == "1" ]; then
boot_completed=true
else
sleep 1
fi
done
}
Get_Google_Play_Services ()
{
wget "https://www.apklinker.com/wp-content/uploads/uploaded_apk/5b51570a214a8/com.google.android.gms_12.8.74-040700-204998136_12874026_MinAPI23_(x86)(nodpi)_apklinker.com.apk"
function install_google_play_service () {
wait_emulator_to_be_ready
adb install -r "/root/google_play_service.apk"
}
Update_Google_Play_Services ()
{
adb install -r "$PWD/com.google.android.gms_12.8.74-040700-204998136_12874026_MinAPI23_(x86)(nodpi)_apklinker.com.apk"
}
Disable_animations ()
{
function disable_animation () {
# this is for demonstration what other amazing staff can be done here
adb shell "settings put global window_animation_scale 0.0"
adb shell "settings put global transition_animation_scale 0.0"
adb shell "settings put global animator_duration_scale 0.0"
}
BOOT
Get_Google_Play_Services
Update_Google_Play_Services
Disable_animations
install_google_play_service
disable_animation