[Script] VERY simple application backup script for ROM upgrades [not for newbies] - Android Software Development

Hi,
I'm new to the business and I spent some time to learn the environment trying different applications and different approaches for almos every action I took. Today, I have not much bigger knowledge, but I finally decided to take few things in my own hands because existing software is not fulfilling my wishes.
I started with this simple script which eases the pain of reinstalling all applications after ROM upgrade. There are few such tools already, but I found those quite bloated with unnecessary thing for my own approach.
With this script I assume:
1. There is/was SSHDroid installed (or any tool with busybox and you can access shell command line) both in old and new ROMs and your ROM have bash installed in /system/bin/.
2. Backup/restore operation includes only INTERNALLY installed applications, it completely ignores SYSTEM and SDCARD installed ones.
3. This is TEMPORARY backup so it should be as fast as possible not caring about occupied space (!). Althought I added -zip parameter to enable compression if you are running out of space on your sd.
4. Installed ROM is clean with no additional apps installed (excluding those needed by the script)
5. You have basic knowledge about bash scripting, because I take NO RESPONSIBILITY of the script behavior or data loss it can do.
So, basically it is simple. It runs like this:
1. On old ROM type: sbackup -backup
2. Flash your ROM
3. On new rom type: sbackup -restore
Just like that. The applications data is tar'ed in one file per application so if you want to get rid of any, just delete it from backup directory. The directory name is same as script name on sdcard but you can change it adding a parameter without a '-' sign at runtime (first non-option parameter is treated as backup directory path). The file is zipped because this forum disallows files without an extension so... it is zipped ;D
It was tested on my fresh LeeDroid 3.3.3 GB AFTER i installed some apps. I backed them up and then restored. All seems to be perfect right now, but I will test it more thoroghly very soon because I'm planninig to have CM7 based ROM too just to choose that I need Sense or not (two nandroids for fast switch weekly ;P).
With this script and MyBackup functionality of backing up contacts, sms, history and similar it should be quite complete approach to restore all the data needed on the fresh ROM. In the future maybe I will look at the MyBackup part too. Maybe.
Feel free to comment, use, suggest or anything you like, and have fun ;P.

How do I run this script? Do i run it from sdcard or from system /bin? When i do it from system bin it says cannot create directory. When i run it from sdcard/sbackup it says permissions denied?
Sent from my ADR6400L using Tapatalk

