[Tutorial] Creating adb script to flash ROM - Sony Xperia L

Dear all
I know there are numbers of you who want to start developing for our XL. There are numbers of way to flashROM. Either you can flash your ROM via system.img or ROM.zip etc etc. And here are we to explore creating rom via adb script. The earlier two ROM flashing mean require you to have unlocked bootloader but adb script ROM can be flashed on L/UL mobile devices. Lets get started with:
NOTE: The phone needs to be rooted to flash adb script. For your assistance I will attach a ROM template along with this post.
Click to expand...
Click to collapse
Preparation
Please create two folders inside your working folder with name [Your ROM Name] and [Your ROM Name_PC].
Copy all your system files/folder inside your [Your ROM Name] folder.
Please avoid creating folder within folder to avoid confusion. For example: if you are adding ringtones in your ROM consider creating folder inside [Your ROM Name] with name ringtones instead of creating folder structure like media/audio/ringtones.
In [Your ROM Name_PC] folder create a folder with name adb and copy adb.exe, AdbWinApi.dll and AdbWinUsbApi.dll inside it from your android sdk. If you are using my template then you can skip this step as i have already included adb folder inside [Your ROM Name_PC]
Scripting ADB Flasher
1. Create a new text file and rename it as Setup.bat. Remember to remove .txt extension and replace it with .bat extension.
Right Click on Setup.bat and click Edit. The file will open in notepad.
2. Copy Following lines of Code and paste it in your Setup.bat file.
HTML:
[user=279333]@ECHO[/user] off
TITLE [YOUR ROM NAME] by [Dev_Name] [Version 1.0]
COLOR 70
mode con:cols=100 lines=40
ECHO.
Pause
ECHO Waiting For Device.....
[user=302893]@adb[/user]\adb wait-for-device
[user=302893]@adb[/user]\adb shell "su -c 'stop'"
ECHO Getting System access.....
[user=302893]@adb[/user]\adb shell "su -c 'mount -o rw,remount /system/ /system/'"
This will mount system folder with read write privilege.
3. Before flashing your apks and other stuff you need to make sure you remove corresponding stuffs from the system. I have listed generic folders inside the code below please add/delete lines as per your application preferences.
HTML:
ECHO Removing system files
[user=302893]@adb[/user]\adb shell "su -c 'rm /system/app/*.odex'"
[user=302893]@adb[/user]\adb shell "su -c 'rm /system/app/*.apk'"
[user=302893]@adb[/user]\adb shell "su -c 'rm /system/fonts/*.ttf'"
[user=302893]@adb[/user]\adb shell "su -c 'rm /system/framework/*.jar'"
[user=302893]@adb[/user]\adb shell "su -c 'rm /system/framework/*.apk'"
[user=302893]@adb[/user]\adb shell "su -c 'rm /system/framework/*.odex'"
[user=302893]@adb[/user]\adb shell "su -c 'rm /system/media/audio/ringtones/*.ogg'"
[user=302893]@adb[/user]\adb shell "su -c 'rm /system/media/audio/alarms/*.ogg'"
[user=302893]@adb[/user]\adb shell "su -c 'rm /system/media/audio/notifications/*.ogg'"
[user=302893]@adb[/user]\adb shell "su -c 'rm /system/media/audio/ui/*.ogg'"
ECHO System files removed successfully!
ECHO.
4. Copy each and every content of each folder you want to flash in corresponding folders of the system. Below is the sample code please consider adding/deleting as per your preferences.
HTML:
ECHO COPYING FILES.....
[user=302893]@adb[/user]\adb shell "su -c 'cp /sdcard/[Your ROM Name]/framework/* /system/framework/'"
[user=302893]@adb[/user]\adb shell "su -c 'cp /sdcard/[Your ROM Name]/app/* /system/app/'"
[user=302893]@adb[/user]\adb shell "su -c 'cp /sdcard/[Your ROM Name]/fonts/* /system/fonts/'"
[user=302893]@adb[/user]\adb shell "su -c 'cp /sdcard/[Your ROM Name]/media/* /system/media/'"
[user=302893]@adb[/user]\adb shell "su -c 'cp /sdcard/[Your ROM Name]/ringtones/* /system/media/audio/ringtones/'"
[user=302893]@adb[/user]\adb shell "su -c 'cp /sdcard/[Your ROM Name]/alarms/* /system/media/audio/alarms/'"
[user=302893]@adb[/user]\adb shell "su -c 'cp /sdcard/[Your ROM Name]/notifications/* /system/media/audio/notifications/'"
[user=302893]@adb[/user]\adb shell "su -c 'cp /sdcard/[Your ROM Name]/ui/* /system/media/audio/ui/'"
5. After you have copied all your files/folders into the system you need to add permission in case of framework and apps and any other folders requiring special permission. Below is the sample code please consider adding/deleting as per your preferences.
HTML:
ECHO SETTING PERMISSION.....
[user=302893]@adb[/user]\adb shell "su -c 'chown 0.0 /system/framework/*.jar'"
[user=302893]@adb[/user]\adb shell "su -c 'chmod 0644 /system/framework/*.jar'"
[user=302893]@adb[/user]\adb shell "su -c 'chown 0.0 /system/framework/*.apk'"
[user=302893]@adb[/user]\adb shell "su -c 'chmod 0644 /system/framework/*.apk'"
[user=302893]@adb[/user]\adb shell "su -c 'chown 0.0 /system/app/*.apk'"
[user=302893]@adb[/user]\adb shell "su -c 'chmod 0644 /system/app/*.apk'"
6. We are almost done now. Please consider copying following codes and adding them at the end of your script to remount system as read-only and rebooting the mobile device.
HTML:
ECHO.
ECHO --------------------------------------------------------
ECHO ----------ROM INSTALLED SUCCESSFULLY------------
ECHO --------------------------------------------------------
ECHO.
[user=302893]@adb[/user]\adb shell "su -c 'mount -o ro,remount /system/ /system/'"
ECHO Rebooting System
[user=302893]@adb[/user]\adb reboot
ECHO.
ECHO Please be patient till device reboot!
ECHO.
ECHO.
ECHO --------------------------------------------------------
ECHO -----------------------THANK YOU------------------------
ECHO --------------------------------------------------------
ECHO.
pause
7. Now zip both [Your ROM Name] and [Your ROM Name_PC] folders and upload them to the file sharing sites of your convenience.
If all goes well you will have a superb ROM to share here at XDA. Please find the attached template along with this post.
If you like this tutorial please press thanx at the bottom of the post.
Have a happy time porting.
CREDITS will be highly appreciated.

Related

no_sense v1 w/ JIT Enabler: Script to remove Sense and auto-enable JIT on FreshToast

