Related
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
Hi to all.
I have a small problem, and after struggling with it and searching on internet and xda, I haven't found a solution.
I have my Contacts.apk, which, using apktool I decompiled and edited some .xml. I have compiled again with apktool, and having my Contacts2.apk, without META-INF directory.
I tryed signing my apk with signapk.jar:
java -jar /home/aitor/Descargas/signapk.jar /home/aitor/Descargas/certificate.pem /home/aitor/Descargas/key.pk8 Contacts2.apk Contacts.apk
and when I try to install my signed Contacts.apk i get the following error:
[email protected]:~/Descargas/updateContacts/system/app$ adb install -r Contacts.apk
2717 KB/s (604449 bytes in 0.217s)
pkg: /data/local/tmp/Contacts.apk
Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]
Searching, I think it's some problem of shared uuid, and the solutions I have found is that I have to resign every apk that shares the same uuid.
Other solutions I have found say that copying the META-INF folder of the original apk to the compiled .apk might solve the problem (that means, copying the original certs). I have tryied also this, but with no result:
[email protected]:~/Descargas/updateContacts/system/app$ adb install -r Contacts.apk
2724 KB/s (584945 bytes in 0.209s)
pkg: /data/local/tmp/Contacts.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
Again, with no success.
So, my question is, is there a way of signing Contacts.apk without having to sign every apk with the same uuid? If not, how can I find every apk (in order to resign them) with the same uuid?.
Thanks for the help!
PS: I'm not sure if this should go into Android development and Hacking subforum. If so, to any mod, please, move it.
thanks in advance!
d
aitorTheRed said:
I have my Contacts.apk, which, using apktool I decompiled and edited some .xml. I have compiled again with apktool, and having my Contacts2.apk, without META-INF directory.
I tryed signing my apk with signapk.jar:
java -jar /home/aitor/Descargas/signapk.jar /home/aitor/Descargas/certificate.pem /home/aitor/Descargas/key.pk8 Contacts2.apk Contacts.apk
and when I try to install my signed Contacts.apk i get the following error:
[email protected]:~/Descargas/updateContacts/system/app$ adb install -r Contacts.apk
2717 KB/s (604449 bytes in 0.217s)
pkg: /data/local/tmp/Contacts.apk
Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]
Searching, I think it's some problem of shared uuid, and the solutions I have found is that I have to resign every apk that shares the same uuid.
Other solutions I have found say that copying the META-INF folder of the original apk to the compiled .apk might solve the problem (that means, copying the original certs).
So, my question is, is there a way of signing Contacts.apk without having to sign every apk with the same uuid? If not, how can I find every apk (in order to resign them) with the same uuid?
Click to expand...
Click to collapse
Contacts.apk is one of the system apps that is signed with the shared key. As far as I know, that does mean you will have to resign all of the apps which are also signed with that same shared key. To find out which ones are, first make a new directory to work in on your computer, open a terminal, and cd to the directory you just created. Now, with you phone attached:
Code:
adb pull /system/app/ .
for i in *; do echo $i; unzip -q $i -d tmp; keytool -printcert -v -file tmp/META-INF/CERT.RSA | grep SerialNumber; echo; rm -r tmp; done
Now examine the output for any system apps that share the same serial number as what it lists for Contacts.apk. Those will be the apps that are signed with the shared key. Now, delete the non-shared key apk files from your current folder leaving just the ones you need to resign. Also add your modified Contacts.apk that is unsigned to this folder. Then you should be able to sign them all at once, push them back to your phone, assign the correct permissions, and wipe the app caches in recovery:
Code:
mkdir signed
for i in *; do java -jar /home/aitor/Descargas/signapk.jar /home/aitor/Descargas/certificate.pem /home/aitor/Descargas/key.pk8 $i signed/$i; done
cd signed
adb remount
adb push . /system/app/
adb shell chmod 644 /system/app/*
adb reboot recovery
##in recovery, wipe cache and dalvik-cache then reboot##
For future reference, system apps should always be pushed to the phone and not not installed as it will try to install it to /data/app which you don't want. Hope that helps but post back if something isn't clear or something gives you errors.
MongooseHelix said:
Contacts.apk is one of the system apps that is signed with the shared key. As far as I know, that does mean you will have to resign all of the apps which are also signed with that same shared key. To find out which ones are, first make a new directory to work in on your computer, open a terminal, and cd to the directory you just created. Now, with you phone attached:
Code:
adb pull /system/app/ .
for i in *; do echo $i; unzip -q $i -d tmp; keytool -printcert -v -file tmp/META-INF/CERT.RSA | grep SerialNumber; echo; rm -r tmp; done
Now examine the output for any system apps that share the same serial number as what it lists for Contacts.apk. Those will be the apps that are signed with the shared key. Now, delete the non-shared key apk files from your current folder leaving just the ones you need to resign. Also add your modified Contacts.apk that is unsigned to this folder. Then you should be able to sign them all at once, push them back to your phone, assign the correct permissions, and wipe the app caches in recovery:
Code:
mkdir signed
for i in *; do java -jar /home/aitor/Descargas/signapk.jar /home/aitor/Descargas/certificate.pem /home/aitor/Descargas/key.pk8 $i signed/$i; done
cd signed
adb remount
adb push . /system/app/
adb shell chmod 644 /system/app/*
adb reboot recovery
##in recovery, wipe cache and dalvik-cache then reboot##
For future reference, system apps should always be pushed to the phone and not not installed as it will try to install it to /data/app which you don't want. Hope that helps but post back if something isn't clear or something gives you errors.
Click to expand...
Click to collapse
Thanks! I will try it asap and give some feedback about the results!
aitorTheRed said:
Thanks! I will try it asap and give some feedback about the results!
Click to expand...
Click to collapse
Something I hadn't thought of that you might want to try before taking the more extreme approach I described above...
Use 7zip to open both the original and modified Contacts.apk. Take the META-INF folder from the original(along with AndroidManifest.xml if it wasn't modified) and copy/place in the modified version. It will now contain the original signature and might work now.
Code:
adb remount
adb push built/Contacts_modified.apk /system/app/Contacts.apk
adb shell chmod 644 /system/app/Contacts.apk
adb reboot recovery
##in recovery, wipe cache and dalvik-cache then reboot##
Make sure you have a backup copy of the original Contacts.apk somewhere in case you need to restore it.
And? Did this method work? I am asking, because when I try to re-install the HtcFacebook.apk (which is also a system app) I get the same error:
INSTALL_PARSE_FAILED_NO_CERTIFICATES
But before I start messing with my /system/app folder I would like to know, if it worked in your case. Thanks in advance!
I had a similar problem with another Android core app (Stk.apk). I tried the hack suggested by MongooseHelix - replacing META-INF and the manifest - and it worked
MongooseHelix said:
Something I hadn't thought of that you might want to try before taking the more extreme approach I described above...
Use 7zip to open both the original and modified Contacts.apk. Take the META-INF folder from the original(along with AndroidManifest.xml if it wasn't modified) and copy/place in the modified version. It will now contain the original signature and might work now.
Code:
adb remount
adb push built/Contacts_modified.apk /system/app/Contacts.apk
adb shell chmod 644 /system/app/Contacts.apk
adb reboot recovery
##in recovery, wipe cache and dalvik-cache then reboot##
Make sure you have a backup copy of the original Contacts.apk somewhere in case you need to restore it.
Click to expand...
Click to collapse
Yes. This method works if AndroidManifest.xml has not been modified.
If AndroidManifest.xml was modified, the signing process becomes complicated. Can I resign the whole ROM using the signapk? This menas: do not use Samsung signature anymore.
.
SunnyOK said:
Yes. This method works if AndroidManifest.xml has not been modified.
If AndroidManifest.xml was modified, the signing process becomes complicated. Can I resign the whole ROM using the signapk? This menas: do not use Samsung signature anymore.
Click to expand...
Click to collapse
Another trick that usually works is changing the install location in the manifest. Then resign it.
Hey, can someone tell me how to create a script to run a terminal command. I looked up google but didn't find any good results.
Open a new file, and write:
Code:
#!/system/bin/sh
your_command
another_command
another_one_xD
Save the file with sh extension, and run your script as follows:
Code:
su #optional, if your script needs root access.
sh yourscript.sh
If you get an error, probably need to grant permissions to your script, so:
Code:
chmod +x yourscript.sh
And try again.
Granting su is
$ su
Correct?
And thanks for the reply :]
Sent from my XT862 using Tapatalk 2
Yep
When you set the permissions, you only have to do that once right?
Yes.
I'm trying to build a script to move pics and video from my internal storage to external storage. I have the script made and on my phone but when I run it, I get an error: "failed on /storage/sdcard0/DCIM/Camera/*.jpg" - Cross-device link . Any idea what that means?
mmurphmsu said:
I'm trying to build a script to move pics and video from my internal storage to external storage. I have the script made and on my phone but when I run it, I get an error: "failed on /storage/sdcard0/DCIM/Camera/*.jpg" - Cross-device link . Any idea what that means?
Click to expand...
Click to collapse
Move (mv) only move the directory entry, not the actual data. Because of this, you can not move files from one disk to another (e.g. from internal to sdcard), hence the cross device error. You'll have to copy and then delete the original.
kuisma said:
Move (mv) only move the directory entry, not the actual data. Because of this, you can not move files from one disk to another (e.g. from internal to sdcard), hence the cross device error. You'll have to copy and then delete the original.
Click to expand...
Click to collapse
That seems to have done the trick but I have found another issue. When going into multiple directories (/storage/sdcard0/DCIM/Camera) from the script or even the root directory, I get a No Such file or directory error. But I can CD into that directory and manually cp and rm the files. Any idea why that is happening?
mmurphmsu said:
That seems to have done the trick but I have found another issue. When going into multiple directories (/storage/sdcard0/DCIM/Camera) from the script or even the root directory, I get a No Such file or directory error. But I can CD into that directory and manually cp and rm the files. Any idea why that is happening?
Click to expand...
Click to collapse
You've simply done something wrong. Show us the script.
Here is the script I created:
#!/system/bin/sh
#
#
#
#
#Move Pictures from Internal Storage to External Storage media
cp /storage/sdcard0/DCIM/Camera/IMG* /storage/sdcard1/DCIM/Camera
rm /storage/sdcard0/DCIM/Camera/IMG*
#
#
#
#Move Videos from Internal Storage to External Storage media
cp /storage/sdcard0/DCIM/Camera/VID* /storage/sdcard1/DCIM/Camera
rm /storage/sdcard0/DCIM/Camera/VID*
I put the script in the root directory and run it from there. Its permissions are rwxrwxr
mmurphmsu said:
Here is the script I created:
#!/system/bin/sh
#
#
#
#
#Move Pictures from Internal Storage to External Storage media
cp /storage/sdcard0/DCIM/Camera/IMG* /storage/sdcard1/DCIM/Camera
rm /storage/sdcard0/DCIM/Camera/IMG*
#
#
#
#Move Videos from Internal Storage to External Storage media
cp /storage/sdcard0/DCIM/Camera/VID* /storage/sdcard1/DCIM/Camera
rm /storage/sdcard0/DCIM/Camera/VID*
I put the script in the root directory and run it from there. Its permissions are rwxrwxr
Click to expand...
Click to collapse
Does /storage/sdcard1/DCIM/Camera exists? Try add:
mkdir -p /storage/sdcard1/DCIM/Camera
... to the script before you begin the copy. This will create the destination(s) in case of non-existent.
Also, your cp and rm command will fail with this error if there aren't any files named both IMG* and VID* in the source directory.
kuisma said:
Does /storage/sdcard1/DCIM/Camera exists? Try add:
mkdir -p /storage/sdcard1/DCIM/Camera
... to the script before you begin the copy. This will create the destination(s) in case of non-existent.
Also, your script will fail with this error if there aren't any files named both IMG* and VID* in the source directory.
Click to expand...
Click to collapse
Yes it exists. I can navigate to the directory in Root Explorer. I tried running the script in Root Explorer but it didn't move the two pics i have in the /storage/sdcard0/DCIM/Camera directory to the /storage/sdcard1/DCIM/Camera directory.
mmurphmsu said:
Yes it exists. I can navigate to the directory in Root Explorer. I tried running the script in Root Explorer but it didn't move the two pics i have in the /storage/sdcard0/DCIM/Camera directory to the /storage/sdcard1/DCIM/Camera directory.
Click to expand...
Click to collapse
And you DO have files named IMG* and VID* in your source directory?
kuisma said:
And you DO have files named IMG* and VID* in your source directory?
Click to expand...
Click to collapse
Yes. I took to pictures and then tried running it and it still fails. I wonder if its not working cause I'm on CM10?
mmurphmsu said:
Yes. I took to pictures and then tried running it and it still fails. I wonder if its not working cause I'm on CM10?
Click to expand...
Click to collapse
You realise that even with pictures in the directory, you'll still get this error from the next operations you try executing on the videos? Still, the script should a) still copy the images, and b) not terminate due to this error anyway (i.e. consider it a warning).
But you say the images are not copied. Quite odd, I'd say.
Add a path to the script (export PATH=/system/bin:/system/xbin plus the places you need), add a test "echo Running" to make sure the script actually is launched by Root Explorer. And add +x permissions for all, even "other". You can also add:
echo /storage/sdcard0/DCIM/Camera/IMG*
... before the first copy. This will show you what files matching your expression.
I'll just manually move them. I was just hoping for an easier way until CM10 is enabled to save pictures to the external SD card.
mmurphmsu said:
I'll just manually move them.
Click to expand...
Click to collapse
Take this as an opportunity to learn more about script programming, I'd say.
Experience is what we get when we expected something else.
kuisma said:
Take this as an opportunity to learn more about script programming, I'd say.
Experience is what we get when we expected something else.
Click to expand...
Click to collapse
I do a little in UNIX at work that's why I tried this. I really want to learn how to program for actual Android apps. Just need to find something to help me get started, as I have no clue where to start.
Where save the file ?
Hello
I'm french and don't speak english very well ....
I try to do what is explain in this topic ( for tethering with a Sony Ericsson KYNO V - ics 4.0.4 with root access ....
I don't understand where to save the file with sh extension
What i want to run is : #!/system/bin/sh
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o rmnet0 -j MASQUERADE
My script is :
su root
sh scripttether.sh
Thank you very much for your help
BR
RoberGalarga said:
Open a new file, and write:
Code:
#!/system/bin/sh
your_command
another_command
another_one_xD
Save the file with sh extension, and run your script as follows:
Code:
su #optional, if your script needs root access.
sh yourscript.sh
If you get an error, probably need to grant permissions to your script, so:
Code:
chmod +x yourscript.sh
And try again.
Click to expand...
Click to collapse
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!!
Hi Everyone!
I want to make a .sh file which I am going to flash by CWM. I need your help in that.
1) In updater-script, when I extract it to /tmp, what permissions should I give to .sh file by set_perm?
2) I want it to execute "tar" command ("su" command that is root is not required) to operate on file from sdcard (/sdcard).
Can anyone tell me what should be the contents of .sh file.
I don't know much but I created this, and gave (0,0,0777) permissions but I am not getting required result. Please correct my script.
Code:
#!/sbin/sh
#Script to Odinize boot.img by [email protected] 2014
cd sdcard
tar -cf boot-sgy.tar boot.img
Above command works when I type it from terminal emulator, but does not work when flashed.
Please help me, I don't know anything about .sh but I have good knowledge of terminal commands & edify commands.