::visit Rootjunky.com

::Set our Window Title
@title Amazon Fire Tablet Tool

::Set our default parameters
@echo off
color 0b



:menuLOOP

	call:header
	::Print our header
	::call:header
	
	::Load up our menu selections
	echo.--------------------------------------------------------------------------------
	for /f "tokens=1,2,* delims=_ " %%A in ('"C:/Windows/system32/findstr.exe /b /c:":menu_" "%~f0""') do echo.  %%B  %%C
	
	call:printstatus

	set choice=
	echo.&set /p choice= Please make a selection or hit ENTER to exit: ||GOTO:EOF
	echo.&call:menu_%choice%
	
GOTO:menuLOOP

:menu_1    ADB Driver Install                 
cls
color 0b
adb kill-server
adb start-server
echo.--------------------------------------------------------------------------------
echo[*] This option will run a program to get your adb drivers
echo[*] installed for your Amazon Fire Tablet exit program when done
echo.--------------------------------------------------------------------------------
echo.
for /f "tokens=1,2,* delims=_ " %%A in ('"C:/Windows/system32/findstr.exe /b /c:":driver_" "%~f0""') do echo.  %%B  %%C
	set choice=
	echo.&set /p choice= Please make a selection then hit ENTER:
	echo.&call:driver_%choice%
color 0b	
cls
GOTO:EOF

:driver_1 ADB driver install
cls
color 0b
echo.--------------------------------------------------------------------------------
echo [*] Before continuing, ensure USB debugging is enabled
echo [*] in your Amazon fire 5th gen settings 
echo [*] go to device options then click on serial number 7 times to enable 
echo [*] developer options then in developer options turn on Enable adb option.
echo [*] MAKES SURE YOUR ANTI VERUS IS OFF. 
echo.--------------------------------------------------------------------------------
echo [*] press any key to start adb driver install
pause >nul
echo.--------------------------------------------------------------------------------
start devmgmt.msc
echo [*] Device Manager should open up wait for it. 
echo [*] Find Amazon Fire and right click on it. 
echo [*] Select Properties then Update Driver 
echo [*] "Browse My Computer For Driver Software" 
echo [*] "Let Me Pick from a List of Device Drivers on my Computer
echo [*] choose Have Disk
echo [*] Browse to the usb_drivers fold that is in this tool
echo [*] then click Next NOTE drivers are not signed this is fine. 
echo [*] once installed ADB should find the Amazon Fire Tablet.
echo.--------------------------------------------------------------------------------
echo [*] please run the driver test to make sure drivers work before installing apps
echo.--------------------------------------------------------------------------------
pause
echo [*] RootJunky OUT
	set choice=
	echo.&set /p choice= hit ENTER to return to start: ||GOTO:EOF
	echo.&call:bootsubmenu_%choice%
color 0b	
cls	
GOTO:EOF

:driver_2  ADB Driver Test
cls
color 0b
adb kill-server
adb start-server
echo [*] Press any key to check if your drivers are installed
echo [*] correctly. 
echo.--------------------------------------------------------------------------------
pause > nul
echo.--------------------------------------------------------------------------------
echo [*] Is there a device listed under list of devices attached?
echo [*] If no then reboot computer and run the driver install option 
echo [*] again then recheck
echo [*] If device serial number listed then drivers are installed.
echo [*] Press any key to continue
echo.--------------------------------------------------------------------------------
adb devices
pause > nul
adb kill-server
echo [*] RootJunky OUT
	set choice=
	echo.&set /p choice= hit ENTER to return to start: ||GOTO:EOF
	echo.&call:bootsubmenu_%choice%
color 0b	
cls	
GOTO:EOF