So... I don't know how to make ROMs, or update.zips.... but I can make batch files!! HAHA
Basically, all this does is help noobies out by doing everything for you.
This is intended for use with FreshToast, but should work with any ROM really (JIT functionality depends on if the ROM supports it and editing the build.prop file, read below)
{
"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"
}
What it does
JIT does NOT like Sense UI. You basically can't use Sense UI with JIT... so this will remove Sense UI then enable JIT.
You can read about JIT here: http://en.wikipedia.org/wiki/Just-in-time_compilation
This will remove all HTC Widgets, Rosie, and any other useless SenseUI applications. (as they don't work with other launchers) and push over the Helix Launcher. Also, this will enable JIT (there is an option to enable or not to, as well as automated enable/disable JIT)
I have also included the HTC Ringtone trimmer apk - its honestly the best ringtone trimmer I've used, and works great, alot of devs take it out. I dont know why.
Also Ive included the genie news and weather widget.
I get no force closes with this method from removing sense, but as with most roms with JIT enabled, there is the occasional freeze.
As always, DO A NANDROID BACKUP FIRST!!!
The build.prop file is ROM SPECIFIC!!
The script has the build.prop for FRESHTOAST 1.1
I'm working on getting multiple build.prop's from other ROMs so you will only have to make a simple menu selection.
If you are using a different ROM do the following:
adb pull /system/build.prop C:/system.prop_jit
edit the file in WORDPAD (not notepad) and save as build.prop_jit in the "Unicode Text Format"
Go to the very last line of the file, and add the following line:
Code:
dalvik.vm.execution-mode=int:jit
Save the file as build.prop to the location you extracted the zip (no_sense.zip) to and overwrite the old one.
The rest remains the same.
Special thanks to regaw_leinad for the help with the script. THANK YOU!! also thanks to Jus10o for helping me with the force closes I was getting after removing sense. Thanks also to "gunnyman" for the hosting of the file!
Instructions:
First thing is something some of you may already have done. This will enable adb to be run in the DOS command line from anywhere, not just your android tools folder.
Right click on "My Computer"
Click Properties
Click the advanced tab
Click "Environment Variables"
In the top window click "PATH"
Click "Edit"
Change the "Variable Value" to your android SDK tools folder (Mine is C:\Android\tools)
Now unzip the no_sense folder anywhere you want.
Connect your phone via USB and make sure you DO NOT have the phone in disk mode, select "Charge Only" and ensure the phone has USB-Debugging on (should be by default)
Double click on "no_sense.bat" and follow the prompts.
The first time you enable JIT it will create a backup of your old files, and can be restored/disabled later.
NOTICE You MUST change your home screen wall paper to a non-htc wallpaper before enabling JIT. If not, your phone will freeze on boot. Any photo will do, as long as it is not a HTC wallpaper. I'm looking in to how to prevent this from happening. If you accidentally booted without changing, just nandroid back and do it again. After stripping the ROM of Sense UI, and starting Helix, change your wallpaper, THEN enable JIT.
Currently v1.2
Download Here: http://dl.dropbox.com/u/6718465/no_sense_with_apks.zip 9.40MB (Includes all the backed up Rosie APKs)
Without APKs: http://dl.dropbox.com/u/6718465/no_sense.zip 1.75MB
I'm curious to try it on the new ZenExp ROM. Helix launcher already works great with it.
Well the Sense UI strip part works....
Having some trouble with the JIT part...
I guess some commands can't be done though ADB Shell
are you using ADB to execute a script? if so make sure you chmod that script. adb shell chmod 755 /sdcard/nameofscript should do the trick.
gunnyman said:
are you using ADB to execute a script? if so make sure you chmod that script. adb shell chmod 755 /sdcard/nameofscript should do the trick.
Click to expand...
Click to collapse
I think it's a .bat file to run on the computer w/ your phone plugged in.
poor_red_neck said:
Well the Sense UI strip part works....
Having some trouble with the JIT part...
I guess some commands can't be done though ADB Shell
Click to expand...
Click to collapse
can you send me the script, I'll take a look at it and see whats goin on.
When I saw the howto for enabling JIT I wrote a script that would execute the list of shell commands. All I had to do was edit build prop manually then execute the script. I also wrote an undo script. I can easily redo it for you if it will help.
This is an excellent contribution. Thanks. I see many firsts much less worthy of posting(aka-why is this posteds) Also, damage put dcconfig.apk in the new .08 rom which allows for you to enable/disable jit and many other options from within a checkbox.
Ah, Found the issue...
I'm doing everything through adb shell xxxcommandxxx for JIT...
However I dont know how to get SU through the shell...
Here's part of it Ive stripped out.
Code:
@ECHO OFF
adb remount
adb shell mkdir /sdcard/JIT
adb shell mkdir /sdcard/dalbk
adb shell mkdir /sdcard/JIT/bin
adb push libdvm.so /sdcard/JIT/libdvm.so
adb push libnativehelper.so /sdcard/JIT/libnativehelper.so
adb push dalvikvm /sdcard/JIT/bin/dalvikvm
adb pull /system/build.prop build.prop_backup
adb push build.prop_JIT /system/build.prop
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system
adb shell cp /system/build.prop /sdcard/dalbk/
adb shell cp /system/bin/dalvikvm /sdcard/dalbk/
adb shell cp /system/lib/libdvm.so /sdcard/dalbk/
adb shell cp /system/lib/libnativehelper.so /sdcard/dalbk
adb shell cd /sdcard/jit/bin
adb shell cp -f dalvikvm /system/bin
adb shell busybox chmod 755 /system/bin/dalvikvm
adb shell cd /sdcard/jit
adb shell cp -f libdvm.so /system/lib/
adb shell cp -f libnativehelper.so /system/lib/
adb shell cat.build.prop >/system/build.prop
adb shell chmod 644 /system/lib/libdvm.so
adb shell chmod 644 /system/lib/libnativehelper.so
adb shell chmod 666 /system/build.prop
adb shell sync
I get an error at trying to chmod 755 /system/bin/dalvikvm
do adb remount first.
Here's the full script if you're interested... again... the strip sense part works fine, JIT is giving me issues.
Code:
@Echo OFF
Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo º º
Echo º º
Echo º º
Echo º PLEASE ENSURE YOU HAVE CREATED A NANDROID BACKUP FIRST!!!! º
Echo º ALSO: Please ensure you have installed some sort of Home º
Echo º Launcher First. This script will install º
Echo º Helix launcher by default º
Echo º º
Echo º Also please ensure you have already installed º
Echo º A2SD º
Echo º º
Echo º Press 3 at the following option to skip º
Echo º to enabling/disabline JIT º
Echo º º
Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
SET /P ANSWER=Have you created a Nandroid Backup first? (1)Yes (2)No =
if /i {%ANSWER%}=={1} (goto :10)
if /i {%ANSWER%}=={2} (goto :20)
if /i {%ANSWER%}=={3} (goto :50)
:10
Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo º º
Echo º The script will now pull and backup your Sense/Rosie apks. º
Echo º They will be placed in the folder labeled "Rosie_Backup" º
Echo º In the "Root" directory of your PC(C:/Rosie_Backup º
Echo º º
Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
pause
adb remount
adb pull /system/app/Rosie.apk /Rosie_Backup/Rosie.apk
adb pull /system/app/HtcLockScreen.apk /Rosie_Backup/HtcLockScreen.apk
adb pull /system/app/com.android.launcher2.apk /Rosie_Backup/com.launcher2.apk
adb pull /system/app/com.htc.MusicWidget.apk /Rosie_Backup/com.htc.MusicWidget.apk
adb pull /system/app/com.htc.TwitterWidget.apk /Rosie_Backup/com.htc.TwitterWidget.apk
adb pull /system/app/com.htc.WeatherWidget.apk /Rosie_Backup/com.htc.WeatherWidget.apk
adb pull /system/app/HtcAddProgramWidget.apk /Rosie_Backup/HtcAddProgramWidget.apk
adb pull /system/app/htcmailwidgets.apk /Rosie_Backup/htcmailwidgets.apk
adb pull /system/app/htcmsgwidgets.apk /Rosie_Backup/htcmsgwidgets.apk
adb pull /system/app/HtcWeatherWallpaper.apk /Rosie_Backup/htcWeatherWallpaper.apk
adb pull /system/app/SetupWizard.apk /Rosie_Backup/SetupWizard.apk
Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo º º
Echo º Now we will install Helix Launcher º
Echo º to the /system/app folder º
Echo º and push other nescessary files º
Echo º as well as remove the non-essential º
Echo º HTC applications/Widgets º
Echo º º
Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
Echo You will get a force close on the phone, click force close
pause
adb push com.helixproject.launcher.apk /system/app/com.helixproject.launcher.apk
adb push GenieWidget.apk /system/app/GenieWidget.apk
adb push HtcRingtoneTrimmer.apk /system/app/HtcRingtoneTrimmer.apk
adb push com.htc.resources.apk /system/framework/com.htc.resources.apk
adb shell rm /system/app/Rosie.apk
adb shell rm /system/app/HtcLockScreen.apk
adb shell rm /system/app/com.android.launcher2.apk
adb shell rm /system/app/com.htc.MusicWidget.apk
adb shell rm /system/app/com.htc.TwitterWidget.apk
adb shell rm /system/app/com.htc.WeatherWidget.apk
adb shell rm /system/app/HtcAddProgramWidget.apk
adb shell rm /system/app/htcmailwidgets.apk
adb shell rm /system/app/htcmsgwidgets.apk
adb shell rm /system/app/HtcWeatherWallpaper.apk
adb shell rm /system/app/SetupWizard.apk
:50
Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo º º
Echo º Now we can enable JIT º
Echo º (Just In Time compiler) º
Echo º º
Echo º º
Echo º If you are unsure, please search on XDA Forums First º
Echo º º
Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
SET /P ANSWER=Would you like to enable/disable JIT? (1)Yes (2)No =
if /i {%ANSWER%}=={1} (goto :51)
if /i {%ANSWER%}=={2} (goto :100)
:51
SET /P ANDWER=Press 1 to enable JIT - Press 2 to disable JIT =
if /i {%ANSWER%}=={1} (goto :52)
if /i {%ANSWER%}=={2} (goto :53)
:52
adb remount
adb shell mkdir /sdcard/JIT
adb shell mkdir /sdcard/dalbk
adb shell mkdir /sdcard/JIT/bin
adb push libdvm.so /sdcard/JIT/libdvm.so
adb push libnativehelper.so /sdcard/JIT/libnativehelper.so
adb push dalvikvm /sdcard/JIT/bin/dalvikvm
adb pull /system/build.prop build.prop_backup
adb push build.prop_JIT /system/build.prop
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system
adb shell cp /system/build.prop /sdcard/dalbk/
adb shell cp /system/bin/dalvikvm /sdcard/dalbk/
adb shell cp /system/lib/libdvm.so /sdcard/dalbk/
adb shell cp /system/lib/libnativehelper.so /sdcard/dalbk
adb shell cd /sdcard/jit/bin
adb shell cp -f dalvikvm /system/bin
adb shell busybox chmod 755 /system/bin/dalvikvm
adb shell cd /sdcard/jit
adb shell cp -f libdvm.so /system/lib/
adb shell cp -f libnativehelper.so /system/lib/
adb shell cat.build.prop >/system/build.prop
adb shell chmod 644 /system/lib/libdvm.so
adb shell chmod 644 /system/lib/libnativehelper.so
adb shell chmod 666 /system/build.prop
adb shell sync
Echo The phone will now reboot...
adb reboot
:53
adb remount
adb shell cd /sdcard/dalbk/
adb shell cat build.prop >/system/build.prop
adb shell cp -f dalvikvm /system/bin
adb shell busybox chmod 755 /system/bin/dalvikvm
adb shell cp -f libdvm.so /system/lib/
adb shell cp -f libnativehelper.so /system/lib/
adb shell chmod 644 /system/lib/libdvm.so
adb shell chmod 644 /system/lib/libnativehelper.so
adb shell chmod 666 /system/build.prop
adb shell sync
ECHO Your phone will now reboot...
adb reboot
exit
:20
SET /P ANSWER=Would you like to reboot into recovery now to create one? (1)Yes (2)No =
if /i {%ANSWER%}=={1} (goto :101)
if /i {%ANSWER%}=={2} (goto :100)
:101
pause
Echo Your phone is now rebooting into recovery...
adb reboot recovery
exit
:100
pause
exit
I literally haven't messed with batch files since I was like... 12... soo.... haha.
poor_red_neck said:
Ah, Found the issue...
I'm doing everything through adb shell xxxcommandxxx for JIT...
However I dont know how to get SU through the shell...
Here's part of it Ive stripped out.
Code:
@ECHO OFF
adb remount
adb shell mkdir /sdcard/JIT
adb shell mkdir /sdcard/dalbk
adb shell mkdir /sdcard/JIT/bin
adb push libdvm.so /sdcard/JIT/libdvm.so
adb push libnativehelper.so /sdcard/JIT/libnativehelper.so
adb push dalvikvm /sdcard/JIT/bin/dalvikvm
adb pull /system/build.prop build.prop_backup
adb push build.prop_JIT /system/build.prop
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system
adb shell cp /system/build.prop /sdcard/dalbk/
adb shell cp /system/bin/dalvikvm /sdcard/dalbk/
adb shell cp /system/lib/libdvm.so /sdcard/dalbk/
adb shell cp /system/lib/libnativehelper.so /sdcard/dalbk
adb shell cd /sdcard/jit/bin
adb shell cp -f dalvikvm /system/bin
adb shell busybox chmod 755 /system/bin/dalvikvm
adb shell cd /sdcard/jit
adb shell cp -f libdvm.so /system/lib/
adb shell cp -f libnativehelper.so /system/lib/
adb shell cat.build.prop >/system/build.prop
adb shell chmod 644 /system/lib/libdvm.so
adb shell chmod 644 /system/lib/libnativehelper.so
adb shell chmod 666 /system/build.prop
adb shell sync
I get an error at trying to chmod 755 /system/bin/dalvikvm
Click to expand...
Click to collapse
try taking out "busybox", because if it is installed in the rom and symlinked you don't need to type that.
Now I get the following error:
cp: cannot stat 'dalvikvm': No such file or direcotry
cp: cannot stat 'libdvm.so': No such file or directory
cp: cannot stat 'libnativehelper.so': No such file or directory
The system cannot find the path specified.
poor_red_neck said:
Now I get the following error:
cp: cannot stat 'dalvikvm': No such file or direcotry
cp: cannot stat 'libdvm.so': No such file or directory
cp: cannot stat 'libnativehelper.so': No such file or directory
The system cannot find the path specified.
Click to expand...
Click to collapse
thats because you didn't define where to copy them from... where are you copying those from? put the path before the files
regaw_leinad said:
thats because you didn't define where to copy them from... where are you copying those from? put the path before the files
Click to expand...
Click to collapse
Ah hah...
Because I'm doing through the shell... the change directory command does nothing...
Gotcha..
Code:
@ECHO OFF
adb remount
adb shell mkdir /sdcard/jit
adb shell mkdir /sdcard/dalbk
adb shell mkdir /sdcard/JIT/bin
adb push libdvm.so /sdcard/JIT/libdvm.so
adb push libnativehelper.so /sdcard/JIT/libnativehelper.so
adb push dalvikvm /sdcard/JIT/bin/dalvikvm
adb pull /system/build.prop build.prop_backup
adb push build.prop_JIT /system/build.prop
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system
adb shell cp /system/build.prop /sdcard/dalbk/
adb shell cp /system/bin/dalvikvm /sdcard/dalbk/
adb shell cp /system/lib/libdvm.so /sdcard/dalbk/
adb shell cp /system/lib/libnativehelper.so /sdcard/dalbk
adb shell cp -f /sdcard/jit/bin/dalvikvm /system/bin
adb shell chmod 755 /system/bin/dalvikvm
adb shell cp -f /sdcard/jit/libdvm.so /system/lib/
adb shell cp -f /sdcard/jit/libnativehelper.so /system/lib/
adb shell cat build.prop >/system/build.prop
adb shell chmod 644 /system/lib/libdvm.so
adb shell chmod 644 /system/lib/libnativehelper.so
adb shell chmod 666 /system/build.prop
adb shell sync
Now the only error is:
"They system cannot find the path specified"
I have no idea what though, going to start taking one line off at a time.
EDIT:
adb shell cat.build.prop >/system/build.prop
This is causing the error.
poor_red_neck said:
Ah hah...
Because I'm doing through the shell... the change directory command does nothing...
Gotcha..
Code:
@ECHO OFF
adb remount
adb shell mkdir /sdcard/jit
adb shell mkdir /sdcard/dalbk
adb shell mkdir /sdcard/JIT/bin
adb push libdvm.so /sdcard/JIT/libdvm.so
adb push libnativehelper.so /sdcard/JIT/libnativehelper.so
adb push dalvikvm /sdcard/JIT/bin/dalvikvm
adb pull /system/build.prop build.prop_backup
adb push build.prop_JIT /system/build.prop
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system
adb shell cp /system/build.prop /sdcard/dalbk/
adb shell cp /system/bin/dalvikvm /sdcard/dalbk/
adb shell cp /system/lib/libdvm.so /sdcard/dalbk/
adb shell cp /system/lib/libnativehelper.so /sdcard/dalbk
adb shell cp -f /sdcard/jit/bin/dalvikvm /system/bin
adb shell chmod 755 /system/bin/dalvikvm
adb shell cp -f /sdcard/jit/libdvm.so /system/lib/
adb shell cp -f /sdcard/jit/libnativehelper.so /system/lib/
adb shell cat.build.prop >/system/build.prop
adb shell chmod 644 /system/lib/libdvm.so
adb shell chmod 644 /system/lib/libnativehelper.so
adb shell chmod 666 /system/build.prop
adb shell sync
Click to expand...
Click to collapse
yup that looks better
make sure you define everything like that, because, as you said, cd wont do anything when used in the shell in a bat
let me know if you have any more questions/problems. pm me your gtalk if you have one too.
poor_red_neck said:
Ah hah...
Because I'm doing through the shell... the change directory command does nothing...
Gotcha..
Code:
@ECHO OFF
adb remount
adb shell mkdir /sdcard/jit
adb shell mkdir /sdcard/dalbk
adb shell mkdir /sdcard/JIT/bin
adb push libdvm.so /sdcard/JIT/libdvm.so
adb push libnativehelper.so /sdcard/JIT/libnativehelper.so
adb push dalvikvm /sdcard/JIT/bin/dalvikvm
adb pull /system/build.prop build.prop_backup
adb push build.prop_JIT /system/build.prop
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system
adb shell cp /system/build.prop /sdcard/dalbk/
adb shell cp /system/bin/dalvikvm /sdcard/dalbk/
adb shell cp /system/lib/libdvm.so /sdcard/dalbk/
adb shell cp /system/lib/libnativehelper.so /sdcard/dalbk
adb shell cp -f /sdcard/jit/bin/dalvikvm /system/bin
adb shell chmod 755 /system/bin/dalvikvm
adb shell cp -f /sdcard/jit/libdvm.so /system/lib/
adb shell cp -f /sdcard/jit/libnativehelper.so /system/lib/
adb shell cat.build.prop >/system/build.prop
adb shell chmod 644 /system/lib/libdvm.so
adb shell chmod 644 /system/lib/libnativehelper.so
adb shell chmod 666 /system/build.prop
adb shell sync
Now the only error is:
"They system cannot find the path specified"
I have no idea what though, going to start taking one line off at a time.
Click to expand...
Click to collapse
just copy paste "pause" between the lines.. its quicker that way, and you can see where it fails.
poor_red_neck said:
Ah hah...
adb shell cat.build.prop >/system/build.prop
This is causing the error.
Click to expand...
Click to collapse
this should be
Code:
adb shell cat build.prop >/system/build.prop
no period between cat and build
EDIT:
AND you need to specify the path of the first build.prop, because what that is doing is combining the two build.props
regaw_leinad said:
this should be
Code:
adb shell cat build.prop >/system/build.prop
no period between cat and build
EDIT:
AND you need to specify the path of the first build.prop, because what that is doing is combining the two build.props
Click to expand...
Click to collapse
I JUST found that....
should be /sdcard/jit/build.prop
Let me try that.
Hmm, there is no build.prop that is placed in the /sdcard/jit folder.
The original code is here:
This will enable jit on your phone.
Code:
cd /sdcard/jit/bin
cp -f dalvikvm /system/bin/
busybox chmod 755 /system/bin/dalvikvm
cd /sdcard/jit
cp -f libdvm.so /system/lib/
cp -f libnativehelper.so /system/lib/
cat build.prop >/system/build.prop
chmod 644 /system/lib/libdvm.so
chmod 644 /system/lib/libnativehelper.so
chmod 666 /system/build.prop
sync
reboot
Judging by the last cd... there should be one in /sdcard/jit

[Q] Updater-script code

Can someone convert this adb shell code in an updater-script code?
Code:
@files\adb shell "su -c 'busybox mount -o remount,rw /system'"
@files\adb shell "su -c 'busybox mount | grep system'"
@files\adb shell "su -c 'chmod 0777 /system/etc/install-recovery.sh'"
@files\adb shell "su -c 'chown root.shell /system/etc/install-recovery.sh'"
@files\adb shell "su -c 'chmod 0755 /system/bin/sysinit'"
@files\adb shell "su -c 'chown root.shell /system/bin/sysinit'"
@files\adb shell "su -c 'chmod 0777 /system/xbin/run-parts'"
@files\adb shell "su -c 'chown root.shell /system/xbin/run-parts'"
@files\adb shell "su -c 'chmod 0777 /system/etc/init.d/'"
@files\adb shell "su -c 'chmod 0777 /system/etc/init.d/*'"
@files\adb shell "su -c 'chown root.root /system/etc/init.d/'"
mount("(the file system for /system. ie: ext3, ext4, fat)", "(Probably EMMC)", "/dev/block/(the block name for your partition)", "/system");
/system/etc/install-recovery.sh
set_perm(0, 2000, 06777, "/system/etc/install-recovery.sh");
Yada, yada, yada.
The main reason I'm not doing this for you is because it seems specific to a certian issue and I think you should do the research to get it right. Either that of risk screwing something up bad.
About making an edify script. What you are trying to do/
A nice read on linux permissions Check the lower half about setting UID and GID. Nicely done.

[ROOT] Tianji X720D

Hi guys,
first of all, I'm noob on Android, plus I'm Italian, my english is not really good, I apologize for that.
I searched a lot, but I found nothing on this forum about this smartphone, nor on google.
I searched for Haipai X720D, ONE XC, HTC EVO 4G, any X720D related, but for various reasons nothing really satisfied me.. are they really compatible with my phone? Probably, but I doubt that. Benchmarks are quite different (build, brand, different antutu scores...).
So, just to let people know it is possible, "hey, it just worked! don't be afraid, I did that", I wrote this little guide.
1) I have Windows 8 Pro
If you have an older Windows release, it is possible you are going to have more trouble, as always.
2) Drivers -> You need to install "Android Composite ADB Interface"
For me it was a big problem, because you can't find any driver around, no real "Tianji" website to find some kind of support or update.
I was relying on this guide (HERE related to "unrevoked" tool, but I found out their modified drivers to be just crappy and I couldn't install due to some checksum problem they have. Still, this link is a good guide about "how to" install the right driver.
I hoped to find something on google with ID_Hardware "USB\VID_0BB4&PID_0C03&REV_0255&MI_01", but I didn't find anything to download, just a couple of "driver update" services who really had something, but pretended to install software on your PC.
Tired of wasting my time, I decided to try "driver identifier" website because they offer a free service for 1 day, just what I needed. (I don't know if I can post link here, so if you need it, just use google). It worked and now I've a ZIP ready to install just following instructions in "unrevoked" guide.
3) Root tool
Thanks to Bin4ry on xda-developers forum for his great script. You can find it on this thread: sorry guy, I can't write on your thread due to xda-developer policies, I hope you understand.
You need to choose method 1: Normal method.
This script allows you to rollback, so if something goes wrong, just launch tha batch again and select Rollback option.
But, you know, nothing is perfect, and his batch script is still a little :victory: crappy :victory: to work with this smartphone: You need to reboot your device a couple of times, but it doesnt wait for your device to resume, it just runs in timeout and because of that, it does a lot of crappy things.
You need to modify RUNME.BAT file like that:
Code:
@echo off
COLOR 0A
echo ======================================================================
echo = This script will root your Android phone with adb restore function =
echo = Script by Bin4ry (thanks to Goroh_kun and tkymgr for the idea) =
echo = Idea for Tablet S from Fi01_IS01 =
echo = (22.11.2012) v17 =
echo ======================================================================
echo Tianji === NORMAL mode
echo.
:CHOICE
set nxt=0
set ric=0
echo Device type:
echo 1) Normal
echo 2) Special (for example: Sony Tablet S, Medion Lifetab)
echo.
echo x) Unroot
echo.
set /p type=Make a choice:
if %type% == 1 GOTO TEST
if %type% == 2 GOTO TABSMENU
if %type% == x GOTO UNROOT
echo.
echo Please Enter a valid number (1 to x)
echo.
GOTO CHOICE
:TEST
echo Checking if i should run in Normal Mode or special Sony Mode
echo Please connect your device with USB-Debugging enabled now
stuff\adb.exe wait-for-device
stuff\adb.exe pull /system/app/Backup-Restore.apk . > NUL
stuff\adb.exe pull /system/bin/ric . > NUL
if EXIST ric (set ric=1) else (echo .)
if EXIST Backup-Restore.apk (GOTO XPS) else (echo .)
GOTO OTHER
:UNROOT
set /p unr=Really (y/n) ?
IF %unr% == n GOTO CHOICE
stuff\adb.exe push stuff\busybox /data/local/tmp/busybox
stuff\adb.exe shell "chmod 755 /data/local/tmp/busybox"
stuff\adb.exe shell "su -c '/data/local/tmp/busybox mount -o remount,rw /system'"
stuff\adb.exe shell "su -c 'rm /system/bin/su'"
stuff\adb.exe shell "su -c 'rm /system/app/Superuser.apk'"
GOTO FINISH
:TABSMENU
echo.
echo Special mode:
echo 1) Root
echo 2) Rollback
set /p tabtype=Make a choice:
if %tabtype% == 1 GOTO TABS
if %tabtype% == 2 GOTO TABS_RB
:TABS
echo.
echo Tablet S mode enabled!
echo.
GOTO START
:XPS
echo.
echo Found Sony Backup-Restore.apk
echo LT26,LT22 etc. mode enabled!
echo.
del Backup-Restore.apk
if %ric% == 1 (del ric) else (echo .)
set NXT=1
GOTO START
:TABS_RB
echo.
echo Tablet S Roll Back
echo.
echo Please connect device with ADB-Debugging enabled now....
stuff\adb.exe wait-for-device
FOR /F "tokens=1 delims=" %%A in ('stuff\adb.exe shell "if [ -d /data/app- ]; then echo 1 ; else echo 0 ; fi"') do SET tabs_app=%%A
if %tabs_app% == 1 GOTO TABS_RB_1
if %tabs_app% == 0 GOTO TABS_RB_2
:TABS_RB_1
stuff\adb.exe shell "rm -r /data/data/com.android.settings/a/*"
stuff\adb.exe restore stuff/tabletS.ab
echo Please look at your device and click "Restore my data"
echo.
stuff\adb.exe shell "while [ ! -d /data/data/com.android.settings/a/file99 ] ; do echo 1; done" > NUL
echo 1st RESTORE OK, hit ENTER to continue.
pause
stuff\adb.exe shell "rm -r /data/data/com.android.settings/a"
stuff\adb.exe restore stuff/tabletS.ab
echo Please look at your device and click "Restore my data"
echo.
stuff\adb.exe shell "while : ; do ln -s /data /data/data/com.android.settings/a/file99; [ -f /data/file99 ] && exit; done" > NUL
stuff\adb.exe shell "rm -r /data/file99"
echo Achieved! hit ENTER to continue.
echo.
pause
stuff\adb.exe shell "mv /data/system /data/system3"
stuff\adb.exe shell "mv /data/system- /data/system"
stuff\adb.exe shell "mv /data/app /data/app3"
stuff\adb.exe shell "mv /data/app- /data/app"
echo "Roll back compelted."
GOTO FINISH
:TABS_RB_2
echo.
echo.
echo "Roll back failed. /data/app- not found."
echo.
echo.
GOTO FINISH
:eek:THER
echo.
echo Normal Mode enabled!
if %ric% == 1 (del ric) else (echo .)
echo.
:START
stuff\adb.exe wait-for-device
IF %type% == 2 GOTO TABTRICK
echo Pushing busybox....
stuff\adb.exe push stuff/busybox /data/local/tmp/.
echo Pushing su binary ....
stuff\adb.exe push stuff/su /data/local/tmp/.
echo Pushing Superuser app
stuff\adb.exe push stuff/Superuser.apk /data/local/tmp/.
echo Making busybox runable ...
stuff\adb.exe shell chmod 755 /data/local/tmp/busybox
if %ric% == 1 (stuff\adb.exe push stuff/ric /data/local/tmp/ric) else (echo .)
IF %nxt% == 1 GOTO XPSTRICK
stuff\adb.exe restore stuff/fakebackup.ab
echo Please look at your device and click RESTORE!
echo If all is successful i will tell you, if not this shell will run forever.
echo Running ...
stuff\adb.exe shell "while ! ln -s /data/local.prop /data/data/com.android.settings/a/file99; do :; done" > NUL
echo Successful, going to reboot your device in 10 seconds!
ping -n 10 127.0.0.1 > NUL
stuff\adb.exe reboot
echo Waiting for device to show up again....
pause
ping -n 10 127.0.0.1 > NUL
stuff\adb.exe wait-for-device
GOTO NORMAL
:TABTRICK
stuff\adb.exe install -s stuff/Term.apk
stuff\adb.exe push stuff/busybox /data/local/tmp/.
stuff\adb.exe push stuff/su /data/local/tmp/.
stuff\adb.exe push stuff/Superuser.apk /data/local/tmp/.
stuff\adb.exe push stuff/rootkittablet.tar.gz /data/local/tmp/rootkittablet.tar.gz
stuff\adb.exe shell "chmod 755 /data/local/tmp/busybox"
stuff\adb.exe shell "/data/local/tmp/busybox tar -C /data/local/tmp -x -v -f /data/local/tmp/rootkittablet.tar.gz"
stuff\adb.exe shell "chmod 644 /data/local/tmp/VpnFaker.apk"
stuff\adb.exe shell "touch -t 1346025600 /data/local/tmp/VpnFaker.apk"
stuff\adb.exe shell "chmod 755 /data/local/tmp/_su"
stuff\adb.exe shell "chmod 755 /data/local/tmp/su"
stuff\adb.exe shell "chmod 755 /data/local/tmp/onload.sh"
stuff\adb.exe shell "chmod 755 /data/local/tmp/onload2.sh"
stuff\adb.exe shell "rm -r /data/data/com.android.settings/a/*"
stuff\adb.exe restore stuff/tabletS.ab
echo Please look at your device and click "Restore my data"
echo.
stuff\adb.exe shell "while [ ! -d /data/data/com.android.settings/a/file99 ] ; do echo 1; done" > NUL
ping -n 3 127.0.0.1 > NUL
echo 1st RESTORE OK, hit ENTER to continue.
pause
stuff\adb.exe shell "rm -r /data/data/com.android.settings/a"
stuff\adb.exe restore stuff/tabletS.ab
echo Please look at your device and click "Restore my data"
echo.
stuff\adb.exe shell "while : ; do ln -s /data /data/data/com.android.settings/a/file99; [ -f /data/file99 ] && exit; done" > NUL
stuff\adb.exe shell "rm -r /data/file99"
ping -n 3 127.0.0.1 > NUL
echo Achieved! hit ENTER to continue.
echo.
pause
stuff\adb.exe shell "/data/local/tmp/busybox cp -r /data/system /data/system2"
stuff\adb.exe shell "/data/local/tmp/busybox find /data/system2 -type f -exec chmod 666 {} \;"
stuff\adb.exe shell "/data/local/tmp/busybox find /data/system2 -type d -exec chmod 777 {} \;"
stuff\adb.exe shell "mv /data/system /data/system-"
stuff\adb.exe shell "mv /data/system2 /data/system"
stuff\adb.exe shell "mv /data/app /data/app-"
stuff\adb.exe shell "mkdir /data/app"
stuff\adb.exe shell "mv /data/local/tmp/VpnFaker.apk /data/app"
stuff\adb.exe shell "/data/local/tmp/busybox sed -f /data/local/tmp/packages.xml.sed /data/system-/packages.xml > /data/system/packages.xml"
stuff\adb.exe shell "sync; sync; sync"
echo Need to reboot now!
stuff\adb.exe reboot
ping -n 3 127.0.0.1 > NUL
echo Waiting for device to come up again....
pause
stuff\adb.exe wait-for-device
echo Unlock your device, a Terminal will show now, type this 2 lines, after each line press ENTER
echo /data/local/tmp/onload.sh
echo /data/local/tmp/onload2.sh
echo after this is done press a key here in this shell to continue!
echo If the shell on your device does not show please re-start the process!
stuff\adb.exe shell "am start -n com.android.vpndialogs/.Term"
pause
GOTO TABTRICK1
:TABTRICK1
stuff\adb.exe push stuff/script1.sh /data/local/tmp/.
stuff\adb.exe shell "chmod 755 /data/local/tmp/script1.sh"
stuff\adb.exe shell "/data/local/tmp/script1.sh"
echo Almost complete! Reboot and cleanup.
stuff\adb.exe reboot
ping -n 3 127.0.0.1 > NUL
echo Waiting for device to come up again....
pause
stuff\adb.exe wait-for-device
stuff\adb.exe shell "su -c 'rm -r /data/app2'"
stuff\adb.exe shell "su -c 'rm -r /data/system2'"
stuff\adb.exe shell "su -c 'rm -r /data/local/tmp/*'"
GOTO FINISH
:XPSTRICK
set %NXT%=0
echo Pushing fake Backup
stuff\adb.exe push stuff\RootMe.tar /data/local/tmp/RootMe.tar
stuff\adb.exe shell "mkdir /mnt/sdcard/.semc-fullbackup > /dev/null 2>&1"
echo Extracting fakebackup on device ...
stuff\adb.exe shell "cd /mnt/sdcard/.semc-fullbackup/; /data/local/tmp/busybox tar xf /data/local/tmp/RootMe.tar"
echo Watch now your device. Select the backup named RootMe and restore it!
stuff\adb.exe shell "am start com.sonyericsson.vendor.backuprestore/.ui.BackupActivity"
echo If all is successful i will tell you, if not this shell will run forever.
echo Running ......
stuff\adb.exe shell "while ! ln -s /data/local.prop /data/data/com.android.settings/a/file99; do :; done" > NUL
echo.
echo Good, it worked! Now we are rebooting soon, please be patient!
ping -n 3 127.0.0.1 > NUL
stuff\adb.exe shell "rm -r /mnt/sdcard/.semc-fullbackup/RootMe"
stuff\adb.exe reboot
ping -n 10 127.0.0.1 > NUL
echo Waiting for device to come up again....
pause
stuff\adb.exe wait-for-device
:NORMAL
IF %ric% == 1 GOTO RICSTUFF
echo Going to copy files to it's place
stuff\adb.exe shell "/data/local/tmp/busybox mount -o remount,rw /system && /data/local/tmp/busybox mv /data/local/tmp/su /system/xbin/su && /data/local/tmp/busybox mv /data/local/tmp/Superuser.apk /system/app/Superuser.apk && /data/local/tmp/busybox cp /data/local/tmp/busybox /system/xbin/busybox && chown 0.0 /system/xbin/su && chmod 06755 /system/xbin/su && chmod 655 /system/app/Superuser.apk && chmod 755 /system/xbin/busybox && rm /data/local.prop && reboot"
GOTO FINISH
:RICSTUFF
echo Going to copy files to it's place
stuff\adb.exe shell "/data/local/tmp/busybox mount -o remount,rw /system && /data/local/tmp/busybox mv /data/local/tmp/ric /system/bin/ric && chmod 755 /system/bin/ric && /data/local/tmp/busybox mv /data/local/tmp/su /system/xbin/su && /data/local/tmp/busybox mv /data/local/tmp/Superuser.apk /system/app/Superuser.apk && /data/local/tmp/busybox cp /data/local/tmp/busybox /system/xbin/busybox && chown 0.0 /system/xbin/su && chmod 06755 /system/xbin/su && chmod 655 /system/app/Superuser.apk && chmod 755 /system/xbin/busybox && rm /data/local.prop && reboot"
GOTO FINISH
:FINISH
echo You can close all open command-prompts now!
echo After reboot all is done! Have fun!
echo Bin4ry
pause
5) Just did it!
Now you have only to download Root App Delete tool and remove all crappy chinese apps you'll never use. If it works, you did it! cheers!
Hope you enjoied this guide, I tried to be as simple as possible
Burstina
Hey man !!! please make back up of your off software !!! i have brick my phone !!!!
PeBBa said:
Hey man !!! please make back up of your off software !!! i have brick my phone !!!!
Click to expand...
Click to collapse
wait, what did you do?
did you try factory reset?
burstina - no man i put in ROM flash other firmware !
PeBBa said:
burstina - no man i put in ROM flash other firmware !
Click to expand...
Click to collapse
this is bad... I'm new on smartphone world, I'll tell you something once I'll make a succesfull firmware backup.
btw, I tried using nandroid backup, even if there is no correct patch for our device, I was just able to do something I still can't fully understand:
something like that... it is 1 Gb friend. Perhaps there is another way to do a backup for you, any idea?
2.163.712 .android_secure.vfat.tar
10.240 cache.ext4.tar
286.050.304 data.ext4.tar
256 nandroid.md5
473.817.088 sd-ext.vfat.tar
357.468.160 system.ext4.tar
Does lewa os support this phone ?
I'm enjoying lewa on zp100 and this tianji looks very similar in build.
UPDATE:
with linux I used the RunMe.sh provided by Bin4ry (no edit was needed)
Now that it's rooted I just need to find and flash a CWM recovery and then I'd start trying looking for lewa
Here are some guides about the recovery question:
http://omappedia.org/wiki/Android_eMMC_Booting#Modifying_.IMG_Files (how recovery.img is built)
http://andwise.net/?p=403 (unpack/repack system)
http://forum.xda-developers.com/showthread.php?t=1587411 (mtk related perl script to unpack/repack recovery - it works)
http://www.twobitcoder.com/?p=158 (curious if I could open this page)
Do you think we can use cwm and rom from this one http://forum.xda-developers.com/showthread.php?t=1899592 ?
I'm almost sure the difference between haipad and tianji is in screen size only
---------- Post added at 03:21 PM ---------- Previous post was at 02:51 PM ----------
UPDATE:
I found lewa for haipad x720d !!!
http://forum.china-iphone.ru/sborka-lewa-os-dlya-haipai-x720d-t27041.html
I've uploaded the full nandroid here https://mega.co.nz/#F!RI5QHS4C!eJ39DF-LaQEzQey_fFCwuA.
I'd like a cwm recovery and a firefox os rom for it
Also found this:
http://forum.xda-developers.com/showthread.php?t=1825722
Tianji X720D
Hi suoko you had uploaded the full nandroid here - mega.co.nz/#F!RI5QHS4C!eJ39DF-LaQEzQey_fFCwuA[
Are all those files refer to Tianji X720D phone? Can we use it to flash the phone?
Thanks.:fingers-crossed:
Install Mt657xRepartition_en.apk and choose 2.5gb to have a larger storage for apps
Inviato dal mio GT-I9300 con Tapatalk 2