jgrimberg1979 said:
How do I run this script? Do i run it from sdcard or from system /bin? When i do it from system bin it says cannot create directory. When i run it from sdcard/sbackup it says permissions denied?
Sent from my ADR6400L using Tapatalk
Click to expand...
Click to collapse
And thats why I mentioned in topic about not being a newbie (and I meant not forum newbie but more a linux newbie). The thing is, it's a simple script - without any user-proof capabilities, comments inside or something BUT...
But ok, I will try to help you run it. First of all, you have to set permissions to the script. It has to have executable permission to be run by the system (and I mean filesystem permission). This can be done by chmod instruction of busybox. Most of the times it's done like this:
chmod 755 filename
This is a reason of not running form sdcard if your sdcard is NOT ext filesystem (it is usually windows fat filesystem not to generate problems with reading it under windows).
Second thing to run is to have /system/bin/bash because first line of the script (a comment like this: #!/system/bin/bash) instructs busybox to execute script using bash. This can be simply changed by modifying this line, but you have to remember that changing the shell executing script have consequences. Differens shells have sometimes different syntax, althoght i wrote this script simply so it should run on most of them, especially sh.
Third thing is to have write permissions to the directory in which the backup will be created. In original version of the script it is /sdcard, because backup is made in /sdcard/sbackup. So, you have to check it (second error - problems with creating directory).
And a last tip - it can be run from ANYWHERE. Even if your partition does not alolow executing, you can do it like this:
bash-3.2# /sdcard/test
bash: /sdcard/test: /system/bin/bash: bad interpreter: Permission denied
bash-3.2# . /sdcard/test
OK
bash-3.2#
First try does not succeded, but second did. The trick is a dot which means to execute file with a shell not caring about why or permissions.
And thats most simple introduction I could write. It applies to ANY script you want to run.
Please anyone - if you want me to help, paste your results here because without a precise error message it can be very hard to deduce what caused for example permission denial or anything usual.
For now, I won't add any more error handling, but if there will be more users caring about, I will add it.

Related

AppBack - App Backup/Restore Via ADB

Hey everyone,
I just whipped up a quick Java based app that you can back up and restore your apps that you installed (the ones in the /data/app and /data/app-private dirs) It also backs up the settings for those apps.
I'll be adding in saving settings for apps that are in system/app later, but I thought this one was ready for a release.
You must have the /tools dir of your SDK in your path var in order for this to work.
Please verify that adb is detecting the device by running "adb devices" and make sure this there.
Un-archive the the zip and it will have a AppBack-x.x.class file in it
Usage is for backup run "java AppBack backup"
And for restore is "java AppBack restore"
This will create a dir "appback" with two dirs in it, "backup" contains the apk's and "settings" contains the app data.
If there's something you'd like to see, just post and I'll do as much as humanly possible to add it in
Note: Error handling is nasty, and future versions will be nicer (shocker isn't it )
(also, when you run it first you might get a operation not permitted error, just run it again and it *should* resolve itself, I'll fix it in the next release.)
I'm writing this right about when I should be sleeping, so I probably forgot something lol, but yeah, if you encounter an error, please report it.
Thanks alot!
Aakash Patel
Oh and btw, you might have to rename the class file to "AppBack.class"...
Nice, this should be handy, will definitly check out on my next flash. Does it handle setting the correct user owner/permissions on the folders in the data directories on a restore?
This is great, but maybe in the future let user choose what apps to backup and their settings.
Oh haha I forgot to mention that important part, you have to have root! >_<
so uh.. where does it create the appback directory, and how exactly are you supposed to run it... from the device or from a console or what.. i think i ran it but im not sure and im looking all over for a appback directory

Post-Root Setup Instructions?

I know many of us are new to the whole rooting thing. I'm coming from the Windows Mobile world of custom ROMs, kitchens, etc., but I do have some linux experience. However, I can't for the life of me figure out how to do a lot of what comes "standard" in MoDaCo's ROM. Obviously it would be easier to simply install Paul's ROM and be done with it, but I'd really like to learn how to do it on my own too.
So, that being said, maybe we can pull together some tutorials, guides, and/or links to existing guides which explain how to go about setting up our Rooted phones manually. Here are some of the built-in mods the MoDaCo ROM comes with which would be nice to be able to do manually or on a one-off basis:
Included in MoDaCo 1.1 'core':
Rooted with 'adb remount' permission and superuser APK
A2SD included (fully automatic thanks cyanogen!) create a EXT2 partition as your second partition to use. dalvik-cache remains on device.
Added Jbed Java
Added Dropbear SSH running by default, check 'About' screen for password (port 2222). You can now remove this by running /system/bin/removedropbear.sh
Added Notes app from Dragon
Added Spare Parts (run it and switch the 2 animation types to 'fast' for an even better experience!)
Added android-wifi-tether 1.60 pre3 (props to the developer, this is a great app!)
Added WiFi Status indicator, with kind permission of Andrew Schwimmer
Added busybox 1.15.2 tweaked such that 'get information' in Swapper now works as desired
Added nano 2.09 text editor for use in shell mode
Added parted and sqlite tools
Added terminfo and settings to boot.img to allow nano etc. use
Added files required for Debian linux including loxley's updated bootdeb script
Moved Quickoffice to data partition to allow easy uninstall
Moved Google Maps and Google Voice Search to data partition to allow easy update
Silenced boot sound (it's still there and can be reactivated with a file edit)
Click to expand...
Click to collapse
*********
*********
!Working!
Wireless Tethering:
http://android-wifi-tether.googlecode.com/
Go to the "Downloads" tab and download version 1.61-pre
!Not Working!
Superuser Whitelist App
I found two threads here that describe how to install Superuser.apk.
http://forum.xda-developers.com/showthread.php?t=582140
http://forum.xda-developers.com/showpost.php?p=4897587&postcount=5
Using the first one, I was able to get the files onto the phone and I used the chmod commands found in the second file in the hopes this would work; however, whenever I try to use it, nothing happens. The ES File Explorer, in particular, used to work with MoDaCo. When I'd try to browse as root, Superuser would pop-up and ask if I wanted to grant the app permissions. Now it just hangs there (black screen) and ES File Explorer says I don't have root access. Other Root apps work fine though, it's just they don't seem to be dependant on Superuser Whitelist.
'adb remount' permission
This requires that the default.prop file be edited from ro.secure=1 to ro.secure=0. Unfortunately, I can't seem to get this file to stick. If I use the mv command using adb shell, I get some kind of permissions error. If I use the cp command when booting into the recovery menu and using adb shell, the file reverts to the original on boot. Or maybe it's simply not being overwritten, but not throwing any errors either
I think I may have found a thread that will help with the default.prop changes. Looks like this has to be done in the recovery.img which apparently overwrites any modifications in the root of the device on each reboot. I'll post an update if/when I figure it out.
HOWTO: Unpack, Edit, and Repack Boot Images
http://forum.xda-developers.com/showthread.php?t=443994
The adb remount permission issue is driving me crazy. Please keep us updated if you figure out a way of resetting that without installing a new ROM.
I ended up modifying one of the MoDaCo update scripts to set up ADB Remount, Superuser.apk, and Busybox. It's been working fine for me, but be sure to do a backup before you apply the update. Check it out here:
http://forum.xda-developers.com/showthread.php?t=593952

[SOLUTION] Hastarin's kernel - Undervolting

As I'm sure you realise (considering you've clicked on this thread), hastarin's new kernels do not enable undervolting by default.
After struggling to work out how to undervolt the kernel and asking for unforthcoming help in so many places, eventually a chap called tyween helped me out.
Here is a script which you can run to enable undervolting. Bear in mind that the settings revert to normal every time android restarts, which means you need to do this every time you reset your phone
If you need a faster way of running the scripts than a terminal, there is a program called SL4A which provides a GUI:
http://code.google.com/p/android-scripting/
init.d script
Assuming the rom you use supports init.d scripts, why wouldn't you just write a init.d script and place it in the \system\etc\init.d\ folder? No need re-run scripts every time you restart.
2000impreza said:
Assuming the rom you use supports init.d scripts, why wouldn't you just write a init.d script and place it in the \system\etc\init.d\ folder? No need re-run scripts every time you restart.
Click to expand...
Click to collapse
Maybe because I don't know how to :S lol.
If you do, then I'm sure it would help a lot of people including me if you posted some instructions.
(whenever I wrote a script in notepad and transferred it to my phone it didn't work, I had to write the script from scratch in that SL4A program. This is one factor which made experimentation much more difficult)
I've always used notepad++ to write simple scripts. Never used regular notepad for scripts before.
http://notepad-plus-plus.org/
I copied and pasted your undervolt script into the file. You should be able to use notepad++ to open and edit the voltages.
Copy the script to the following folder:
1.
\sdcard\android\root\system\etc\init.d\
or, if the rom does not have root folder support
2.
\system\etc\init.d\
pkchips said:
(whenever I wrote a script in notepad and transferred it to my phone it didn't work, I had to write the script from scratch in that SL4A program. This is one factor which made experimentation much more difficult)
Click to expand...
Click to collapse
Notepad sucks (the worst part of Windows 7) - it ends each line with Carriage Return and Line Feed (ASCII 13 + 10). Linux shells are usually thrown off by this, as they expect only line feed (ASCII 10).
I recommend you use Notepad++ always (you'll find it standalone, or in both PortableApps and LiberKey). If the status bar at the bottom shows "DOS", you can convert the line endings to UNIX.
2000impreza said:
I've always used notepad++ to write simple scripts. Never used regular notepad for scripts before.
http://notepad-plus-plus.org/
I copied and pasted your undervolt script into the file. You should be able to use notepad++ to open and edit the voltages.
Copy the script to the following folder:
1.
\sdcard\android\root\system\etc\init.d\
or, if the rom does not have root folder support
2.
\system\etc\init.d\
Click to expand...
Click to collapse
no root folder on sdcard and trying to paste this file into init.d folder doesn't work, never shows up after tryng to move the file (doesn't move from sdcard where am trying to transfer it over), any ideas?
technocat said:
no root folder on sdcard and trying to paste this file into init.d folder doesn't work, never shows up after tryng to move the file (doesn't move from sdcard where am trying to transfer it over), any ideas?
Click to expand...
Click to collapse
You can use ADB (which is part of the Android Developer Kit.
You need root access and then use ADB PUSH <sourceloc/file> </system/etc/init.d/filename>
This move the file to system memory.

Auto mount or symlink at boot

Hello, is it possible to do that ?
Regards
Sure, you have a few options.
The best way (hardest):
-requires root and knowledge of the boot.img and ramdisk partitions of Android
-create the symlink or mountpoint by adding the necessary lines the /init.rc file.
Next best way (not hard if you have init.d support):
-requires root
-requires init.d support
-simply write a script to create your symlink/mountpoint, name it appropriately, and place it in the /system/etc/init.d directory.
-with init.d support, this will automatically run the script at boot and set the parameters you've outlined in said script.
The "other" method (avoid this if possible since it relies on loading an app on boot):
-requires root
-download Script Manager from the play store
-write a script to create your mountpoint or symlink
-configure Script Manager to execute the script on boot.
Hello
I found /init.rc, also found init.00.rc and init.01.rc, but i guess we are talking about the first one (init.rc)
I wasn't able to edit it with a text editor on my tf101, do i need something i don't have to edit it ? Or notepadd++ will be enough ?
In case i fail completly with this, is tasker able apply the line for me too ?
Thanks you for your time.
Regards
Magissia said:
Hello
I found /init.rc, also found init.00.rc and init.01.rc, but i guess we are talking about the first one (init.rc)
I wasn't able to edit it with a text editor on my tf101, do i need something i don't have to edit it ? Or notepadd++ will be enough ?
In case i fail completly with this, is tasker able apply the line for me too ?
Thanks you for your time.
Regards
Click to expand...
Click to collapse
The /init.rc can't be directly modified that way. Everything in the root filesystem "/", as well as the kernel zImage, are loaded at boot from the boot.img image. Therefore, any changes you make will just be reverted when you reboot because it reloads the original from the boot.img image. In order to modify /init.rc, you must pull your boot.img and then extract the files from it. Now you can add the necessary lines to it. After that, you re-combine everything back into the boot.img, and push it back to your device.
If all that sounds unfamiliar to you, you will have some reading to do. Most of this will need to be done on a linux machine too.
What ROM are you running? If you have init.d support, that would be the most straightforward way to accomplish your goals.
I'm running asus' rom .24 on a tf101
I don't know if it support init.d, didn't found this file on my device.
Regards
You can also use an app from here, XDA, called directory bind. It all depends what you're looking to do with those symlinks.
Sent from my Sprint Evo View 4G (PG41200) using Xparent Purple Tapatalk 2
Hello, i plan to move game data to sdcard and symlink it to the old internal place.
Also plan to symlink some folders to the movie folder
Regards
Then directory bind app is designed for just your need. All these solutions require rooting your device.
Sent from my HTCEVOV4G using Xparent Purple Tapatalk 2
I will look at this, thanks.
Directory bind run during boot or after boot ?(little delay before things get re symlinked ?)
Regards

[MOD][SCRIPT] Get More Storage by Relocating Dalvik Cache!

DISCLAIMER: YOU AGREE TO TAKE FULL RESPONSIBILITY FOR YOUR DEVICE IF YOU PROCEED.
The original thread (http://forum.xda-developers.com/moto-g/general/mod-save-data-space-cache-partition-t2942765) was getting to cluttered up with development and testing so I decided to start a new thread with the "finished" product. The original thread will be renamed to Q&A/Development. We might even ask for the old thread to be closed down. (up to @Bert98, the thread's creator.)
Moto G's internal eMMC card has a ~600Mb partition called /cache, which is not used since the apps' cache is stored in /data, so the latter fills up and the first one stays empty.
Owning a 8Gb model, having 600Mb not available for storage really bugged me, because my phone's memory (/data partition) was always full because it's a 5.7Gb space shared between apps and microSD files.
Now, it may not work for you if:
a) you have A LOT of apps installed.
And by "a lot", I mean more than 90-100 apps, but if you have a 8Gb model, you probably don't
b) you're running ART (this is default in lollipop and newer)
Since ART uses a lot more space than dalvik, the space in the /cache partition probably won't be enough. When I was running ART, it used 1Gb more than dalvik.
Original post by @Bert98
Click to expand...
Click to collapse
This was tested on my moto g 16GB which is running RetailUS_4.4.4 kitkat with CWM recovery. The custom ROM procedure was tested on the same phone but with cm11 Nightly installed.
Prerequisites:
1. You must have "adb root" functioning. If you don't head to this thread: http://forum.xda-developers.com/showthread.php?t=1687590 and there is a free download link at the bottom of the post.
Download and install the apk on your phone. Open up adbd insecure (the new app) and grant it superuser rights PERMANENTLY. Check the box that says "enable insecure binary" and make sure to check the box
that says "enable at boot."
2. You must have a recovery that can accept adb shell commands.
3. Root Access Duh?!
4. A windows machine capable of running batch files.
5. A decent text editor, notepad will work but notepad++ is strongly recommended. (Only needed if you are using STOCK ROM procedure)
Please, please make a nandroid backup before you continue!!!!
Stock ROM procedure:
Read the directions very carefully and then read them again, before continuing.
1. Download the cachemover_v1.3.zip from: LINK REMOVED DUE TO SCRIPT ISSUES.
2. Extract the contents.
3. Connect device to PC and navigate to the extracted folder.
4. Double click/Run the cachemover_Stock.bat
5. Follow the onscreen instructions until you get to the part where it says to edit a file.
6. About halfway through the script it will pull a file called "init.qcom.post_boot.sh" to the folder.
7. Open it with a TEXT editor and navigate to about line 487 (Might be different for 8gb model). Look here for a better understanding: https://www.dropbox.com/s/jr5lyl5s5i2jtpg/where to paste code.PNG?dl=0
8. Start a new line and paste this code in the file: (Refer to the image above for help)
Code:
chmod 655 /cache
chmod 655 /cache/dalvik-cache
chmod 655 /cache/dalvik-cache/*
9. Make sure to save the file in the same folder as the cachemover_Stock.bat
10. Press any key to continue on the script and let it do its thing.
11. It will reboot several times and land you on the home screen/lock screen.
12. If the script hangs after a reboot, you need to unlock the device to reestablish a connection with your computer.
13. There might be one or two force closes but once you close the notifications they will not come back.
Custom ROM procedure:
USE THIS FOR ROMS THAT DO NOT REMOUNT OR CHANGE PERMISSIONS OF /CACHE ON BOOT
1. Download the cachemover_v1.3.zip from: https://www.dropbox.com/s/bzj34g4q1s61ojz/cachemover_v1.3.zip?dl=0
2. Extract the contents.
3. Connect device to PC and navigate to the extracted folder.
4. Double click/Run the cachemover.bat
5. Follow the onscreen instructions.
If anything goes wrong:
Go to recovery, wipe cache, then wipe dalvik-cache and reboot. This should get your device back to how it was.
(If you used STOCK ROM procedure)
The script made a backup of the "init.qcom.post_boot.sh" file to /sdcard/init_backup
You can restore the shell script to /system/etc/ via shell commands or by using a root browser. To restore permissions:
Code:
chmod 740 /system/etc/init.qcom.post_boot.sh
chown root:root /system/etc/init.qcom.post_boot.sh
Custom ROM procedure already has a restore script!
I am currently working on an auto restore script for stock and that will be relased soon, hopefully! :good:
Changelog:
v1.0 - First stable release. Does not work on STOCK ROM.
v1.1 - Added a restore script.
v1.3 - Added support for STOCK ROM. There are still a few bugs.
How it works?!?!
Coming soon...
Huge thanks to @Bert98 and @dd043
Hit the thanks button if it worked! I went through about 50 factory resets, and reflashed the ROM about 25 times, and put about 10 hours of work into this script! Really motivates me for future projects. :laugh:
Thanks for your help man and effort.
I encountered a problem, everything works up until my device boots in CWM to fix permissions, then just sits there doing not alot I don't even see the option in my CWM.
Any ideas? cheers
Sent from my XT1032 using XDA Free mobile app
When it reboots to cwm unplug the cable and replug it, if it hangs just type these commands manually from a command window.
chmod 655 /cache
chmod 655 /cache/dalvik-cache
chmod 655 /cache/dalvik-cache/*
reboot
If this does not work you may ned to go into mounts & storage in the cwm menu and click mount /cache. Then try the commands again.
I'm having some issues on stock.
I thought 0655 fixed everything but no, I can't install any app after moving the dalvik-cache to /cache. I tried chmoding 0777 on the new cache folder, on /cache itself, to no avail.
Code:
E/dexopt cannot open '/data/dalvik-cache/[email protected]' for output
Anyone can confirm it's not only my device? And/or can help find a fix?
Also does someone knows how to execute commands on a particular init step? Real init.rc scripts can do:
Code:
on post-fs-data
mount -o bind /cache/dalvik /data/dalvik-cache
It there was a way to achieve the same from post_boot/init.d we could mount -o bind /cache/dalvik /data/dalvik-cache and all permissions issues would disappear as well as the need for symlink.
You have a typo in the threads title. Just a heads up.
Vuciz said:
You have a typo in the threads title. Just a heads up.
Click to expand...
Click to collapse
Thanks for letting me know!
dd043 said:
I'm having some issues on stock.
I thought 0655 fixed everything but no, I can't install any app after moving the dalvik-cache to /cache. I tried chmoding 0777 on the new cache folder, on /cache itself, to no avail.
Code:
E/dexopt cannot open '/data/dalvik-cache/[email protected]' for output
Anyone can confirm it's not only my device? And/or can help find a fix?
Also does someone knows how to execute commands on a particular init step? Real init.rc scripts can do:
Code:
on post-fs-data
mount -o bind /cache/dalvik /data/dalvik-cache
It there was a way to achieve the same from post_boot/init.d we could mount -o bind /cache/dalvik /data/dalvik-cache and all permissions issues would disappear as well as the need for symlink.
Click to expand...
Click to collapse
Let me try and do that right now... Ill get back to you if it does!
My script works on stock btw... But the mount way seems a bit easier and might cause less errors than my way.
Try it please.
skyguy126 said:
Let me try and do that right now... Ill get back to you if it does!
My script works on stock btw... But the mount way seems a bit easier and might cause less errors than my way.
Try it please.
Click to expand...
Click to collapse
Yes I've tried your script, all went well but the result is the same. The script itself works nicely btw
Applications present before moving cache work perfectly, but I can't install anything new. I suspect it might be my device but before wiping everything I'd prefer feedback from others :fingers-crossed:.
I cannot install new apps as well. The mount command you showed me has the same effect too. I honestly don't know anymore, the sym link did not allow the install of new apps nor did the mount command you sent me. Correct me if I am wrong.
Edit: Going through all the init files on my phone to see which one remounts /cache at boot.
Why does the init.rc get overwritten at boot. Is it because the kernel (boot.img) is the one that copies it over? I have found by changing the perms/locations in this file and init.target.rc you can achieve what this mod is trying to acomplish.
I don't see the mount cache command in CWM strange
I've managed to get back to normal, thanks for everyone's help though, I will keep and eye on the thread
Sent from my XT1032 using XDA Free mobile app
non-windows version?
Thanks for this tool. It's a great idea and our Motos really need it.
However, I have a problem - I do not own a windows license (os x and ubuntu user) and I would prefer not to spend $120 just to use it for this script. Pirating is out of the question for me.
I was wondering if there is any chance of having this script written for linux and/or mac. If impossible, is there a LEGAL way of running windows in a virtual machine? Something like a trial or similar?
If you know how just convert it to shell script for osx and Linux. I give you permission to do this but you may not take credit or rehost your creation.
Ok so I have the kernel extracted and we could modify and flash that, but I believe that it's not really necessary. There are a lot of risks to flashing kernels and I am not willing to take it. So is there a way we can modify dalvik so it creates it's cache in /cache instead.
skyguy126 said:
Why does the init.rc get overwritten at boot. Is it because the kernel (boot.img) is the one that copies it over? I have found by changing the perms/locations in this file and init.target.rc you can achieve what this mod is trying to acomplish.
Click to expand...
Click to collapse
Yes the init.rc is in the boot ramdisk. I don't think it would be worth the trouble to rebuild a boot.img. The moto g is fairly unbrickable but it's quite a lot of work to setup an environment to rebuild an image :/.
Too bad for the mount command, I was sure it was working but maybe I had changed something else and don't quite remember the steps to reproduce
We could possibly implement a shell script toggler for when we need to install new apps, but I'm afraid it'd become annoying fairly quickly: I noticed the issue initially because google play services decided to update itself, failed, and broke all google apps. As far as I know this autoupate can't be disabled.
Thanks for trying!
dd043 said:
Yes the init.rc is in the boot ramdisk. I don't think it would be worth the trouble to rebuild a boot.img. The moto g is fairly unbrickable but it's quite a lot of work to setup an environment to rebuild an image :/.
Too bad for the mount command, I was sure it was working but maybe I had changed something else and don't quite remember the steps to reproduce
We could possibly implement a shell script toggler for when we need to install new apps, but I'm afraid it'd become annoying fairly quickly: I noticed the issue initially because google play services decided to update itself, failed, and broke all google apps. As far as I know this autoupate can't be disabled.
Thanks for trying!
Click to expand...
Click to collapse
How about making a simple apk that toggles this feature. Something like when you click the icon it doesn't even open but gives a little notification of success. Something like that. I myself am not experienced with apks but I can put together a shell script for the apk.
skyguy126 said:
Ok so I have the kernel extracted and we could modify and flash that, but I believe that it's not really necessary. There are a lot of risks to flashing kernels and I am not willing to take it. So is there a way we can modify dalvik so it creates it's cache in /cache instead.
Click to expand...
Click to collapse
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
dd043 said:
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
Click to expand...
Click to collapse
Ill try it. I don't mind doing a bunch of resets because I am using my moto g as a test bench anyway. My daily driver is the OnePlus One
dd043 said:
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
Click to expand...
Click to collapse
EDIT: Unfortunately it didn't work. I don't know if I modified the installd file correctly. The program I used is HxD.
Is there a way we can force dalvik to start after the directories are created. And change dalvik to create it in /cache.

Categories

Resources