:menu_2 Install Google Play store and remove ads from lock screen
cls
color 0b
adb kill-server
adb start-server
echo.--------------------------------------------------------------------------------
echo First you must turn on ADB DEBUGGING in your Amazon fire 5th gen settings 
echo go to device options then click on serial number 7 times to enable 
echo developer options then in developer options turn on Enable adb option.
echo also make sure your drivers are installed 
echo.--------------------------------------------------------------------------------
pause
cls
adb wait-for-devices
echo [*] Installing Google Play Store apps this will take some time
echo.--------------------------------------------------------------------------------
echo [*] Installing app 1 of 4
adb install com.google.android.gms-6.6.03_(1681564-036)-6603036-minAPI9.apk
echo.--------------------------------------------------------------------------------
echo [*] Installing app 2 of 4
adb install GoogleLoginService.apk
echo.--------------------------------------------------------------------------------
echo [*] Installing app 3 of 4
adb install GoogleServicesFramework.apk
adb shell pm grant com.google.android.gms android.permission.INTERACT_ACROSS_USERS
echo.--------------------------------------------------------------------------------
echo [*] Installing app 4 of 4
adb install com.android.vending-5.9.12-80391200-minAPI9.apk
adb shell pm hide com.amazon.kindle.kso
cls
echo [*] all apps installed and permissions set.
echo [*] Also removed the ads from your lock screen.. your welcome
echo [*] please reboot device to fully remove ads then sign into Play store
echo.--------------------------------------------------------------------------------
adb kill-server
pause
color 0b	
cls
GOTO:EOF


:menu_3 block OTA updates from Amazon
cls
color 0b
adb kill-server
adb start-server
echo.--------------------------------------------------------------------------------
echo First you must turn on ADB DEBUGGING in your Amazon fire 5th gen settings 
echo go to device options then click on serial number 7 times to enable 
echo developer options then in developer options turn on Enable adb option.
echo also make sure your drivers are installed 
echo.--------------------------------------------------------------------------------
pause
cls
adb wait-for-devices
adb shell pm hide com.amazon.otaverifier
adb shell pm hide com.amazon.device.software.ota
adb shell pm hide com.amazon.settings.systemupdates
echo.--------------------------------------------------------------------------------
echo [*] OTA update have now been blocked to protect root
echo [*] and keep Amazon from patching our exploits 
echo.--------------------------------------------------------------------------------
adb kill-server
pause
color 0b	
cls
GOTO:EOF


:menu_4 unblock OTA updates from Amazon
cls
color 0b
adb kill-server
adb start-server
echo.--------------------------------------------------------------------------------
echo First you must turn on ADB DEBUGGING in your Amazon fire 5th gen settings 
echo go to device options then click on serial number 7 times to enable 
echo developer options then in developer options turn on Enable adb option.
echo also make sure your drivers are installed 
echo.--------------------------------------------------------------------------------
pause
cls
adb wait-for-devices
adb shell pm unhide com.amazon.otaverifier
adb shell pm unhide com.amazon.device.software.ota
adb shell pm unhide com.amazon.settings.systemupdates
echo.--------------------------------------------------------------------------------
echo [*] OTA update have now been unblocked
echo [*] and amazon can now auto update your device.
echo.--------------------------------------------------------------------------------
adb kill-server
pause
color 0b	
cls
GOTO:EOF



:header  
cls        
color 0e
echo.[////////////////////////////      //////////            //////////////////////]                                                                           
echo.[///////////////////////////  ///   //////////////  ///////////////////////////]                                                                            
echo.[//////////////////////////  ////  //////////////  ////////////////////////////]                                                                    
echo.[/////////////////////////  //   ///////////////  /////////////////////////////]                                       
echo.[////////////////////////  ////  /////////  ///  //////////////////////////////]                                  
echo.[///////////////////////  //////  /////////    ////////////////////////////////]
echo.            RootJunkys Amazon Fire Tablet Google Play store Install
echo.             Huge thanks to SD-Shadow for his work on this device.
echo.--------------------------------------------------------------------------------
echo.
adb kill-server
adb start-server
echo.--------------------------------------------------------------------------------
adb devices
timeout 5 > nul
adb kill-server
cls	
color 0b
GOTO:EOF

:printstatus
echo.
echo. Lets Do This...
echo.--------------------------------------------------------------------------------
GOTO:EOF