[Q]How to access android FS form fastoot/flashmode

I have copyied a damaged file in /system/app folder and now my phone is in the Bootloop. I wanna acces that file and replace it with the original. Can I do that?
I managed to solve it by deleting the 2 damaged files with this piece of code
Code:
echo " "
echo "Waiting for device..."
adb wait-for-device
echo " "
adb -d shell su -c "mount -o rw,remount /system"
adb -d shell su -c "ls /system"
adb -d shell su -c "rm /system/app/AudioEffectService.apk"
adb -d shell su -c "rm /system/app/SoundEnhancement.apk"
(of course the boot-loop forced me to find the right moment in the boot sequence to run the script)

How To Guide BANKING APPS: How to modify build.Prop using recovery (and more...)

Ok, after some reading, testing and trying, my conclusion is that it is not possible to tweak a running system with not triggering SELinux.
Though, for letting banking apps work it is only needed to modify the build.prop in /system, which is in fact possible, even without TWRP.
So, this is what I am doing now:
Reboot into (LOS) recovery and then in the recovery menu:
Goto “Advanced”
Mount /system
Enable adb
From your pc with adb etc.. installed:
Code:
adb shell mount -o rw,remount /mnt/system
adb shell sed -i 's/ro.debuggable=1/ro.debuggable=0/g' /mnt/system/system/build.prop
adb shell sed -i 's/ro.build.type=userdebug/ro.build.type=user/g' /mnt/system/system/build.prop
adb reboot
That's it, banking apps working!
Okay, did some further research and in fact, found a solution for my "tweaking".
Though I have the feeling most people are not tweaking anymore, I hope it helps for the few people still interested! For me the result is a more lean system, working banking apps and HD calling (VoLTE), and it is just nice to do... ;-)
Scripts and approach can be found in the next posts.
After some boot issues I finally found out what was the issue of my problems with some tweaking around.
As we have a device with A/B, after flashing the update, the active partition is automatically switched after an update. This happens when flashing, so you have to reboot to recovery again directly after flashing the updated LOS and do the tweaking then to actually tweak the right partition...
A system update for me is now:
Code:
Reboot into recovery
CHECK WHICH IS THE ACTIVE PARTITION!!
Goto “Apply Update”
Goto “Apply from adb”
adb sideload <lineageos.zip>
Goto “Advanced”
Goto “Reboot to recovery”
CHECK WHICH IS THE ACTIVE PARTITION, SHOULD BE CHANGED!!
In recovery:
Goto “Advanced”
Goto “Mount /system”
Goto “Enable ADB”
Run tweak.bat
For the latest tweak script (a bat file) I am using now, see the next post.
Hope it helps for people with banking or VoLTE issues and the need to change some settings in build.prop or else... Use the information at your own risk
Latest tweaks.bat file (last changes 25/04/2023):
Code:
:: Moto G100 Tweak Script
:: Last modified 25-04-2023
:: Moto-J
:: ------------------------------------------------------------
:: Changelog:
::
:: 22-04-23 Added:
:: adb shell rm -rf /mnt/product/app/ApertureLensLauncher
:: adb shell rm -rf /mnt/system_ext/app/MotoActions
:: adb shell rm -rf /mnt/system_ext/app/WAPPushManager
:: adb shell rm -rf /mnt/system_ext/priv-app/LineageSetupWizard
:: ------------------------------------------------------------
@echo off
Setlocal EnableDelayedExpansion
color 0A
cls
echo MOTO G100 TWEAK SCRIPT
echo.
echo IMPORTANT:
echo - First boot into recovery
echo - Goto advanced and mount /system
echo - Goto advanced and enable adb
echo.
pause
echo.
echo ------------------------------------
echo Connecting device...................
echo ------------------------------------
echo.
echo Terminal output will be displayed here:
adb devices
:: ------------------------------------------------------------
echo ------------------------------------
echo Mounting system partitions..........
echo ------------------------------------
echo.
echo Terminal output will be displayed here:
:: /dev/block/dm-6 = /product
:: /dev/block/dm-7 = /system
:: /dev/block/dm-8 = /system_ext
:: /dev/block/dm-9 = /vendor
adb shell mkdir /mnt/product > nul 2>&1
adb shell mkdir /mnt/system > nul 2>&1
adb shell mkdir /mnt/system_ext > nul 2>&1
adb shell mkdir /mnt/vendor > nul 2>&1
adb shell mount -o rw,remount /mnt/system
adb shell mount /dev/block/dm-6 /mnt/product
adb shell mount /dev/block/dm-7 /mnt/system > nul 2>&1
adb shell mount /dev/block/dm-8 /mnt/system_ext
adb shell mount /dev/block/dm-9 /mnt/vendor
echo.
echo done
echo.
pause
echo.
:: ------------------------------------------------------------
echo ------------------------------------
echo Removing some packages..............
echo ------------------------------------
echo.
echo Terminal output will be displayed here:
:: /product/app
adb shell rm -rf /mnt/product/app/Aperture
adb shell rm -rf /mnt/product/app/ApertureLensLauncher
adb shell rm -rf /mnt/product/app/Backgrounds
adb shell rm -rf /mnt/product/app/Gallery2
adb shell rm -rf /mnt/product/app/Jelly
adb shell rm -rf /mnt/product/app/PhotoTable
adb shell rm -rf /mnt/product/app/PowerOffAlarm
:: /product/priv-app
adb shell rm -rf /mnt/product/priv-app/Eleven
adb shell rm -rf /mnt/product/priv-app/OneTimeInitializer
:: /system/app
adb shell rm -rf /mnt/system/system/app/BasicDreams
adb shell rm -rf /mnt/system/system/app/BluetoothMidiService
adb shell rm -rf /mnt/system/system/app/BookmarkProvider
adb shell rm -rf /mnt/system/system/app/CaptivePortalLogin
adb shell rm -rf /mnt/system/system/app/CarrierDefaultApp
adb shell rm -rf /mnt/system/system/app/CompanionDeviceManager
adb shell rm -rf /mnt/system/system/app/EasterEgg
adb shell rm -rf /mnt/system/system/app/HTMLViewer
adb shell rm -rf /mnt/system/system/app/PrintRecommendationService
adb shell rm -rf /mnt/system/system/app/SimAppDialog
adb shell rm -rf /mnt/system/system/app/Stk
adb shell rm -rf /mnt/system/system/app/WallpaperBackup
:: /system/priv-app
adb shell rm -rf /mnt/system/system/priv-app/BackupRestoreConfirmation
adb shell rm -rf /mnt/system/system/priv-app/CallLogBackup
adb shell rm -rf /mnt/system/system/priv-app/InputDevices
adb shell rm -rf /mnt/system/system/priv-app/LiveWallpapersPicker
adb shell rm -rf /mnt/system/system/priv-app/ManagedProvisioning
adb shell rm -rf /mnt/system/system/priv-app/SharedStorageBackup
adb shell rm -rf /mnt/system/system/priv-app/StatementService
adb shell rm -rf /mnt/system/system/priv-app/Tag
adb shell rm -rf /mnt/system/system/priv-app/VpnDialogs
:: /system_ext/app
adb shell rm -rf /mnt/system_ext/app/datastatusnotification
adb shell rm -rf /mnt/system_ext/app/IfaaService
adb shell rm -rf /mnt/system_ext/app/MotoActions
adb shell rm -rf /mnt/system_ext/app/SoterService
adb shell rm -rf /mnt/system_ext/app/WAPPushManager
:: /system_ext/priv-app
adb shell rm -rf /mnt/system_ext/priv-app/LineageSetupWizard
adb shell rm -rf /mnt/system_ext/priv-app/Seedvault
adb shell rm -rf /mnt/system_ext/priv-app/Updater
:: /vendor/app
adb shell rm -rf /mnt/vendor/app/TimeService
:: For debugging purposes:
adb shell ls /mnt/product/app > _packages-product-app.txt
adb shell ls /mnt/product/priv-app > _packages-product-priv-app.txt
adb shell ls /mnt/system/system/app > _packages-system-system-app.txt
adb shell ls /mnt/system/system/priv-app > _packages-system-system-priv-app.txt
adb shell ls /mnt/system_ext/app > _packages-system_ext-app.txt
adb shell ls /mnt/system_ext/priv-app > _packages-system_ext-priv-app.txt
adb shell ls /mnt/vendor/app > _packages-vendor-app.txt
echo.
echo done
echo.
pause
echo.
:: ------------------------------------------------------------
echo ------------------------------------
echo Modifying /system/build.prop........
echo ------------------------------------
echo.
echo Terminal output will be displayed here:
:: First remove the lines if available
adb shell sed -i '/^# Modified settings/d' /mnt/system/system/build.prop
adb shell sed -i '/^ro.debuggable/d' /mnt/system/system/build.prop
adb shell sed -i '/^ro.build.type/d' /mnt/system/system/build.prop
adb shell sed -i '/^fw.show_multiuserui/d' /mnt/system/system/build.prop
adb shell sed -i '/^fw.power_user_switcher/d' /mnt/system/system/build.prop
adb shell sed -i '/^fw.show_hidden_users/d' /mnt/system/system/build.prop
adb shell sed -i '/^ro.backup.disable/d' /mnt/system/system/build.prop
adb shell sed -i '/^ro.config.ksm.support/d' /mnt/system/system/build.prop
adb shell sed -i '/^persist.debug.wfd.enable/d' /mnt/system/system/build.prop
adb shell sed -i '/^persist.debug.wfd.appmonitoring/d' /mnt/system/system/build.prop
adb shell sed -i '/^debug.sf.enable_hwc_vds/d' /mnt/system/system/build.prop
adb shell sed -i '/^persist.adb.notify/d' /mnt/system/system/build.prop
adb shell sed -i '/^# end of file/d' /mnt/system/system/build.prop
:: And now add them at the end of the file
adb shell sed -i -e '$a# Modified settings' /mnt/system/system/build.prop
:: Let banking apps work
adb shell sed -i -e '$aro.debuggable=0' /mnt/system/system/build.prop
adb shell sed -i -e '$aro.build.type=user' /mnt/system/system/build.prop
:: Disable user switching
adb shell sed -i -e '$afw.show_multiuserui=0' /mnt/system/system/build.prop
adb shell sed -i -e '$afw.power_user_switcher=0' /mnt/system/system/build.prop
adb shell sed -i -e '$afw.show_hidden_users=0' /mnt/system/system/build.prop
:: Disable backup provider
adb shell sed -i -e '$aro.backup.disable=1' /mnt/system/system/build.prop
:: Disable Kernel Samepage Merging (KSM)
adb shell sed -i -e '$aro.config.ksm.support=false' /mnt/system/system/build.prop
:: Disable Mira Cast (Wifi Direct) eating your battery
adb shell sed -i -e '$apersist.debug.wfd.enable=0' /mnt/system/system/build.prop
adb shell sed -i -e '$apersist.debug.wfd.appmonitoring=0' /mnt/system/system/build.prop
adb shell sed -i -e '$adebug.sf.enable_hwc_vds=0' /mnt/system/system/build.prop
:: Disable notification while adb is active
adb shell sed -i -e '$apersist.adb.notify=0' /mnt/system/system/build.prop
adb shell sed -i -e '$a# end of file' /mnt/system/system/build.prop
:: For debugging purposes:
adb pull /mnt/system/system/build.prop
del /F _build.system.prop > nul 2>&1
ren build.prop _build.system.prop
echo.
echo done
echo.
pause
echo.
:: ------------------------------------------------------------
echo ------------------------------------
echo Modifying /vendor/build.prop........
echo ------------------------------------
echo.
echo Terminal output will be displayed here:
:: First remove the lines if available
adb shell sed -i '/^# Modified settings/d' /mnt/vendor/build.prop
:: Firmware date
adb shell sed -i '/^ro.vendor.build.security_patch/d' /mnt/vendor/build.prop
:: Display
adb shell sed -i '/^debug.hwui.disable_vsync/d' /mnt/vendor/build.prop
adb shell sed -i '/^debug.hwui.render_dirty_regions/d' /mnt/vendor/build.prop
adb shell sed -i '/^persist.sys.use_dithering/d' /mnt/vendor/build.prop
adb shell sed -i '/^ro.sf.lcd_density/d' /mnt/vendor/build.prop
:: VoLTE (only what is missing)
adb shell sed -i '/^persist.dbg.ims_volte_enable/d' /mnt/vendor/build.prop
adb shell sed -i '/^persist.dbg.volte_avail_ovr/d' /mnt/vendor/build.prop
adb shell sed -i '/^persist.dbg.vt_avail_ovr/d' /mnt/vendor/build.prop
adb shell sed -i '/^persist.dbg.wfc_avail_ovr/d' /mnt/vendor/build.prop
adb shell sed -i '/^persist.vendor.radio.calls.on.ims/d' /mnt/vendor/build.prop
adb shell sed -i '/^persist.vendor.data.iwlan.enable/d' /mnt/vendor/build.prop
adb shell sed -i '/^# end of file/d' /mnt/vendor/build.prop
:: And now add them at the end of the file
adb shell sed -i -e '$a# Modified settings' /mnt/vendor/build.prop
:: Firmware date
set CUR_YYYY=%date:~9,4%
set CUR_MM=%date:~6,2%
set CUR_DD=%date:~3,2%
set SUBDATE=%CUR_YYYY%-%CUR_MM%-%CUR_DD%
adb shell sed -i -e '$aro.vendor.build.security_patch=%SUBDATE%' /mnt/vendor/build.prop
:: Display
adb shell sed -i -e '$adebug.hwui.disable_vsync=true' /mnt/vendor/build.prop
adb shell sed -i -e '$adebug.hwui.render_dirty_regions=false' /mnt/vendor/build.prop
adb shell sed -i -e '$apersist.sys.use_dithering=0' /mnt/vendor/build.prop
adb shell sed -i -e '$aro.sf.lcd_density=460' /mnt/vendor/build.prop
:: VoLTE (only what is missing)
adb shell sed -i -e '$apersist.dbg.ims_volte_enable=1' /mnt/vendor/build.prop
adb shell sed -i -e '$apersist.dbg.volte_avail_ovr=1' /mnt/vendor/build.prop
adb shell sed -i -e '$apersist.dbg.vt_avail_ovr=1' /mnt/vendor/build.prop
adb shell sed -i -e '$apersist.dbg.wfc_avail_ovr=1' /mnt/vendor/build.prop
adb shell sed -i -e '$apersist.vendor.radio.calls.on.ims=1' /mnt/vendor/build.prop
adb shell sed -i -e '$a# end of file' /mnt/vendor/build.prop
:: FOR VOLTE CHECK, DIAL *#*#4636#*#*, PHONE INFORMATION - 3DOTS MENU - IMS SERVICE STATUS
::
:: Complete VoLTE settings:
::
:: # Debug Options
:: persist.dbg.ims_volte_enable=1
:: persist.dbg.volte_avail_ovr=1
:: persist.dbg.vt_avail_ovr=1
:: persist.dbg.wfc_avail_ovr=1
::
:: # Data Options
:: # Commented this line out as it was reported to break WiFi calling on some carriers.
:: # persist.data.iwlan.enable=true
::
:: # Radio Options
:: persist.radio.rat_on=combine (OR persist.vendor.radio.rat_on=combine)
:: persist.radio.data_ltd_sys_ind=1 (OR persist.vendor.radio.data_ltd_sys_ind=1)
:: persist.radio.data_con_rprt=1 (OR persist.vendor.radio.data_con_rprt=1)
:: persist.radio.calls.on.ims=1 (OR persist.vendor.radio.calls.on.ims=1)
:: For debugging purposes:
adb pull /mnt/vendor/build.prop
del /F _build.vendor.prop > nul 2>&1
ren build.prop _build.vendor.prop
echo.
echo done
echo.
pause
echo.
:: ------------------------------------------------------------
echo ------------------------------------
echo Proper unmount partitions...........
echo ------------------------------------
echo.
echo Terminal output will be displayed here:
adb shell umount /mnt/product
adb shell umount /mnt/system
adb shell umount /mnt/system_ext
adb shell umount /mnt/vendor
echo.
echo done
echo.
pause
echo.
:: ------------------------------------------------------------
echo ------------------------------------
echo Rebooting phone...
echo ------------------------------------
echo.
pause
adb reboot
For who wants to use some additional adb tweaks; it is possible to do this by enabling adb in your developer settings.
Here is the bat-file I am using (last changes 17/04/2023):
Code:
:: Moto G100 Tweak Script
:: Last modified 17-04-2023
:: Moto-J
:: ------------------------------------------------------------
@echo off
Setlocal EnableDelayedExpansion
color 0A
cls
echo MOTO G100 ADB TWEAK SCRIPT
echo.
echo IMPORTANT:
echo - Enable ADB in developer settings
echo - Connect phone and accept adb connection
echo.
pause
echo.
echo ------------------------------------
echo Connecting device...................
echo ------------------------------------
echo.
echo Terminal output will be displayed here:
adb devices
:: ------------------------------------------------------------
echo ------------------------------------
echo Running tweaks......................
echo ------------------------------------
echo.
echo Terminal output will be displayed here:
echo Enable privacy logging 7-day dashboard...
:: Enable privacy logging 7-day dashboard
adb shell device_config put privacy privacy_dashboard_7_day_toggle true
pause
echo Enable new combined safety center........
:: Enable new combined safety center
adb shell device_config put privacy safety_center_is_enabled true
pause
echo Enable DNS-over-HTTP3 support............
:: Enable DNS-over-HTTP3 support
adb shell device_config put netd_native doh 1
pause
echo Enable cached apps freezer...............
:: Enable cached apps freezer
adb shell device_config put activity_manager_native_boot use_freezer true
pause
echo Defer boot completed broadcasts..........
:: Defer boot completed broadcasts for background restricted apps
adb shell device_config put activity_manager defer_boot_completed_broadcast 2
pause
echo Enable separate notification slider......
adb shell device_config put systemui volume_separate_notification true
pause
echo.
echo Done!
echo.
:: ------------------------------------------------------------
echo ------------------------------------
echo Now reboot and disable adb again....
echo ------------------------------------
echo.
pause
adb reboot
You can enable adb and adb-root, run the script, reboot and afterwards disable adb again.
The settings will stay even after updating, so only running the script once is enough.
Also with a custom rom you want to update your firmware so now and then.
Luckily we can find the firmware for our phone here:
lolinet mirrors - firmware, software, iso etc.
lolinet mirrors - powered by h5ai
mirrors.lolinet.com
And here is the bat-file I am using with phone connected to PC in bootloader (last changes 15/04/2023):
Code:
:: Moto G100 Firmware Update Script
:: Last modified 15-04-2023
:: Moto-J
:: ------------------------------------------------------------
@echo off
Setlocal EnableDelayedExpansion
color 0A
cls
echo MOTO G100 FIRMWARE UPDATE SCRIPT
echo.
echo IMPORTANT:
echo - Connect phone to USB of PC
echo - Boot into bootloader
echo - Execute this BAT-file in directory with fastboot and latest firmware
echo.
pause
echo.
echo ------------------------------------
echo Connecting device...................
echo ------------------------------------
echo.
echo Terminal output will be displayed here:
fastboot devices
:: ------------------------------------------------------------
echo ------------------------------------
echo Updating firmware files.............
echo ------------------------------------
echo.
echo Terminal output will be displayed here:
fastboot flash modem_a NON-HLOS.bin
fastboot flash modem_b NON-HLOS.bin
fastboot erase mdmddr
fastboot flash fsg_a fsg.mbn
fastboot flash fsg_b fsg.mbn
fastboot erase mdm1m9kefs1
fastboot erase mdm1m9kefs2
fastboot flash bluetooth_a BTFM.bin
fastboot flash bluetooth_b BTFM.bin
fastboot flash dsp_a dspso.bin
fastboot flash dsp_b dspso.bin
fastboot flash logo_a logo.bin
fastboot flash logo_b logo.bin
fastboot erase carrier
fastboot erase ddr
echo.
echo done
echo.
pause
echo.
:: ------------------------------------------------------------
echo ------------------------------------
echo Rebooting phone...
echo ------------------------------------
echo.
pause
fastboot reboot
I am only flashing the neccessary stuff as radio and bluetooth and only that is erased what is needed for the update. No data is lost after update, no other tweaking needed.
On first reboot switch off your WiFi and wait a few seconds; carrier info will be updated from your provider and everything is working again. After that you can switch on your WiFi again ;-)
Additional some things which could improve your battery life (and data usage), although this is already great because of the large battery of the Moto G100....
Restrict battery usage in background for apps which do not need it:
go to apps, show all apps, per app, go to battery usage and switch to restricted
For the apps with restricted battery usage, I also switch of background usage of mobile data and VPN.
go to apps, show all apps, per app, go to mobile data and wifi and switch off background usage and VPN
Switch off mobile data for all apps which do not need an internet connections
same approach, though switch off complete network access. You can do this for several apps which you are using without the need of an internet connection like most barcode and QR scanners, file browsers, card storage apps, galery's etc...
In network settings - SIM cards - preferred network types, only select the network types you really need and which are optimised for your usage.
for me this is NR/LTE/GSM/WCDMA as I switch off mobile data at night with profile settings and want to be available by phone (GSM/WCDMA), though for most people only NR/LTE will probably even fit when you are using the VoLTE changes from the first posts and VoLTE is working ;-)
Set peak frequency for screen refresh to 60 Herz, not 90 Herz. 90 Herz is more fluent when scrolling, though for normal reading, internet usage etc... I see no need for 90 Herz and it will save your battery
Set the time-out for your screen as short as possible. I am using 1 minute and it is okay for me.
Enable double click on status or lock screen to enable sleep and really use it.
Use dark theme and black background, although we do not have a led screen, it is still saving battery
Disable location and bluetooth when you are not using it, enable wifi (only) when available.
Disable tick to activate, screensaver and fingerprint sensor swipe
Don't use full brightness, though try to set it that low as possible
Don't charge your phone to 100% every time, though try to keep the battery level between 30-80%.
This is also why I have set battery saving planning to a percentage of 30%.
When you don't need your email updated real time, disable push and only use getting POP3 email for example every hour.
Although I am using a script to remove system apps after an update, you can also disable some system apps you not need. Either way; try to disable as much as possible which is not neccessary for a good working phone.
That's it for now. When I have some additional ideas I will let you know!
Outside of banking apps & enabling volte. What do your other removal of packages and tweaks do? Can you give a general breakdown?
Timmons said:
Outside of banking apps & enabling volte. What do your other removal of packages and tweaks do? Can you give a general breakdown?
Click to expand...
Click to collapse
Sorry but you really have to check yourself.
There are several websites where the apps of Android are explained
The same counts for the build.prop settings.
I think it would be good to check yourself so you know what you are doing.
And even better... may be you will find other tweaks you can share with us!
Moto-J said:
Sorry but you really have to check yourself.
There are several websites where the apps of Android are explained
The same counts for the build.prop settings.
I think it would be good to check yourself so you know what you are doing.
And even better... may be you will find other tweaks you can share with us!
Click to expand...
Click to collapse
Fair enough. You'd mentioned to chmod after updating. Do I have to do that if I just run your bat file to update it? Sorry for the rookie questions as I'm no expert at linux scripts.
Timmons said:
Fair enough. You'd mentioned to chmod after updating. Do I have to do that if I just run your bat file to update it? Sorry for the rookie questions as I'm no expert at linux scripts.
Click to expand...
Click to collapse
No, not neccessary when you are using the script and edit the file by using adb this way.
No rights are modified that way.
Moto-J said:
No, not neccessary when you are using the script and edit the file by using adb this way.
No rights are modified that way.
Click to expand...
Click to collapse
I've updated the script to only update the build file without removing anything but it's not working. getting this below for system & vendor
Modifying /system/build.prop........
------------------------------------
Terminal output will be displayed here:
sed: /mnt/system/system/build.prop: No such file or directory
------------------------------------
Modifying /vendor/build.prop........
------------------------------------
Terminal output will be displayed here:
sed: /mnt/vendor/build.prop: No such file or directory
Timmons said:
I've updated the script to only update the build file without removing anything but it's not working. getting this below for system & vendor
Modifying /system/build.prop........
------------------------------------
Terminal output will be displayed here:
sed: /mnt/system/system/build.prop: No such file or directory
------------------------------------
Modifying /vendor/build.prop........
------------------------------------
Terminal output will be displayed here:
sed: /mnt/vendor/build.prop: No such file or directory
Click to expand...
Click to collapse
Hi @Timmons;
Could it be that you removed the first part of the bat file where the drives are mounted?
Could you therefor share the complete bat file you are using now, so I can actually check what is or could be wrong?
Moto-J said:
Hi @Timmons;
Could it be that you removed the first part of the bat file where the drives are mounted?
Could you therefor share the complete bat file you are using now, so I can actually check what is or could be wrong?
Click to expand...
Click to collapse
And what happens when you copy the lines to the command line one by one instead of using the bat file?
Could you for example try the following lines to check:
Code:
adb devices
adb shell mkdir /mnt/vendor
adb shell mount /dev/block/dm-9 /mnt/vendor
adb shell ls /mnt/vendor
You should see a directory listing (ls) of /mnt/vendor or an error message somewhere
Moto-J said:
And what happens when you copy the lines to the command line one by one instead of using the bat file?
Could you for example try the following lines to check:
Code:
adb devices
adb shell mkdir /mnt/vendor
adb shell mount /dev/block/dm-9 /mnt/vendor
adb shell ls /mnt/vendor
You should see a directory listing (ls) of /mnt/vendor or an error message somewhere
Click to expand...
Click to collapse
C:\Users\Home\Downloads\Motorola>adb shell mkdir /mnt/vendor
mkdir: '/mnt/vendor': File exists
C:\Users\Home\Downloads\Motorola>adb shell ls /mnt/vendor
C:\Users\Home\Downloads\Motorola>adb shell mount /dev/block/dm-9 /mnt/vendor
mount: '/dev/block/dm-9'->'/mnt/vendor': No such file or directory
C:\Users\Home\Downloads\Motorola>adb devices
List of devices attached
ZY22CCJ22P recovery
C:\Users\Home\Downloads\Motorola>adb shell mount /dev/block/dm-9 /mnt/vendor
mount: '/dev/block/dm-9'->'/mnt/vendor': No such file or directory
Not having much luck entering them manually.
Timmons said:
C:\Users\Home\Downloads\Motorola>adb shell mkdir /mnt/vendor
mkdir: '/mnt/vendor': File exists
C:\Users\Home\Downloads\Motorola>adb shell ls /mnt/vendor
C:\Users\Home\Downloads\Motorola>adb shell mount /dev/block/dm-9 /mnt/vendor
mount: '/dev/block/dm-9'->'/mnt/vendor': No such file or directory
C:\Users\Home\Downloads\Motorola>adb devices
List of devices attached
ZY22CCJ22P recovery
C:\Users\Home\Downloads\Motorola>adb shell mount /dev/block/dm-9 /mnt/vendor
mount: '/dev/block/dm-9'->'/mnt/vendor': No such file or directory
Not having much luck entering them manually.
Click to expand...
Click to collapse
Hmmm... it seems that your partitions are different as dm-9 is not known... strange ;-)
Could you try:
adb devices
adb shell ls /dev/block/dm*
Moto-J said:
Hmmm... it seems that your partitions are different as dm-9 is not known... strange ;-)
Could you try:
adb devices
adb shell ls /dev/block/dm*
Click to expand...
Click to collapse
C:\Users\Home\Downloads\Motorola>adb devices
List of devices attached
ZY22CCJ22P recovery
C:\Users\Home\Downloads\Motorola>adb shell ls /dev/block/dm*
/dev/block/dm-0 /dev/block/dm-3 /dev/block/dm-6
/dev/block/dm-1 /dev/block/dm-4 /dev/block/dm-7
/dev/block/dm-2 /dev/block/dm-5 /dev/block/dm-8
Timmons said:
C:\Users\Home\Downloads\Motorola>adb devices
List of devices attached
ZY22CCJ22P recovery
C:\Users\Home\Downloads\Motorola>adb shell ls /dev/block/dm*
/dev/block/dm-0 /dev/block/dm-3 /dev/block/dm-6
/dev/block/dm-1 /dev/block/dm-4 /dev/block/dm-7
/dev/block/dm-2 /dev/block/dm-5 /dev/block/dm-8
Click to expand...
Click to collapse
Ok, it seems you do not have dm-9, so indeed partitions are different.
What I have done to find out what is what is the following:
adb shell mkdir /mnt/tmpdir
adb shell mount /dev/block/dm-0 /mnt/tmpdir
adb shell ls mnt/tmpdir
Then you see what the content is of dm-0 so you know which dir it is
After that you can do
adb shell umount /mnt/tmpdir
adb shell mount /dev/block/dm-1
adb shell ls mnt/tmpdir
etc....
It seems you have to find the right setup for mounting the drives, after that you can slightly modify the script and use it for your phone.

Categories

Resources