Related
Here is a simple script for adb push and more.Developed by Chubbzlou and myself.
Over the coming days there will be more added. Some will be for experienced developers while some for the newer developers. My goal is to make a one stop tool to help with the following.
Changelog 11/24/2011
Updated the menu to simplify the options plus added HP Touchpad support
New Link
Changelog 10/12/2011
Ok, things got overhauled on this one to simplify things more. Currently there are 23 options with most of them working. The zip menu isn't working 100% but other than that you will have a lot of usefull stuff here.
It's been reorganized to the following.
Section 1
Apk editing
* Framework apks
* Decompile apks
* Compile apks
* Sign apks
* Install apks
* Compile/sign, install apks
Section 2
Classes.dex
* Decompile Classes.dex
* Compile classes.dex
Section 3
Logcat Menu
* Screen Logcat
* Logcat Text
Section 4
Push/Pull Menu
* Push system/folders
* Push data/app
* Pull system from phone
* Adb Shell
* Push to sdcard to create pushed folder or to root of sdcard
* New Back up your sdcard
Section 5
Reboot Menu
* Reboot Phone
* Reboot to Recovery
* Reboot to Bootloader
Section 6
Zip Menu
* Extract apk (not fuctional)
* Zip apk (not functional)
* Zip align/Png opting (completely functional now)
* Compression level (not functional)
Section 7
Odexing Menu
* You can now choose this for an automated odexing. It will odex your ROM, pull system/app and system/framework to device/app and device/framework
edit: Confirmed it will do multiple zipalign/opt pngs. Place apks in folder called apks. Choose menu 22, select zp. It will place them in tools/optimized. However, you have to hit enter after each apk for now. we are working on a fix to move folder to main directory and fix the hit enter. this will let you zipalign and opt all the apks and walk away.
Mirror
More to come...
Credit:
Chubbz, for helping with a lot of the scripting and ideas. Viddywell, thanks for your help. TommyT, your Android Utility inspired me to simplify things, Misfit, testing is always appreciated! Also, Virus. Always helping the community. Thanks brotha!
Sounds like we're thinking on similar wavelengths in terms of making things more easy and user friendly.
I am working on a wrapper to help with troubleshooting and running pre checks to assure any adb scripts will run properly here.
Interested in combining the two?
viddywell said:
Sounds like we're thinking on similar wavelengths in terms of making things more easy and user friendly.
I am working on a wrapper to help with troubleshooting and running pre checks to assure any adb scripts will run properly here.
Interested in combining the two?
Click to expand...
Click to collapse
sure
Plans are to expand this a lot more. Add decomplie/compile classes.dex, decompile/compile apks and jars, and sign non system jars, decompile systemui, framework-res, resources.apks and configure them to ur needs and recompile.
I am tired of using 4-5 different folders when one would surfice.
OMG man this is exactly what I've been wanting to see for the longest time...I'm not very familiar with ADB although I've been wanting to get to learn it for the longest time...thanks a bunfh man...much appreciated as always....
Sent from my PG86100 using Tapatalk
reverepats said:
OMG man this is exactly what I've been wanting to see for the longest time...I'm not very familiar with ADB although I've been wanting to get to learn it for the longest time...thanks a bunfh man...much appreciated as always....
Sent from my PG86100 using Tapatalk
Click to expand...
Click to collapse
+1 thanks Leo!
Nice write up as always Leo
Sent from the CM powered 3d
Leoisright said:
sure
Plans are to expand this a lot more. Add decomplie/compile classes.dex, decompile/compile apks and jars, and sign non system jars, decompile systemui, framework-res, resources.apks and configure them to ur needs and recompile.
I am tired of using 4-5 different folders when one would surfice.
Click to expand...
Click to collapse
Sounds good to me - I see a lot of wasted effort around troubleshooting and working through the basics that can be eliminated by building solid tools.
I've put our two works together. I renamed the file to adbtool.bat, you can change it to whatever you'd like but I'd steer you away from using the name "command" as it is also the same as the system variable for calling the cmd window on a machine.
You can test this by running the script with your device unplugged - that's the only time my portion should do anything. Otherwise it will jump right down to your section.
The .bat is attached and the code below:
Code:
@echo off
REM ========================================================================================================
REM PRE CHECK TEST SCRIPT WRITTEN BY VIDDYWELL (XDA)
REM FURTHER DETAILS AND FUTURE UPDATES AVAILABLE @ http://forum.xda-developers.com/showthread.php?t=1294880
REM ========================================================================================================
REM ====================== BEGIN PRE CHECK TEST SCRIPT ======================
:top
color f0
set reportrun=0
REM Check for HTC Sync
tasklist | findstr htcUPCTLoader >nul
If %errorlevel% equ 0 (set htcsync=1) ELSE (set htcsync=0)
REM Check for Easy Tether
tasklist | findstr easytthr >nul
If %errorlevel% equ 0 (set easyt=1) ELSE (set easyt=0)
REM Check for device connection
adb devices | findstr /r "device$" >nul
If %errorlevel% neq 0 goto devmis
REM Get device state (this can be used as an error checking variable later if necessary)
for /f %%a in ('adb get-state') do @set state=%%a
cls
Echo Device found! In %state% mode.
GOTO ADBCODE
REM ====================== ERROR HANDLING BELOW ======================
exit
:devmis
set sys=n
color 4f
CLS
Echo No device found - please check the following items:
Echo.
If %htcsync% equ 1 Echo - HTC Sync found - Please try disabling
If %easyt% equ 1 Echo - Easy Tether found - Please try disabling
Echo - Device is connected
Echo - USB Debugging is enabled
Echo.
Echo ------------------------------------------
Echo We can collect further information to assist with troubleshooting.
Echo This will query your system and generate a report with information
Echo about your computer. You will be given a chance to review and edit
Echo the collected information and share via copy/paste. No information
Echo will be shared without your consent.
Echo.
Set /p sys=Would you like to collect system information (y/n):
if /I %sys% equ y GOTO sysinfo
if /I %sys% equ yes sysinfo
goto tryagain
:tryagain
cls
echo.
If %reportrun% equ 1 (echo Text from window can be copied to forum for troubleshooting)
Echo Press any key to try running script again
Pause >nul
goto top
:sysinfo
Echo System information - Generated on %date% at %time% >report.txt
Echo ----------------------------------------------------- >>report.txt
echo ADB Version: >>report.txt
adb version >>report.txt
Echo. >>report.txt
echo Windows Version: >>report.txt
ver >>report.txt
Echo. >>report.txt
Echo Files in Directory of Script Execution >>report.txt
dir /b >>report.txt
Echo. >>report.txt
Echo Running Applications: >>report.txt
tasklist >>report.txt
Echo. >>report.txt
Echo Started Services: >>report.txt
sc query >>report.txt
start "" report.txt
set reportrun=1
goto tryagain
REM ====================== END PRE CHECK TEST SCRIPT ======================
REM ========================================================================================================
REM CODE BELOW THIS LINE WRITTEN BY LEOISRIGHT (XDA)
REM FURTHER DETAILS AND FUTURE UPDATES AVAILABLE @ http://forum.xda-developers.com/showthread.php?t=1297096
REM ========================================================================================================
:ADBCODE
setlocal enabledelayedexpansion
COLOR f0
mode con:cols=70 lines=34
setLocal EnableDelayedExpansion
cls
echo.
:restart
echo. **presented by Leoisright**
echo.
echo.
echo HELLO WHAT CAN I DO FOR YOU
echo.
echo.
ECHO 1 - CMD
echo.
ECHO 2 - Logcat
echo.
ECHO 3 - push system/folders
echo.
ECHO 4 - push data/app
echo.
ECHO 5 - Reboot to Recovery
echo.
ECHO 6 - Pull System from phone
echo.
set M=GARBAGE
SET /P M= Choose a Task then press ENTER:
IF %M%==1 GOTO CMD
IF %M%==2 GOTO LOGCAT
IF %M%==3 GOTO push
IF %M%==4 GOTO adb push data/app
IF %M%==5 GOTO RECOVERY
IF %M%==6 GOTO pull system
if %M%==7 GOTO Adb Shell
echo.
:CMD
start %windir%\system32\cmd.exe
cls
goto restart
echo.
echo.
:LOGCAT
start %windir%\system32\cmd.exe /k adb logcat
cls
goto restart
echo.
echo.
:push
start %windir%\system32\cmd.exe /k adb push push/system system/
cls
goto restart
echo.
echo.
cls
:adb push data/app
cd adb push
start %windir%\system32\cmd.exe /k adb push push/data/app data/app
cls
goto restart
echo.
echo.
cls
goto restart
:RECOVERY
cd TOOLS
adb reboot recovery
echo.
echo.
cls
:pull system
cd adb pull
start %windir%\system32\cmd.exe /k adb pull system xron/
cls
goto restart
echo.
echo.
cls
viddywell said:
Sounds good to me - I see a lot of wasted effort around troubleshooting and working through the basics that can be eliminated by building solid tools.
I've put our two works together. I renamed the file to adbtool.bat, you can change it to whatever you'd like but I'd steer you away from using the name "command" as it is also the same as the system variable for calling the cmd window on a machine.
You can test this by running the script with your device unplugged - that's the only time my portion should do anything. Otherwise it will jump right down to your section.
The .bat is attached and the code below:
Code:
@echo off
REM ========================================================================================================
REM PRE CHECK TEST SCRIPT WRITTEN BY VIDDYWELL (XDA)
REM FURTHER DETAILS AND FUTURE UPDATES AVAILABLE @ http://forum.xda-developers.com/showthread.php?t=1294880
REM ========================================================================================================
REM ====================== BEGIN PRE CHECK TEST SCRIPT ======================
:top
color f0
set reportrun=0
REM Check for HTC Sync
tasklist | findstr htcUPCTLoader >nul
If %errorlevel% equ 0 (set htcsync=1) ELSE (set htcsync=0)
REM Check for Easy Tether
tasklist | findstr easytthr >nul
If %errorlevel% equ 0 (set easyt=1) ELSE (set easyt=0)
REM Check for device connection
adb devices | findstr /r "device$" >nul
If %errorlevel% neq 0 goto devmis
REM Get device state (this can be used as an error checking variable later if necessary)
for /f %%a in ('adb get-state') do @set state=%%a
cls
Echo Device found! In %state% mode.
GOTO ADBCODE
REM ====================== ERROR HANDLING BELOW ======================
exit
:devmis
set sys=n
color 4f
CLS
Echo No device found - please check the following items:
Echo.
If %htcsync% equ 1 Echo - HTC Sync found - Please try disabling
If %easyt% equ 1 Echo - Easy Tether found - Please try disabling
Echo - Device is connected
Echo - USB Debugging is enabled
Echo.
Echo ------------------------------------------
Echo We can collect further information to assist with troubleshooting.
Echo This will query your system and generate a report with information
Echo about your computer. You will be given a chance to review and edit
Echo the collected information and share via copy/paste. No information
Echo will be shared without your consent.
Echo.
Set /p sys=Would you like to collect system information (y/n):
if /I %sys% equ y GOTO sysinfo
if /I %sys% equ yes sysinfo
goto tryagain
:tryagain
cls
echo.
If %reportrun% equ 1 (echo Text from window can be copied to forum for troubleshooting)
Echo Press any key to try running script again
Pause >nul
goto top
:sysinfo
Echo System information - Generated on %date% at %time% >report.txt
Echo ----------------------------------------------------- >>report.txt
echo ADB Version: >>report.txt
adb version >>report.txt
Echo. >>report.txt
echo Windows Version: >>report.txt
ver >>report.txt
Echo. >>report.txt
Echo Files in Directory of Script Execution >>report.txt
dir /b >>report.txt
Echo. >>report.txt
Echo Running Applications: >>report.txt
tasklist >>report.txt
Echo. >>report.txt
Echo Started Services: >>report.txt
sc query >>report.txt
start "" report.txt
set reportrun=1
goto tryagain
REM ====================== END PRE CHECK TEST SCRIPT ======================
REM ========================================================================================================
REM CODE BELOW THIS LINE WRITTEN BY LEOISRIGHT (XDA)
REM FURTHER DETAILS AND FUTURE UPDATES AVAILABLE @ http://forum.xda-developers.com/showthread.php?t=1297096
REM ========================================================================================================
:ADBCODE
setlocal enabledelayedexpansion
COLOR f0
mode con:cols=70 lines=34
setLocal EnableDelayedExpansion
cls
echo.
:restart
echo. **presented by Leoisright**
echo.
echo.
echo HELLO WHAT CAN I DO FOR YOU
echo.
echo.
ECHO 1 - CMD
echo.
ECHO 2 - Logcat
echo.
ECHO 3 - push system/folders
echo.
ECHO 4 - push data/app
echo.
ECHO 5 - Reboot to Recovery
echo.
ECHO 6 - Pull System from phone
echo.
set M=GARBAGE
SET /P M= Choose a Task then press ENTER:
IF %M%==1 GOTO CMD
IF %M%==2 GOTO LOGCAT
IF %M%==3 GOTO push
IF %M%==4 GOTO adb push data/app
IF %M%==5 GOTO RECOVERY
IF %M%==6 GOTO pull system
if %M%==7 GOTO Adb Shell
echo.
:CMD
start %windir%\system32\cmd.exe
cls
goto restart
echo.
echo.
:LOGCAT
start %windir%\system32\cmd.exe /k adb logcat
cls
goto restart
echo.
echo.
:push
start %windir%\system32\cmd.exe /k adb push push/system system/
cls
goto restart
echo.
echo.
cls
:adb push data/app
cd adb push
start %windir%\system32\cmd.exe /k adb push push/data/app data/app
cls
goto restart
echo.
echo.
cls
goto restart
:RECOVERY
cd TOOLS
adb reboot recovery
echo.
echo.
cls
:pull system
cd adb pull
start %windir%\system32\cmd.exe /k adb pull system xron/
cls
goto restart
echo.
echo.
cls
Click to expand...
Click to collapse
Good work Bro. Adbtool is much better. I set out to make a simple folder so I could push multiple libs/apps/bin for porting purposes. I will refine my scripts to be more Refined. While I've used lots of great bats, none are an all in one utility.
Tommytomatoe has a fantastic android utility for ubuntu and we need the same stuff for windows.
Let's keep building this. I will keep the OP updated
Sent from my PG86100 using Tapatalk
Hell yea nice, thanx
Sent from my PG86100 using XDA App
updated the thread more and have better adb .bat file for everyone. thanks
Good **** leo definitely gonna give this a shot
Sent from my PG86100 using Tapatalk
OP has been updated with more options and better description of the menu.
Leoisright said:
OP has been updated with more options and better description of the menu.
Click to expand...
Click to collapse
Thanks for the excellent contribution Leo, thanks chubbz!
Leo, your the best. This is Awesome!! Can't wait to be able to compile apks. Thanks for all you do for me and the rest of the community.
Tiffany84 said:
Leo, your the best. This is Awesome!! Can't wait to be able to compile apks. Thanks for all you do for me and the rest of the community.
Click to expand...
Click to collapse
we are very very close to compile right now. Also, we may have figured out a way to extract a zip to folder and zip it back up. will be nice to extract roms this way...mod, then zip back up
Leoisright said:
we are very very close to compile right now. Also, we may have figured out a way to extract a zip to folder and zip it back up. will be nice to extract roms this way...mod, then zip back up
Click to expand...
Click to collapse
WoW!! Just sounding better and better. Please, if you don't mind and can remember, keep me informed on your progress.
solver404 said:
Thanks for the excellent contribution Leo, thanks chubbz!
Click to expand...
Click to collapse
No prob just a little contibution for you guys. Enjoy
Looking good, this will help out so many people
Update. Will fill out OP more later but probaly will have another update before.. Enjoy.
Still a WIP but lots of stuff added.
Very nice tool. Keeps me from having to type adb commands out. Just one comment/suggestion:
Shouldn't the system be mounted before executing adb push(es)??
hello, hope i post it in the right place, if not, please move it.
i bought the phone coolpad 7236, based on snapdragon 200 msm8212 chip.
i found out that i got the chinese version of the firmware, so the seller gave me a link for the multi language firmware: http://www.mediafire.com/folder/7g49chcyb7gdy/ROM_for_Coolpad_7236
there are some files there, offical flashtool, quallcom flash files (to be used with the flashtool), drivers, and an archive containg a script that should replace the entire system folder via adb.
i translated the .cmd file and here it is:
@echo off
%~d0
CD "%~d0%~p0"
set id=7236
taskkill /F /IM tadb.exe >nul 2>nul
taskkill /F /IM bdadb.exe >nul 2>nul
taskkill /F /IM sjk_daemon.exe >nul 2>nul
taskkill /F /IM romaster_daemon.exe >nul 2>nul
taskkill /F /IM AndroidInterface.exe >nul 2>nul
taskkill /F /IM adb.exe >nul 2>nul
adb.exe kill-server >nul 2>nul
echo .
echo The ROM for models£º%id%
echo .
echo Flash this ROM, please brush into the bottom of the package custom 7236
echo.
echo Brushing the bottom package, the phone is switched, the screen splash screen again after connecting USB
echo.
echo Note: During the brush machine, the phone screen is blank, do not operate the phone buttons until the phone automatically restart
echo.
title %id% ¹ú¼Ê°æ By Kyle
pause
:flash
color 1B
cls
adb -d push boot.img /tmp/.
echo Begin transmission system file, about 300M, wait. . . .
adb -d push system7236.tar.gz /tmp/.
adb -d shell mount /data
adb -d shell mount /system
adb -d shell rm -r /system/*
adb -d shell rm -r /data/*
adb -d shell tar -zxvf /tmp/system7236.tar.gz -C /
adb -d shell dd if=/tmp/boot.img of=/dev/block/platform/msm_sdcc.1/by-name/boot
adb -d shell reboot
echo Finished, the phone will automatically enter recovery, the recovery interface, you can directly select reboot system now
pause
exit
Click to expand...
Click to collapse
as you can see, it deletes the system folder and should put the contents of the archive as new system folder.
unfortunally this only made the first step, as soon as the script deleted the system folder, the phone stopped working.
i tried using adb shell to do it manually, but it didn't complied to simple commands as "dir" "ls" "cp" "pull" "push", the phone became a brick.
then i tried using the flashtool, the company says that in order to use it you should dial
#*20110606#
Click to expand...
Click to collapse
and then choose test mode or something in order to allow the flashtool put it in download mode, obiously i can't do that now. i figured that when i hold the power button the screen turns white, making the phone discoverable as quallcom hs-usb diagnostics or something like this, it doesn't work with the flashtool (it searches for qdloader device).
then i tried dumping system.img from other coolpad 7236 device, i used this tutorial: http://forum.xda-developers.com/showthread.php?t=2450045 and i got 800MB file, the fastboot refused to get it, then i used this fastboot: http://forum.xda-developers.com/moto-x/moto-x-qa/solved-img-vzw-xt1060-to-flash-fastboot-t2493814
waited for 30 minutes, but it was stuck on sending.
also, i couldn't get the fastboot to work, i tried to flash the boot.img that the seller gave me in the link, but the fastboot got stuck in "writing", the fastboot also ignored simple commands such as reboot.
the stocvk recovery is not helping either because i don't have signed update.zip for it.
is there anything else to do beside sending it back to china?
and, is there any GOOD WAY to replace the contents of the system folder (in case i get another chinese like this) without bricking the phone?
Figured it out, nevermind
kkffiirr said:
Figured it out, nevermind
Click to expand...
Click to collapse
Hi,
I'm new to all this. And I am having a Coolpad 7236 currently. It is also in Chinese and I do not know how to read that....Sigh...
Good phone with some flaws.
I'm interested in rooting it and flushing out the software to install a new one but I do not know how.
Can help?
Thanks
iandroid.co.il/forum/viewtopic.php?f=190&t=179082&hilit=7236
Use Google translate
Hi. I have the same problem. I am not able to follow the guide from the link you provided. Can you please put in simple terms how I can flash the multi language firmware in my coolpad. If yes, that would be a great help for me
Thanks.
wow, very old post...
here are the steps:
1. install adb drivers, get adb software, set the phone to enable usb debugging and root it with root genius.
2. download the system dump from: https://mega.co.nz/#!9JRTmYyD!MgZR1CITlfUMFM5FUtBlkVCg7u97djHYg8rkmudRbtc
3. download the kernel dump from: https://mega.co.nz/#!EBIH1TRZ!hfesnz3FkZXnaEHw6T5sA1DH98spXAGY594j-0HU-Hw
4. copy the files from 2 and 3 to the phone storage root.
5. start adb shell session by:
Code:
adb -d shell
6. enter the following commands:
Code:
su
dd if=/mnt/sdcard/boot.img of=/dev/block/platform/msm_sdcc.1/by-name/boot
dd if=/mnt/sdcard/system.img of=/dev/block/platform/msm_sdcc.1/by-name/system
note: the first dd shouldn't take much time, while the second might be long, be patient and wait for it to finish, and then reboot
Thanks, kkffirr... The link for Kernel dump is not working.... It says the file has been removed! ?
The Imperium said:
Thanks, kkffirr... The link for Kernel dump is not working.... It says the file has been removed!
Click to expand...
Click to collapse
try this
https://mega.nz/#!IZpwgIJA!hfesnz3FkZXnaEHw6T5sA1DH98spXAGY594j-0HU-Hw
I have been trying for more than a week now, but not able to root the phone... This is so annoying...
The Imperium said:
I have been trying for more than a week now, but not able to root the phone... This is so annoying...
Click to expand...
Click to collapse
it worked for me with root genius back then
Hello everyone,
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I've recently checked a tutorial about the auto-formatting the sd card into internal storage since I don't have space in my storage anymore.
https://forum.xda-developers.com/android/software/auto-formatting-sdcard-to-internal-t3583875
I did all instructions, but to the last part with the command "sm partition disk 179:194 private (or mixed 50)" it shows an error message.
You can find what I followed to the link I've put up there, and I'll ask two questions:
1. How can I do the auto-formatting with aftiss.cmd?
2. How can I fix this error message?
I hope that we'll be able to find a solution to this problem ^^
(PS: for anyone who asks "Why don't you go to the SD card and format as internal directly?" WELL, it's just that I don't have this option, I got a Huawei P8 Lite version, PRA-LX1)
May be on your phone it's not allowed the SD card to be formatted as internal memory.
Guess I have to buy another SD card then :/
But I'll wait for some other comment and see what they will say
Kaguma said:
Guess I have to buy another SD card then :/
But I'll wait for some other comment and see what they will say
Click to expand...
Click to collapse
Simply run
Code:
adb shell
sm has-adoptable
to see whether "false" or "true" is returned.
If it's "false", is there a way to put it on "true"?
Kaguma said:
If it's "false", is there a way to put it on "true"?
Click to expand...
Click to collapse
Buy a phone that supports it.
But except of having another phone, can't I put it on "true" even with my actual phone? There isn't a way at all?
@Kaguma
Here a small Windows command script that shows all the steps to be performed to transform an external SD-card into internal memory
Important: This is not tested so be aware of potential mistakes
Code:
rem (c) 2020 [email protected] Licensed under GPL v3
@echo OFF & setlocal ENABLEDELAYEDEXPANSION
echo FORMATTING EXTERNAL SD-CARD TO BE USED AS INTERNAL MEMORY ...
set "retval="
set /a device_connected=0
for /f "tokens=*" %%a in ('adb devices') do (
set "retval=%%a"
if NOT [!retva!]==[] (
echo !retval! | findstr /C:":" >nul
if !errorlevel! EQU 0 (set /a device_connected=1 )
)
)
if !device_connected! EQU 0 ( echo NO ANDROID DEVICE CONNECTED & goto :end )
set /a adoptable_sd_memory_is_supported=0
for /f "tokens=*" %%a in ('adb shell "sm has-adoptable"') do (
set "retval=%%a"
if NOT [!retval!]==[] (
echo !retval! | findstr /I /C:"true" >nul
if !errorlevel! EQU 0 ( set /a adoptable_sd_memory_is_supported=1 )
)
)
if !adoptable_sd_memory_is_supported! EQU 0 ( echo FEATURE ADOPTABLE MEMORY NOT SUPPORTED & goto :end )
set "private_sd_card_partition="
for /f "tokens=*" %%a in ('adb shell "sm list-disks adoptable"') do (
set "retval=%%a"
if NOT [!retval!]==[] (
echo !retval! | findstr /C:"disk:" >nul
if !errorlevel! EQU 0 ( set "private_sd_card_partition=!retval!" )
)
)
if [!private_sd_card_partition!]==[] ( echo NO MOUNTABLE SD-CARD PARTITION FOUND & goto :end )
rem
rem Depending on ROM instead of e.g. 179,128 obviously 179_128 must be used
rem If so, uncomment next command line
rem
rem set "private_sd_card_partition=!private_sd_card_partition:,=_!"
echo TRANSFORMING WHOLE EXTERNAL SD-CARD INTO INTERNAL MEMORY ...
echo IT TAKES TIME. BE PATIENT.
adb shell "sm set-force-adoptable true" >nul 2>nul
adb shell "sm partition !private_sd_card_partition! private" >nul 2>nul
adb shell "sm set-force-adoptable false" >nul 2>nul
echo DEVICE NOW GETS RE-BOOTED: DON'T UNPLUG SD-CARD.
adb reboot
adb wait-for-device >nul
:check_for_device_has_booted
for /f "tokens=*" %%a in ('adb shell "getprop sys.boot_completed"') do (
set "retval=%%a"
if NOT [!retval!]==[] (
echo !retval! | findstr /C:"1" >nul
if !errorlevel! EQU 0 ( goto :done_check_for_device_has_booted )
)
)
timeout /t 10 /nobreak >nul
goto :check_for_device_has_booted
:done_check_for_device_has_booted
set /a adoptable_storage_created=1
for /f "tokens=*" %%a in ('adb shell "sm list-volumes all"') do (
set "retval=%%a"
if NOT [!retval!]==[] (
echo !retval! | findstr /C:"private mounted null" >nul
if !errorlevel! EQU 0 ( set /a adoptable_storage_created=0 & goto :done_check_for_created)
)
)
:done_check_for_created
if !adoptable_storage_created! EQU 1 ( echo SUCCESS & goto :end )
echo FAILED
:end
pause >nul
echo Press any key to continue ...
endlocal & @echo on
exit
jwoegerbauer said:
@Kaguma
Here a small Windows command script that shows all the steps to be performed to transform an external SD-card into internal memory
Important: This is not tested so be aware of potential mistakes
Code:
rem (c) 2020 [email protected] Licensed under GPL v3
@echo OFF & setlocal ENABLEDELAYEDEXPANSION
echo FORMATTING EXTERNAL SD-CARD TO BE USED AS INTERNAL MEMORY ...
set "retval="
set /a device_connected=0
for /f "tokens=*" %%a in ('adb devices') do (
set "retval=%%a"
if NOT [!retva!]==[] (
echo !retval! | findstr /C:":" >nul
if !errorlevel! EQU 0 (set /a device_connected=1 )
)
)
if !device_connected! EQU 0 ( echo NO ANDROID DEVICE CONNECTED & goto :end )
set /a adoptable_sd_memory_is_supported=0
for /f "tokens=*" %%a in ('adb shell "sm has-adoptable"') do (
set "retval=%%a"
if NOT [!retval!]==[] (
echo !retval! | findstr /I /C:"true" >nul
if !errorlevel! EQU 0 ( set /a adoptable_sd_memory_is_supported=1 )
)
)
if !adoptable_sd_memory_is_supported! EQU 0 ( echo FEATURE ADOPTABLE MEMORY NOT SUPPORTED & goto :end )
set "private_sd_card_partition="
for /f "tokens=*" %%a in ('adb shell "sm list-disks adoptable"') do (
set "retval=%%a"
if NOT [!retval!]==[] (
echo !retval! | findstr /C:"disk:" >nul
if !errorlevel! EQU 0 ( set "private_sd_card_partition=!retval!" )
)
)
if [!private_sd_card_partition!]==[] ( echo NO MOUNTABLE SD-CARD PARTITION FOUND & goto :end )
rem
rem Depending on ROM instead of e.g. 179,128 obviously 179_128 must be used
rem If so, uncomment next command line
rem
rem set "private_sd_card_partition=!private_sd_card_partition:,=_!"
echo TRANSFORMING WHOLE EXTERNAL SD-CARD INTO INTERNAL MEMORY ...
echo IT TAKES TIME. BE PATIENT.
adb shell "sm set-force-adoptable true" >nul 2>nul
adb shell "sm partition !private_sd_card_partition! private" >nul 2>nul
adb shell "sm set-force-adoptable false" >nul 2>nul
echo DEVICE NOW GETS RE-BOOTED: DON'T UNPLUG SD-CARD.
adb reboot
adb wait-for-device >nul
:check_for_device_has_booted
for /f "tokens=*" %%a in ('adb shell "getprop sys.boot_completed"') do (
set "retval=%%a"
if NOT [!retval!]==[] (
echo !retval! | findstr /C:"1" >nul
if !errorlevel! EQU 0 ( goto :done_check_for_device_has_booted )
)
)
timeout /t 10 /nobreak >nul
goto :check_for_device_has_booted
:done_check_for_device_has_booted
set /a adoptable_storage_created=1
for /f "tokens=*" %%a in ('adb shell "sm list-volumes all"') do (
set "retval=%%a"
if NOT [!retval!]==[] (
echo !retval! | findstr /C:"private mounted null" >nul
if !errorlevel! EQU 0 ( set /a adoptable_storage_created=0 & goto :done_check_for_created)
)
)
:done_check_for_created
if !adoptable_storage_created! EQU 1 ( echo SUCCESS & goto :end )
echo FAILED
:end
pause >nul
echo Press any key to continue ...
endlocal & @echo on
exit
Click to expand...
Click to collapse
It's really huge, I could maybe test it, thanks
I'll just wait for other answers, but really thanks
Also, do I have to put it after I put the command "adb shell" or where?
And good morning, by the way ^^
(EDIT: What are the eventual consequences / mistakes?)
Kaguma said:
Also, do I have to put it after I put the command "adb shell" or where?
And good morning, by the way ^^
(EDIT: What are the eventual consequences / mistakes?)
Click to expand...
Click to collapse
1. IT'S A WINDOWS COMMAND SCRIPT TO AVOID TYPING
If you want to make use of it, here's the
HOW-TO:
You add /path/to/ADB to Window's PATH environment variable via Windows command prompt ( CMD ) and not via Windows Powershell ( PS )
Code:
set PATH=%PATH%;[color=red]path/to/ADB[/color]
- where /path/to/ADB for example is C:\ADB - and re-boot computer
You create a Windows .BAT file that contains the code listed above - preferredly by copy & paste - and save it under SDTRANSFORMER.BAT
You put the SD-card to be transformed into phone
You connect your running phone via USB cable with computer
You run the .BAT file previously created
As mentioned: Script may contain bugs, if so, then it's on you to fix them - I don't have SD-cards that lie around ..
2. YOU CAN USE ANDROID TERMINAL TO EXECUTE ALL THE SM * COMMANDS , TOO
Notice that this was my last post here, I no longer participate in this thread. Sorry for this.
Thanks for your help, and have a nice day even if you won't reply here
Hi Kaguma,
it doesn't work for Huawei P8 Lite...
stackoverflow.com/questions/60173545/why-i-got-this-error-please-adoptable-storage-not-available-on-device-with-nat
You can try this :
forum.xda-developers.com/p8lite/p8-lite-2017-development/rom-lineageos-17-1-huawei-p8-lite-2017-t4064121
The tablet is a Billow X103, nearly 2 years old with Android 7.0 1Gb Ram 16G memory and 32G SD. There are no TWRP/CWM recovery boot .imgs and none of the regular one click root apps work. Processor is a Mediatek 8320 I believe.
The bootloader is unlocked. There is no update for it so no OTA or stock firmware files. Where can I obtain a payload.bin for this tablet. Is it possible to extract it from the device with Python/Payload dumper etc so that I can use it to obtain the Boot.img in order to root it with Magisk. I have contacted the manufacturer, they did not reply. Any ideas anyone?
Android 7 OTAs don't contain payload.bin
Thanks, OK I did not know that, So How do I go about getting root on this device, with only the device available, ie there is no stock firmware apart from that on the device itself?
I should have asked how can I extract the boot.img from the device ?
boissano said:
I should have asked how can I extract the boot.img from the device ?
Click to expand...
Click to collapse
You for example run a DOS script like this
Code:
@echo off & setlocal ENABLEDELAYEDEXPANSION
set "adb=C:\ADB-FASTBOOT-R30\adb.exe"
set "dev=" & set "name=" & set /a success=0
!adb! devices
!adb! shell "mkdir -p -m755 /data/local/boot"
for /f "tokens=1,4 delims= " %%a in ('!adb shell "cat proc/mtd"') do (
set "dev=%%a" & set "name=%%b"
echo !name! | findstr /C:"boot" >nul
if !errorlevel! EQU 0 (
set "dev=!dev::=!""
!adb! shell "dd if=/dev/mtd/!dev! of=/data/local/boot/boot.img bs=4096"
set /a success=1
goto :done_backup_boot
)
)
:done_backup_boot
if !success! EQU 1 (
!adb! pull /data/local/boot/boot.img C:\boot.img
)
endlocal & exit
FYI: Haven't tested it. It's on you to fix bugs if given.
boissano said:
I should have asked how can I extract the boot.img from the device ?
Click to expand...
Click to collapse
By using SP Flash tool...
boissano said:
So How do I go about getting root on this device ...?
Click to expand...
Click to collapse
Android is rooted when the SU-binary is present in Android OS. Because in your case you can't access Android's /system partition ( means: mount /system partition as RW), you have to put SU-binary into non-system-critical /data partition - for example into /data/superuser , and afterwards give this binary the necessary rights via chmod and chown commands.
CXZa said:
By using SP Flash tool...
Click to expand...
Click to collapse
Without root which is the final aim, SP Flash tool does not access the firmware, it is only OK to flash a cooked boot.img
jwoegerbauer said:
You for example run a DOS script like this
Code:
@echo off & setlocal ENABLEDELAYEDEXPANSION
set "adb=C:\ADB-FASTBOOT-R30\adb.exe"
set "dev=" & set "name=" & set /a success=0
!adb! devices
!adb! shell "mkdir -p -m755 /data/local/boot"
for /f "tokens=1,4 delims= " %%a in ('!adb shell "cat proc/mtd"') do (
set "dev=%%a" & set "name=%%b"
echo !name! | findstr /C:"boot" >nul
if !errorlevel! EQU 0 (
set "dev=!dev::=!""
!adb! shell "dd if=/dev/mtd/!dev! of=/data/local/boot/boot.img bs=4096"
set /a success=1
goto :done_backup_boot
)
)
:done_backup_boot
if !success! EQU 1 (
!adb! pull /data/local/boot/boot.img C:\boot.img
)
endlocal & exit
FYI: Haven't tested it. It's on you to fix bugs if given.
Click to expand...
Click to collapse
Something along these lines looks to be the best way, it looks daunting but not much worse than rooting an HTC 10 years ago. Next time I will get wifey an easily rootable tablet with 4GB of ram to start. She plays games designed by **** developers where ram requirements increase with every update currently at 95% of total.
jwoegerbauer said:
Android is rooted when the SU-binary is present in Android OS. Because in your case you can't access Android's /system partition ( means: mount /system partition as RW), you have to put SU-binary into non-system-critical /data partition - for example into /data/superuser , and afterwards give this binary the necessary rights via chmod and chown commands.
Click to expand...
Click to collapse
Thanks ,will check this out too!
boissano said:
Without root which is the final aim, SP Flash tool does not access the firmware, it is only OK to flash a cooked boot.img
Click to expand...
Click to collapse
Okay, have fun!
Hello,
I received a BV9900E a few days ago. it's a nice Rugged phone.
But... I would like to put a custom launcher with custom widgets and custom animated wallpaper. But if I shut down the phone, I lost all my settings, the widgets and wallpaper. All must be reinstalled, and/or reconfigured.
I try to use whiteliste, did several tries and try various solutions found on the net but nothing helped ... I lose everything on each restart. Only stock widgets work.
I think I have found the beginning of an explanation here: https://bbs.blackview.hk/viewtopic.php?t=532725
But for edit Build.prop, i have to root the phone.
I am not an expert for rooting phone and try like on the Blackview topic, but i don't find BV9900E/Android 10 specific stock ROM for now.
I only can find the BV9900E_S1_200929 rom and not the BV9900E_EEA_S900AA.
I try to root with the BV9900E_S1_200929 rom, Adb, magisk, but nothing happend.
Any solution is welcome !
Thank you in advance for your answers.
Modèle : BV9900E
System : Android 10
Num serie : BV9900EQEE002138
Build : BV9900E_EEA_S900AA_V1.0_20201103V04
Rooting a phone's Android doesn't require to re-flash phone's Stock ROM. A phone's Android is rooted when su binary got installed on it.
To prepare rooting you have to
Unlock phone's bootloader
Disable Android's DM-Verity & AVB locks
Flash a Custom Recovery like TWRP what is at 100% suitable to phone
To root Android you have to
Flash by means of this Custom Recovery SuperSU.zip or similar
Ok, thank's jwoegerbauer...
Unlock bootloader is ok. but impossible To disable DM-Verity and there is no TWRP for the BV9900E yet...
And i don't know, it's very strange because i can't mount system when i am on recovery mode for example.
Blackview has only one answer: It's not possible to do that.
I am not an expert with the handling of phones but I am not quite bad with technology either. I already had 2 phones that I ended up rooting but there, I do not succeed. I may have to wait a bit because this phone is brand new, the solutions may come from someone more expert than me.
Disabling Android's SElinux, DM-Verity & AVB is achieved by running specific ADB / Fastboot commands.
Mouning /system RW requires Android is rooted
Compile TWRP at your own if none matching available.
Ok, that sounds simple to you.
But when I search the internet there are thousands of answers that go in all directions ... It is not so easy for the uninitiated like me.
Do you have some links for illustrate what you say?
To disable the mentioned 3 locks you may consider to run a Windows CMD script like this draft
Code:
@echo off & setlocal ENABLEDELAYEDEXPANSION
pushd "%~dp0"
set "adb=C:\ADB-FASTBOOT-R30\adb.exe"
set "fastboot=C:\ADB-FASTBOOT-R30\fastboot.exe"
set "su=C:\SU-Binary\su"
set "tmpdir=%TEMP%\%RANDOM%%RANDOM%"
set "su_binary_location=/data/local/superuser"
set "su_tmp=!su_binary_location!/su"
set /a cnt=0"
mkdir "!tmpdir!" 2>nul
if NOT exist "!tmpdir!\" ( goto :end )
set "dev=" & set "name="
!adb! devices
!adb! shell stop
call :install_temporary_root
!adb! shell "mkdir -p -m0666 /data/local/vbmeta"
for /f "tokens=1,4 delims= " %%a in ('!adb shell "!su_tmp! -c 'cat proc/mtd'"') do (
set "dev=%%a" & set "name=%%b"
echo !name! | findstr /C:"vbmeta" >nul
if !errorlevel! EQU 0 (
set "dev=!dev::=!""
!adb! shell "!su_tmp! -c 'dd if=/dev/mtd/!dev! of=/data/local/vbmeta/!name! bs=4096'"
!adb! pull /data/local/vbmeta/!name! "!tmpdir!"
set /a cnt+=1
)
)
!adb! shell "rm -Rf /data/local/vbmeta"
if !cnt! EQU 0 ( goto :end )
!adb! shell "!su_tmp! -c 'setenforce 0'"
!adb! reboot fastboot
!fastboot! devices
for /f "tokens=*" %%a in ('dir /B "!tmpdir!"') do (
set "vbmeta_img=%%a"
if NOT [!vbmeta_img!]==[] (
set "vbmeta_partition=!vbmeta_img:.img=!"
!fastboot! --disable-verity --disable-verification flash !vbmeta_partition! "!tmpdir!\!vbmeta_img!"
)
)
!fastboot! reboot
:end
rmdir /S /Q "!tmpdir!" 2>nul
!adb! shell start
popd
endlocal & exit
rem
:install_temporary_root
!adb! shell "mkdir -p -m0755 !su_binary_location!" 2>nul >nul
!adb! push !su! !su_binary_location! > nul
!adb! shell "chmod 0777 !su_tmp!"
!adb! shell "chown 0.2000 !su_tmp!"
goto :EOF
where you of course have to adjust the pathname of ADB & Fastboot executables and the SU-binary
FYI: Have not tested such a script, it's on you to fix bugs if any given.
With regards to compile a TWRP at your own:
look inside here.
I also bought a bv9900e and have managed to unlock the bootloader, as guided here : LINK
Can i get some help with compiling TWRP ?