Hey everyone just thought that this info might be useful to the this community...
this info is already available, though in parts, over XDA forums.. so i thought that i will try n make it easily available/understandable to all users here...
seems this info is useful to other android users too... so will try and post generic as well as X10 specific info...
WARNING:
I AM NOT RESPONSIBLE FOR THE FILES THAT U CREATE USING THIS INFO
I AM NOT RESPONSIBLE IF U LOOSE UR DATA WHEN TRYING THIS OUT
REMEMBER THIS DEALS WITH SYSTEM MODIFICATIONS AND ANY WRONG COMMAND CAN RENDER UR CURRENT ROM UNUSABLE/BROKEN
SO BE SURE U CAN USE FLASHTOOL TO FLASH STOCK FW IF U END UP WITH UNUSABLE/BROKEN SYSTEM
DO NOT CIRCULATE THE UPDATE.ZIPs CREATED UNLESS U ARE CERTAIN THAT THEY WORK PROPERLY
ALSO DO NOT FLASH ANY RANDOM UPDATE.ZIP WHICH U DOWNLOAD UNLESS U CHECK OUT THE CODE WRITTEN IN THE UPDATE SCRIPT
now that i have scared u enough lets begin...
[BASICS]
there are two versions of update scripts (codes/syntax) which can be used:
Amend (update-script)
Edify (updater-script) [along with update-binary]
both of the above mentioned versions use different syntax...
both of these versions work on the recoveries currently available for x10 (xRecovery & FreeXperia Recovery)
ONLY EDIFY SYNTAX IS SUPPORTED BY xRecovery v1.0.0 (latest recovery for X10)
these files can be found in "\META-INF\com\google\android" of the zip package... depending on which file update-script OR updater-script is present in the update.zip u will understand which update scripts (codes/syntax) is to be used...
[SYNTAX | READING MATERIAL]
following are very useful guides which cover most of the available syntax...
Amend (update-script) by TylTru
Edify (updater-script) by coolexe
[WIP] How to Write an Updater-Script with Edify Code
UID and GIDs [related to setting proper permissions]
[IMP] info related to Edify for ROM makers
[PROGRAM | APPLICATION]
now that u follow the differences lets get the program to make update.zips and sign them...
Update.zip 2.0 Modifier/Creator by Daneshm90
its a windows only tool and i personally use it regularly to make update.zips
read through that post as it is pretty straight forward on how the application works... there is even a video... and it even signs the zip...
this program basically handles (modifies/creates) only Amend (update-script) but u can just place ur modified updater-script (along with the update-binary) in <ROOT_DIR_OF_PROGRAM>\placehere\META-INF\com\google\android\
and execute update.bat to make the update.zip package.... this program automatically signs the zip so u wont have any errors while flashing...
[ EXAMPLES ]
Amend scripts (update-script)
list of functions that can be used in Edify scripts and explanations about them by nubecoder
[ CONVERTORS ]
update-script to edify script converter by Chumby_666 (a.k.a. aZuZu)
amend2edify script converter by nubecoder
[ADDITIONAL INFO]
i will keep adding more to this as and when i get time...
till then happy reading the links posted here...
also if u have any queries/doubts feel free to post them here...
[BEST OF LUCK]
Usefull information. There is update zip for ubuntu?
hymns said:
Usefull information. There is update zip for ubuntu?
Click to expand...
Click to collapse
anantshri is working on Ubuntu Lucid CHROOT but the images are around 140 to 700 MB compressed and 3.5GB uncompressed... so as of now it doesnt make much sense to create update.zips for them... better option is to uncompress them on the PC and then place the extracted files on SDCARD (card reader/etc)...
thats wonderful...
Hi Doomlord,
thats a wonderful work..i mean thats a perfect explanation of creating update.zips...
another alternative, which i use frequently to update apps in system forlder only is..
go to titanium back up options and create update.zip
now select this update.zip from mounted SD card and then open it with 7zip or any zip editor.
then replace system/app forlder ->app to any app u want to install in system..
save and close the file. and u r good to go...
just an alternative which i personally found easy...but nothing to take away from your awsum thread here..keep the good work..thanks..
Nikhil_007 said:
Hi Doomlord,
thats a wonderful work..i mean thats a perfect explanation of creating update.zips...
another alternative, which i use frequently to update apps in system forlder only is..
go to titanium back up options and create update.zip
now select this update.zip from mounted SD card and then open it with 7zip or any zip editor.
then replace system/app forlder ->app to any app u want to install in system..
save and close the file. and u r good to go...
just an alternative which i personally found easy...but nothing to take away from your awsum thread here..keep the good work..thanks..
Click to expand...
Click to collapse
ah thats a nice idea to do it on the device itself!
u can even add specific files which need to be placed on other partitions (SYSTEM / DATA / SDCARD) when flashing it from recovery... though u will have to edit update-script for the recovery to copy those files..
Root Explorer:
1. Long press on folder you want to zip
2. Select Compress into .zip
3. Wham, Bam, thank you Ma'am!
Use META Wipe Data for flashing ROMS
Use META No Data Wipe for flashing Updates, themes, etc.
Thank you mate. Great source of info as usual
thank you DooMLoRD for this great topic and for all your usffull comment around X10 dev forum .
but i have a qustion :
i am beginner in cooking roms but i want to ask you how to use FreeX10 Froyo by Z to built a full froyo rom ?
and what i can do with X10_2.2_Froyo_sources.tar.bz2
thanks alot
Ahmed radi said:
thank you DooMLoRD for this great topic and for all your usffull comment around X10 dev forum .
but i have a qustion :
i am beginner in cooking roms but i want to ask you how to use FreeX10 Froyo by Z to built a full froyo rom ?
and what i can do with X10_2.2_Froyo_sources.tar.bz2
thanks alot
Click to expand...
Click to collapse
hi! thank you!
i am sorry but even i dont know how to build a rom from sources... wht most chefs do is just mix files from various roms, using FreeX10 as base and then adding content from other roms (of other devices)
thank you DooMLoRD
ok great , but i need to know what is the important files should copy from Freex10 to other roms ?
thanx man
have found a other methode for make a update.zip fast and easier!!
hi..
I have found a other methode for make a update.zip fast and easier!!
You can downloading a update.zip, whatever you want ... for example;
you downloaded update3.zip. open it with 7zip
in update3.zip> (you have 3 folders> data, META-INF, system)
is missing you as a path,
for example, because you want to update an audio fix .. can you just move the lib folder in System Folder.
if you want to update system apps, you can move the desired app in the System folder> app
framework-res> in system> framwork
the META-INF file from update3.zip should always be maintained.
It is important that you choose a update.zip,! Since the directories and systemlinks / already been set with the open-mentioned program are correct!
can not explain it better .. this method saves me a lot of time and is, I think the easiest way.
greeting edgar......
EdgarCupari said:
hi..
I have found a other methode for make a update.zip fast and easier!!
You can downloading a update.zip, whatever you want ... for example;
you downloaded update3.zip. open it with 7zip
in update3.zip> (you have 3 folders> data, META-INF, system)
is missing you as a path,
for example, because you want to update an audio fix .. can you just move the lib folder in System Folder.
if you want to update system apps, you can move the desired app in the System folder> app
framework-res> in system> framwork
the META-INF file from update3.zip should always be maintained.
It is important that you choose a update.zip,! Since the directories and systemlinks / already been set with the open-mentioned program are correct!
can not explain it better .. this method saves me a lot of time and is, I think the easiest way.
greeting edgar......
Click to expand...
Click to collapse
so u dont believe in setting permissions in the update.zip is it?
the most important thing is that u READ the update-script / updater-script PROPERLY before using any update.zip... and modify it for ur needs...
Create it in mnt since its a rootfs set perms rxrxrx Meta then set your perms 4 w.e else I'd getzipsigner 2 to make sure its right..
Sent from my X10a using XDA App
EXAMPLE FOR AMEND SCRIPTS (update-script)
from my experience (for X10 users only):
Edify scripts (updater-script) support copying to /tmp but Amend scripts (update-script) doesnt allow such a location... it only allows for SYSTEM, DATA, CACHE
the Edify scripts (updater-script) doesnt always work properly on our current recovery... better stick to Amend scripts (update-script)...
any programs that u want to run (which doesnt require additional files) place it at the root of ur packege
any programs that u want to run (which require additional files) place it at the /data/local/tmp folder of ur packege
Additional: http://forum.xda-developers.com/showpost.php?p=5776278&postcount=3
(generic info for all androids)
format:
Code:
format SYSTEM:
format DATA:
format CACHE:
copy package:
Code:
copy_dir PACKAGE:system SYSTEM:
copy_dir PACKAGE:data DATA:
copy_dir PACKAGE:cache CACHE:
set permissions:
Code:
set_perm_recursive 0 0 0755 0644 SYSTEM:
set_perm_recursive 0 2000 0755 0755 SYSTEM:bin
set_perm 0 0 04755 SYSTEM:bin/su
set_perm 0 0 0755 SYSTEM:etc/dhcpcd/dhcpcd-run-hooks
...
.
.
..
busybox installation:
Code:
run_program PACKAGE:installbusybox
installbusybox:
Code:
#!/system/bin/sh
cd /system/bin
/system/bin/chmod 755 busybox
./busybox --install -s /system/bin
OR
Code:
#!/system/bin/sh
cd /system/bin
/system/bin/chmod 755 busybox
./busybox --install -s /system/xbin
running any other program/shell script:
Code:
run_program PACKAGE:mycustomshellscript.sh
OR
Code:
copy_dir PACKAGE:data DATA:
set_perm 0 0 777 DATA:local/tmp/mycustomshellscript.sh
run_program DATA:local/tmp/mycustomshellscript.sh
OR
-[ i have not tested the following but might work ]-
Code:
copy_dir PACKAGE:tmp TMP:
set_perm 0 0 777 TMP:mycustomshellscript.sh
run_program TMP:mycustomshellscript.sh
contents of mycustomshellscript.sh:
Code:
#!/sbin/sh
<commands u want to execute>
using update.zip for app installation :
place the app (appname.apk) in <rootdir>\app\
if u want to "install" an app as system app then
Code:
copy_dir PACKAGE:app SYSTEM:app
else if u want it as a user app then
Code:
copy_dir PACKAGE:app DATA:app
for modules:
place the module (modulename.ko) in <rootdir>\system\lib\modules
Code:
copy_dir PACKAGE:system SYSTEM:
set_perm 0 0 0644 SYSTEM:lib/modules/modulename.ko
for modified chargemon (Xperia Android users only):
place the modified chargemon script in <rootdir>\system\bin
Code:
copy_dir PACKAGE:system SYSTEM:
set_perm 0 0 04755 SYSTEM:bin/chargemon
set_perm 0 0 04755 SYSTEM:bin/charger
for copying files to SDCARD:
place the files u want to copy to sdcard in: <rootdir>\sdcard\
for copying GScript scripts: place the .sh files in: <rootdir>\sdcard\gscript\
Code:
copy_dir PACKAGE:sdcard SDCARD:
Hi doom thanks for this great tutorial...Im trying to learn these thing so I tried to make an update.zip to install astro as system app
using Daneshm90 tool here is what I did but didnt work...
first copied the directories to the placehere folder:like this=>> placehere/system/app/astro.apk
then chose the forst option: creat update-script
then 1. copy directories
what partition to place files in?: system
what folder within that partition?: app
what folder from this update.zip within placehere folder?: app
then I chose 6. set permissiions for file
what partition is the file located in?: system
what file within that partition?: app/astro.apk
UID ?: (I had no Idea what this is so I entered chmod number 644)
GID ?: (again have no idea so just pressed enter and skiped)
MODE ?: (same as above)
then 8.done
and 2.create update.zip
and obviously didnt work
could you please help me?
Thanks
Mortyx10 said:
Hi doom thanks for this great tutorial...Im trying to learn these thing so I tried to make an update.zip to install astro as system app
using Daneshm90 tool here is what I did but didnt work...
first copied the directories to the placehere folder:like this=>> placehere/system/app/astro.apk
then chose the forst option: creat update-script
then 1. copy directories
what partition to place files in?: system
what folder within that partition?: app
what folder from this update.zip within placehere folder?: app
then I chose 6. set permissiions for file
what partition is the file located in?: system
what file within that partition?: app/astro.apk
UID ?: (I had no Idea what this is so I entered chmod number 644)
GID ?: (again have no idea so just pressed enter and skiped)
MODE ?: (same as above)
then 8.done
and 2.create update.zip
and obviously didnt work
could you please help me?
Thanks
Click to expand...
Click to collapse
If you are just copying a file then do this. Create a folder "app" and place the apk inside it.
And use only this line in update-script to copy it to /system/app
Code:
copy_dir PACKAGE:app SYSTEM:app
I know it is not "ideal" but works for me and saves me some time. ( i am one of the most laziest persons you will ever meet)
Hi thanks for the reply
I just did it and its a no go for me
Cant mount system/app
error in line 1 or something like this
Mortyx10 said:
Hi thanks for the reply
I just did it and its a no go for me
Cant mount system/app
error in line 1 or something like this
Click to expand...
Click to collapse
Are you adding a blank line after that?
Sent from my X10project using XDA App
Mortyx10 said:
Hi doom thanks for this great tutorial...Im trying to learn these thing so I tried to make an update.zip to install astro as system app
using Daneshm90 tool here is what I did but didnt work...
first copied the directories to the placehere folder:like this=>> placehere/system/app/astro.apk
then chose the forst option: creat update-script
then 1. copy directories
what partition to place files in?: system
what folder within that partition?: app
what folder from this update.zip within placehere folder?: app
then I chose 6. set permissiions for file
what partition is the file located in?: system
what file within that partition?: app/astro.apk
UID ?: (I had no Idea what this is so I entered chmod number 644)
GID ?: (again have no idea so just pressed enter and skiped)
MODE ?: (same as above)
then 8.done
and 2.create update.zip
and obviously didnt work
could you please help me?
Thanks
Click to expand...
Click to collapse
actually i just use the update.zip creator to "pack" & sign the files...
once u have the files in place... just go to...
placehere\META-INF\com\google\android
and edit the update-script
if u have app in:
placehere\system\app\astro.apk
u just need
Code:
copy_dir PACKAGE:system SYSTEM:
once u finish editing the file
just run Script.bat
enter: n (do not clean previous files)
enter: 2 (create update.zip)
thats it!
a new file update.zip will be created in root folder of the program
@realunited no I don't do it manually
@Doom well dont know why but still not working....same error in recovery...cant mount system line1
Dont I need to set permissions cuz its in system?
Sent from my X10 TripNMiUI using XDA App
Related
Hello ;
I did the procedures of the Thread:
"how flash player 10.3 work in stock rom[Guide] "
http://forum.xda-developers.com/showthread.php?p=18552527
And flash it's working, but I have a small Problem after disconnet/reboot the
Phone I lose the files of the folder lib an dit's necessary do always the following
steps:
step 2: copy lib file to /data/data/com.adobe.flashplayer/lib
step 3: change the permission of all .so file like screenshot
JG
First download autostart app from market it free.then create a file name it autostart.sh and put these command under the file.
" cp /sdcard/lib/libflashplayer.so /data/data/com.adobe.flashplayer/lib/
cp /sdcard/lib/libstagefright_froyo.so /data/data/com.adobe.flashplayer/lib/
cp /sdcard/lib/libstagefright_honeycomb.so /data/data/com.adobe.flashplayer/lib/
cp /sdcard/lib/libysshared.so /data/data/com.adobe.flashplayer/lib/
chmod 644 /data/data/com.adobe.flashplayer/lib/libflashplayer.so
chmod 644 /data/data/com.adobe.flashplayer/lib/libstagefright_froyo.so
chmod 644 /data/data/com.adobe.flashplayer/lib/libstagefright_honeycomb.so
chmod 644 /data/data/com.adobe.flashplayer/lib/libysshared.so
"
Then create a folder lib in your sd card and copy all lib file to that lib folder then create a folder in/data and name it opt and place autostart.sh file to that opt folder and set permission to file 777.now when your phone se restart your lib file is automatically copy to appropriate folder.
Flash Lib Files
Hello;
I did all your indications, please see screenshots 1 to 4
but in the end after restart the phone, in the lib file only can see a strange file,
see screenshot 5
BR:
JG
Ok wait i will upload my autostart.sh
try this autostart.sh i am using it and it work for me it has save command but some time there is problem in file.
press thanks button if i help you
OK
Hello;
It's working thanks.
JG
does not work on 2.3
Autostart app does not work on 2.3.
Another autostart app is Script Manager this work correctly.
multibestia said:
Autostart app does not work on 2.3.
Another autostart app is Script Manager this work correctly.
Click to expand...
Click to collapse
I got LG p690 (Android Gingerbread). I copied the command into Script Manager file and manually (with execute command) the procedure goes but after reboot it does not go automatically. Do I have to copy the file created somewhere specifically?
please let me know
thks
download autostart from market it work in 2.3
vikasb32 said:
download autostart from market it work in 2.3
Click to expand...
Click to collapse
It is strange. After reboot the files have been copied but the first one libflashplayer.so is just linked and this blocks the browser. Instead if I launch the script from root explorer everything is fine. can somebody help me?
pekkio said:
It is strange. After reboot the files have been copied but the first one libflashplayer.so is just linked and this blocks the browser. Instead if I launch the script from root explorer everything is fine. can somebody help me?
Click to expand...
Click to collapse
Don't linked flashplayer to link2sd because after restarting link2sd run before the autostart so link2sd not able to link the file and btw if you manually link flashplayer then flashplayer not work in opera mobile so don't link flashplayer and keep it in internel memory.
vikasb32 said:
Don't linked flashplayer to link2sd because after restarting link2sd run before the autostart so link2sd not able to link the file and btw if you manually link flashplayer then flashplayer not work in opera mobile so don't link flashplayer and keep it in internel memory.
Click to expand...
Click to collapse
that's right! Thanks... so I won't have chance to get Flash Player linked on sd and have automatically copied the library files by autostart....maybe in the future we will have custom flash player for armv6....
Same problem, need help
vikasb32 said:
First download autostart app from market it free.then create a file name it autostart.sh and put these command under the file.
" cp /sdcard/lib/libflashplayer.so /data/data/com.adobe.flashplayer/lib/
cp /sdcard/lib/libstagefright_froyo.so /data/data/com.adobe.flashplayer/lib/
cp /sdcard/lib/libstagefright_honeycomb.so /data/data/com.adobe.flashplayer/lib/
cp /sdcard/lib/libysshared.so /data/data/com.adobe.flashplayer/lib/
chmod 644 /data/data/com.adobe.flashplayer/lib/libflashplayer.so
chmod 644 /data/data/com.adobe.flashplayer/lib/libstagefright_froyo.so
chmod 644 /data/data/com.adobe.flashplayer/lib/libstagefright_honeycomb.so
chmod 644 /data/data/com.adobe.flashplayer/lib/libysshared.so
"
Then create a folder lib in your sd card and copy all lib file to that lib folder then create a folder in/data and name it opt and place autostart.sh file to that opt folder and set permission to file 777.now when your phone se restart your lib file is automatically copy to appropriate folder.
Click to expand...
Click to collapse
Hello,
Not an android professional. I have a P690 rooted. Installed flash, worked fine, untill reboot (lib files vanished). Trying to setup the script u mentioned above.
Heres where i am so far.
1.installed "script manager"
2.copied the script above without "" marks into a file called autostart.sh
3.created folder "lib" in sdcard directly
4.copied 4 lib files to lib folder in sdcard and doublechecked the names with the names in the script (i use notepad to view the script)
5.created folder "Opt" in phone/data/
6.pasted the script file there. assuming 777 means rwx-rwx-rwx i did that for the sh file.
7.Ran SM, browsed as root to the directory /date/opt, chose the sh file, clicked "open as script/executable"
8.In SM Chose options run at boot, run as root and "executable" option
9.clicked run
Files are not copied:
says exec sh-c' /data/opt/autostart.sh'
# exec sh-c' /data/opt/autostart.sh'
cp: not found
cp: not found
cp: not found
cp: not found
unable to ch mod /data/data/com.adobe.flashplayer/.......lib file name 1.so
unable to ch mod /data/data/com.adobe.flashplayer/.......lib file name 2.so
unable to ch mod /data/data/com.adobe.flashplayer/.......lib file name 3.so
unable to ch mod /data/data/com.adobe.flashplayer/.......lib file name 4.so
no such file or directory.
Tell me what i did wrong or wat i need to do to get it copying automatcally
All help welcome.
PS. I have force2sd app on phone, ginger bread os, I didnt install app2sd software from google play, so i dont have it unless it comes inbuilt with gingerbread.
ok check file using root explorer.click to autostart.sh using root explorer and then click execute and then check files copy or not.
Sent from my LG-P500 using Tapatalk
axmanin said:
Hello,
Not an android professional. I have a P690 rooted. Installed flash, worked fine, untill reboot (lib files vanished). Trying to setup the script u mentioned above.
Heres where i am so far.
1.installed "script manager"
2.copied the script above without "" marks into a file called autostart.sh
3.created folder "lib" in sdcard directly
4.copied 4 lib files to lib folder in sdcard and doublechecked the names with the names in the script (i use notepad to view the script)
5.created folder "Opt" in phone/data/
6.pasted the script file there. assuming 777 means rwx-rwx-rwx i did that for the sh file.
7.Ran SM, browsed as root to the directory /date/opt, chose the sh file, clicked "open as script/executable"
8.In SM Chose options run at boot, run as root and "executable" option
9.clicked run
Files are not copied:
says exec sh-c' /data/opt/autostart.sh'
# exec sh-c' /data/opt/autostart.sh'
cp: not found
cp: not found
cp: not found
cp: not found
unable to ch mod /data/data/com.adobe.flashplayer/.......lib file name 1.so
unable to ch mod /data/data/com.adobe.flashplayer/.......lib file name 2.so
unable to ch mod /data/data/com.adobe.flashplayer/.......lib file name 3.so
unable to ch mod /data/data/com.adobe.flashplayer/.......lib file name 4.so
no such file or directory.
Tell me what i did wrong or wat i need to do to get it copying automatcally
All help welcome.
PS. I have force2sd app on phone, ginger bread os, I didnt install app2sd software from google play, so i dont have it unless it comes inbuilt with gingerbread.
Click to expand...
Click to collapse
Hi.
I had also faced the same issue....
The thing that u have to do is to install busy box... then everything works fine for you...
Actually this error occurs because your system could not support these unix commands (chmod, cp,etc.).. and these commands only works when you install busy box in your phone.. so can also say that busybox installs common unix utilities to the android...
Press THANKS if I help you..!!
Sent from my [email protected] OpTiMu$ On€ [email protected]
Busy box Installed
Bhawan said:
Hi.
I had also faced the same issue....
The thing that u have to do is to install busy box... then everything works fine for you...
Actually this error occurs because your system could not support these unix commands (chmod, cp,etc.).. and these commands only works when you install busy box in your phone.. so can also say that busybox installs common unix utilities to the android...
Press THANKS if I help you..!!
Sent from my [email protected] OpTiMu$ On€ [email protected]
Click to expand...
Click to collapse
I have busybox installed,
ROM: DynamiteRomJB Themed ( already rooted)
Busybox : BusyBox v1.20.1-cm9 bionic
cp not working from script
but it works as individual command (without scrpit)
Hey, i have recently been working on my own theming system, im not that good with .apk files yet, i know XML and am learning smali, but i am clueless with building..
so basically this is how my theming system works, i have a directory called /system/etc/SPRtools containing an ORS(openrecoveryscript) and a flashable .zip file called theme.zip, at the moment to start the theming system i have made a bin file that executes the following
#!/system/bin/sh
cp /system/etc/ORS /cache/recovery/openrecoveryscript
cp /system/etc/theme.zip /sdcard/
reboot recovery
now how would i go about making a .apk file that you click on and does this?
or even give me a hand on integrating it in SecSettings.apk??
oh and i also have an init.d script that deletes the copied theme.zip for the sdcard!
thanks guys!!
I have a xperia u, which has not external SD card slot..
Data partition is MUCH bigger than what I need (I'm using 500mb of 2gb) and I want to move obb files to data partition to free some space in SD partition..
Is that possible?
You might try to move the file to the data partition and then create a symlink where the file was originally.
From a shell with root access:
# ln -s /your/data/partition/filename.obb /original/place/filename.obb
I'm doing the same moving apk and dalvik-cache but I have the problem that after reboot files are still there but the app is disabled.
You can check it here: http://forum.xda-developers.com/showthread.php?t=2597924
I would suggest to try it on an app that it's not important for the system and I don't assume any responsability
P.S.
partition where you create symlink must be ext2/3/4
I think I understand how this works.. Lets say symlinks are some kind of 'windows direct access' for files that can be recognized by the system.. Am I right?
How can I figure out what format are my partitions?
I want to move /mnt/sdcard/Android/obb/com.package.name/file.obb to /data/data/com.package.name/file.obb
Assuming that partitions are in the correct format, I'll have to move files with a root file browser, then connect phone with debug on and type this:
-adb shell
-su
-ln -s /data/data/com.package.name/file.obb /mnt/sdcard/Android/obb/com.package.name/file.obb
Is that ok?
Yest that's the use, I don't know about "windows direct access" because I'm linux user
To check how is your partition formatted there are different ways from console but I just tried this app and it works:
https://play.google.com/store/apps/details?id=com.cls.partition
If both partitions are ext2/3/4 remember also to set the same user, group and permissions, you can do that copying the file from shell.
The whole sequence should look like this:
Code:
$ adb shell
$ su
# cp -a /mnt/sdcard/Android/obb/com.package.name/file.obb /data/data/com.package.name/file.obb
# rm /mnt/sdcard/Android/obb/com.package.name/file.obb
# ln -s /data/data/com.package.name/file.obb /mnt/sdcard/Android/obb/com.package.name/file.obb
cp - a to copy preserving permissions and rm to remove the file.
/data is ext4.. /mnt/sdcard is vfat D=
No symlink then
I never used it but you can still mount bind folders (not files) in fat, something similar to symlink:
Code:
$ adb shell
$ su
# mkdir /data/data/com.package.name/obb/
# cp -a /mnt/sdcard/Android/obb/com.package.name/* /data/data/com.package.name/[B]obb/[/B]
# rm -r /mnt/sdcard/Android/obb/com.package.name/*
# mount -o bind /data/data/com.package.name/[B]obb/[/B] /mnt/sdcard/Android/obb/com.package.name/
if it works you need to find a way to excute that on boot maybe with a init script.
And if there is not crucial data you could even bind all the obb folder together like:
Code:
# mount -o bind /data/data/com.package.name/[B]obb/[/B] /mnt/sdcard/Android/obb/
You can also check this thread:
http://forum.xda-developers.com/showthread.php?t=1410262
Double check everything because I never tried it
Is it possible to add init.d support to my current rom and execute a sh file from it to initialize bind on boot?
No idea sorry
You can try asking in your phone section: http://forum.xda-developers.com/xperia-u
I found how to add init.d support!
Not sure if it works for any device/rom/kernel, but it worked for my Xperia U with GingerBeanSS v3.5 (Sony GB based)..
If anyone is interested, go to this link: http://forum.xda-developers.com/showthread.php?p=32716432
Now I suppose I can create a "BindOBB.sh" with the script you mentioned before in any place of /system, and make a "bindobb" file in /system/etc/init.d/ to execute that script..
So theoretically binding folders should work on every boot!
I used windows my entire life.. I'm not completely sure about linux scripts..
Sorry about making so much questions!
I really appreciate your help!
No problem I'm glad if I can help.
Init script is usually named starting with two numbers like: 00script, 20script, 99script that should give the order scripts are excuted.
For the script itself you need to follow the sample you donwloaded so it will be something like this:
Code:
#!/system/bin/sh
#Comment
busybox mount -o bind /data/data/obb/ /mnt/sdcard/Android/obb/
This is to mount all obb folder or, if you want to mount only some, you can write them all in the script or keep a list of packages in another file and make the script read that.
Remember to make a backup and you might try first with only one package
Ok, I've understood everything (thanks google! ) and done it..
mount -o bind[...] isn't executed by init script.. Maybe a syntax error as it is my first time doing it..
The same command (without 'busybox' at first, of course) seems to work via ADB, because in SolidExplorer when I go to obb folder BEFORE running the script it is empy, but after running it all packages' folders and files appear!
Now problem is that when running a game that need obb data, it closes by itselfs (no FC nor 'missing data' warning)..
Same problem with a 3rd party TTS engine that needs obb data too..
The first problem could be that when you try to execute the command partitions are not mounted yet. Check 00 script used to test if init is enabled to mount them.
Another solution could be to use a sleep command to make the script wait some seconds but the first one should do the trick.
For the second problem check permissions. You copied files as root so you need to be sure the apps can access those files as well, in fat system there is no use of users, group and permissions but moving to ext you need to check that.
To be sure you can set obb folder and all files an directories inside as 777 (rwx for all)
Let me know if it's working
Sent from my ZP980 using Tapatalk
NeriL said:
I want to move /mnt/sdcard/Android/obb/ to /data/data/
Click to expand...
Click to collapse
you can easy create a directory bind using luckypatcher with the folder with obb and the folder where you would like to put it
remember to reboot or rescan your sd else it wont work
i use it to play asphalt and fifa
MrCrayon said:
The first problem could be that when you try to execute the command partitions are not mounted yet. Check 00 script used to test if init is enabled to mount them.
Another solution could be to use a sleep command to make the script wait some seconds but the first one should do the trick.
For the second problem check permissions. You copied files as root so you need to be sure the apps can access those files as well, in fat system there is no use of users, group and permissions but moving to ext you need to check that.
To be sure you can set obb folder and all files an directories inside as 777 (rwx for all)
Let me know if it's working
Sent from my ZP980 using Tapatalk
Click to expand...
Click to collapse
I deleted my custom init script and wrote following command at the last line of '00test' script:
busybox mount -o bind /data/obb/ /mnt/sdcard/Android/obb/
Mount then worked fine
(By the way, my custom script was named '99bindobb', so it was supposedly executed after everything else)
Also checked permissions: /data/obb/ and com.package.name folders inside it were rwxrwxrwx, but files inside were rw-------!
Changed permission of files to rwxrwxrwx..
Now everything works flawlessly at each boot!
Thank you so much! =D =D
You saved about 500Mb of my 4Gb!
And also I learned a lot about linux scripts, busybox and file system permissions!
You are welcome
For the 99 script that only define the order between the user init scripts so it still depends when they are called during boot.
Enjoy the power of Linux
Sent from my ZP980 using Tapatalk
Hi MrCrayon..! I'm here again
I changed rom and did the same as before to use /data insted of /mnt/sdcard for apps files..
This is exactly what I did:
I copied the script I used to sd (my edited 00test), changed rom (switched from Sony based GB rom to Sony Stock ICS rom), added init.d support (/data/Test.log indicates that it works), copied script to /system/etc/init.d/, changed script permissions to 777, created folders /data/AndroidData/ and /data/obb/ with 777 permissions and moved files from sd folders to custom folders in /data..
Finally updated busybox just in case
Script doesn't work, but executing 'mount -o bind' commands from ADB does! How can I fix that?
This is my init script:
#!/system/bin/sh
#Init.d Test
if [ -e /data/Test.log ]; then
rm /data/Test.log
fi
echo Ryuinferno @ XDA 2013 > /data/Test.log
echo Init.d is working !!! >> /data/Test.log
busybox mount -o bind /data/obb/ /mnt/sdcard/Android/obb/
busybox mount -o bind /data/AndroidData/ /mnt/sdcard/Android/data/
busybox set_perm_recursive(0, 0, 0777, 0777, /data/AndroidData, /data/obb)
hi guys, easy question for you hope you can help
I have a flashable zip that deletes some files from /system, and to do that in updater-script I have for example:
Code:
delete_recursive(
"/system/app/BasicDreams"
);
....now, instead of deleting them I would like to move them somewhere else in /system, for example a backup directory ( /system/__Backup ), but don't know what would I need to add in updater-script file to actually:
1. create the "__Backup" folder in /system
2. move "BasicDreams" folder to that directory
I know the unix commands I should run for that ( `mkdir /system/__Backup` and then `mv -rf /system/app/BasicDreams /system/__Backup` ) but don't know what is the correct syntax for these commands to be correctly executed in updater-script
can someone please help me? :fingers-crossed:
thanks in advance bye!
EDIT: seems I found out another way with runprogram busybox etcetc
Three .sin files from stock are needed: vendor, kernel, system.
Unsin while in .sin folder:
-d to extract all files in working directory
./unsin.exe -d
You will end up with one .img file and two .ext4 files.
kernel_X-FLASH-ALL-C93B.img
system_X-FLASH-ALL-C93B.ext4
vendor_X-FLASH-ALL-C93B.ext4
While on the linux side of things, mount the .ext4 files using: mount -o loop
make sure folder 'ExtractFirm'(name it whatever you want) exists before hand. Folder closing then opening may be needed
sudo mount -o loop system_X-FLASH-ALL-C93B.ext4 ~/ExtractFirm/
Don't forget to chown the files as yours:
sudo chown -R username:group ExtractFirm/
copy the necessary files(into Firmware_Dump folder), then issue the command below when done with the mount:
sudo umount ~/ExtractFirm
--------------------
Find AIK-Linux in the dev sections on xda
Copy kernel_X*.img to AIK extracted folder then issue:
./unpackimg.sh kernel_X-FLASH-ALL-C93B.img
Own your files:
sudo chown -R username:group ramdisk/
Then copy(into Firmware_Dump folder) the contents of ram disk, if they're some errors(usually because of sym. links) with copying them, hit skip, otherwise merge all, replace all.
Lastly, mount vendor:
sudo mount -o loop vendor_X-FLASH-ALL-C93B.ext4 ~/ExtractFirm/
The kernel copy you did previously gave you an empty vendor folder. Copy all contents of the vendor mount into this empty vendor folder(within Firmware_Dump folder).
Dont forget:
sudo umount ~/ExtractFirm
Now that you have extracted firmware contents, you can run extract-files.sh for lineage/custom build:
~/lineageos/device/sony/poplar_dsds$ ./extract-files.sh ~/location of extracted contents/
These are just reference notes for everyone, I'm sure I'll need them again.
thanks @derf elot
great, thanks for the write up we can redirect people here if the question of how to extract files comes up again - which I'm sure it will
Sent from my Sony Xperia XZ1 Compact using XDA Labs
derf elot said:
great, thanks for the write up we can redirect people here if the question of how to extract files comes up again - which I'm sure it will
Sent from my Sony Xperia XZ1 Compact using XDA Labs
Click to expand...
Click to collapse
Indeed it will.
Great guide! I was thinking about automating stuff, but e.g. the copy works best when not done from the shell but from the file manager. The ignore, replace and merge all works perfect there.
Before anyone tries, here my failed attempts:
- Using 7z to extract the ext4 files, works somehow but fails to keep symlinks. But it would be faster...
- `cp -a` doesn't replace symlinks by actual folders and has some errors shown and some files/folders removed. Not sure if safe... So use file manager
- When using a VM make sure the AIK and the final folder are on ext4 filesystems, not shared/mounted from Windows hosts. Avoids failures with symlinks shown as "permission denied"
Edit: Ok I had failures and got an update to the guide:
- Start with the kernel extraction
- Then extract system*.ext4 to the system folder inside the above folder
- Then extract vendor.*ext4 to the vendor folder inside the above folder