Currently i can create a database with following lines:
Code:
final String MY_DB_NAME = "Test";
final String MY_DB_TABLE = "Autos";
SQLiteDatabase myDB = null;
myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);
myDB.execSQL("CREATE TABLE IF NOT EXISTS " + MY_DB_TABLE + " (_id integer primary key autoincrement, name varchar(100), pos int(4))");
myDB.execSQL("INSERT INTO " + MY_DB_TABLE + " (name)" + " VALUES ('Audi TT')");
myDB.execSQL("INSERT INTO " + MY_DB_TABLE + " (name)" + " VALUES ('Honda Civic');");
Now this creates only name.
But i need to add a value too, what must i change to make it possible?
The table only has 3 fields..the autoincrement _id field which the database handles.
Then you have name and pos.
Not sure what you want to do, but to insert data to both columns, it's:
insert into autos ("name", "pos") values ("Chevy Camaro", 1);
If you need more information, you'll have to recreate (or alter) the table to add columns.
Currently i can create a database with the following lines:
Code:
private void onCreateDB () {
final String MY_DB_NAME = "settings";
SQLiteDatabase myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);
Toast.makeText(set.this, "PATH: " + myDB.getPath(), Toast.LENGTH_SHORT).show();
myDB.execSQL("CREATE TABLE IF NOT EXISTS system (_id integer primary key autoincrement, name varchar(100), value int(4))");
myDB.execSQL("INSERT INTO system (name, value)" + " VALUES ('wifi_http_proxy', 'proxy')");
myDB.execSQL("INSERT INTO system (name, value)" + " VALUES ('wifi_http_port', '3128');");
myDB.close();
}
now, i must replace the entry by the name, not by the id. how can i do it?
ilendemli said:
Currently i can create a database with the following lines:
Code:
private void onCreateDB () {
final String MY_DB_NAME = "settings";
SQLiteDatabase myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);
Toast.makeText(set.this, "PATH: " + myDB.getPath(), Toast.LENGTH_SHORT).show();
myDB.execSQL("CREATE TABLE IF NOT EXISTS system (_id integer primary key autoincrement, name varchar(100), value int(4))");
myDB.execSQL("INSERT INTO system (name, value)" + " VALUES ('wifi_http_proxy', 'proxy')");
myDB.execSQL("INSERT INTO system (name, value)" + " VALUES ('wifi_http_port', '3128');");
myDB.close();
}
now, i must replace the entry by the name, not by the id. how can i do it?
Click to expand...
Click to collapse
UPDATE system SET value = XX WHERE name = 'xxxx'
Do some googling for SQL. There is TONS of help for SQL out there, and it sounds like your problem isn't Android, it's SQL. There's some great learning resources out there.
i already got it, thx anyways.
Online Nandroid Backup as seen on today's XDA front page.
This looks great! No more turning device off to make nandroid backups.
Has anyone tested it with the Atrix? And if so, on which ROM? Any issues?
"Why don't you try it yourself and tell for the rest of us?'
I guess it's better to ask before I screw up something on mine
Edit:
Since version 5.9 it works well with the Atrix, backing up /boot, /recovery, /system, /data, /cache and .android_secure. Tested and confirmed.
Personally, I don't think I'd trust such a backup. I very much believe no software, on phone or computer or anywhere else, should ever be backed up while it's live/running. Especially if it's the OS itself. I just wouldn't trust it.
For starters, it's making a backup of /data while many background services are running, live services that could at any point change any part of that same /data...
Installs fine. Can't get root permissions with it when it tries to perform a backup.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
That is not a problem. It is how fruit cakes are made.
The service does sound interesting.
ravilov said:
Personally, I don't think I'd trust such a backup. I very much believe no software, on phone or computer or anywhere else, should ever be backed up while it's live/running. Especially if it's the OS itself. I just wouldn't trust it.
For starters, it's making a backup of /data while many background services are running, live services that could at any point change any part of that same /data...
Click to expand...
Click to collapse
CaelanT said:
Installs fine. Can't get root permissions with it when it tries to perform a backup.
Click to expand...
Click to collapse
Re-install the latest version of busybox. It should work then.
Tested it, its working...
Sent from my MB860 using xda premium
upndwn4par said:
That is not a problem. It is how fruit cakes are made.
Click to expand...
Click to collapse
Hm, could you explain please?
Are you saying fruitcakes don't update /data randomly? Or don't have background processes?
I'm confused.
ravilov said:
Hm, could you explain please?
Are you saying fruitcakes don't update /data randomly? Or don't have background processes?
I'm confused.
Click to expand...
Click to collapse
Getting off topic, but fruit cakes are made from an app called rom factory. The app creates a copy of your boot and system images while the phone is running. I don't know how it works (you'd have to ask samcripp). But I would guess that it works like titanium backup in that it will pause any process it needs to copy.
So back to your point, yes, the system can be reliably copied while running.
upndwn4par said:
That is not a problem. It is how fruit cakes are made.
The service does sound interesting.
Click to expand...
Click to collapse
Fruitcakes don't back up /data. Only /system and /boot are backed up.
ameer1234567890 said:
Re-install the latest version of busybox. It should work then.
Click to expand...
Click to collapse
That fixed it. So I created a backup with this, then wiped and tried to restore. Had error on boot image. Had to restore from nandroid created in recovery earlier, so I guess it creates a backup, but the backup is balked in some way.
Sent from my MB860 using xda premium
CaelanT said:
That fixed it. So I created a backup with this, then wiped and tried to restore. Had error on boot image. Had to restore from nandroid created in recovery earlier, so I guess it creates a backup, but the backup is balked in some way.
Sent from my MB860 using xda premium
Click to expand...
Click to collapse
Provide me the log file at /data/local/tmp/onandroid.log
ameer1234567890 said:
Provide me the log file at /data/local/tmp/onandroid.log
Click to expand...
Click to collapse
I lost the original log from the failed restore after I restored from my nandroid I had created in recovery prior to that, so I repeated the process and did in fact have the same failure, so it is repeatable. Log from this attempt is attached.
Exactly what I said. The point was that you can copy files on a running os. Just like with the online nandroid.
Sent from my MB860 using xda app-developers app
Edit: @nerfman
I think you're missing the point here. Things like /system and /boot are perfectly fine to access and copy on a live system, they are mounted read-only anyway. /data on the other hand is mounted read-write and gets accessed and changed all the time. I just simply don't think it's at all safe to try making a backup of any file while it's (potentially) being changed. That sounds like a good way to get a corrupted copy of the file. Not a good way to get a reliable backup.
Your original statement (emphasis added by me):
"Personally, I don't think I'd trust such a backup. I very much believe no software, on phone or computer or anywhere else, should ever be backed up while it's live/running. Especially if it's the OS itself. I just wouldn't trust it.
For starters, it's making a backup of /data while many background services are running, live services that could at any point change any part of that same /data... "
Last time I checked, system and boot are integral parts of the os. Clearly this is possible as evidenced by fruit cakes. I never commented on data. But having said that, any process or service need only be paused to be copied. I don't see why you can't get your head wrapped around this concept.
ravilov said:
I think you're missing the point here. Things like /system and /boot are perfectly fine to access and copy on a live system, they are mounted read-only anyway. /data on the other hand is mounted read-write and gets accessed and changed all the time. I just simply don't think it's at all safe to try making a backup of any file while it's (potentially) being changed. That sounds like a good way to get a corrupted copy of the file. Not a good way to get a reliable backup.
Click to expand...
Click to collapse
CaelanT said:
I lost the original log from the failed restore after I restored from my nandroid I had created in recovery prior to that, so I repeated the process and did in fact have the same failure, so it is repeatable. Log from this attempt is attached.
Click to expand...
Click to collapse
Thank you for the details. I am guessing you are using an Atrix 4G.
There is an issue where I am unable to programmatically find the boot partition on some devices which does not have /proc/mtd and /proc/emmc
I have opened an issue for this. I am working on it. I shall post here when it is fixed.
For the time being, you can just restore backup done with Online Nandroid and then restore only the boot partition from a previous nandroid done with CWM.
ROM Factory Magic
Random FactsDeveloping ROM Factory took, 4 months, cost 743$, hard bricked one device and the finish product uses android, java zip, and the under laying linux. Its in continues research. With ever changing phones, ever changing ROM Factory. Because of the way the app is design only Phones with BML partition system can use it. Mostly high end devices.ROM Factory does not create a nandroid back up.Understanding how ROM Factory works.The Device LibraryIn the library I began to create a list of devices. This list contains a device name, and some specifics about the device. Such as /system partition location, and storage options.
The main function for it is to identify the device and provide the info. Looks something like this:
Code:
if(Phone.contentEquals("olympus")) //moto atrix
{
if(OS.contentEquals("2.3.4"))
{
zStorage = "/sdcard-ext";
} else if(OS.contentEquals("2.3.5")) {
zStorage = "/sdcard-ext";
} else if(OS.contentEquals("2.3.6")) {
zStorage = "/sdcard-ext";
} else {
zStorage = Environment.getExternalStorageDirectory().getAbsolutePath();
}
RName = "Atrix 4G";
appRun = true;
DataPart = "/dev/block/mmcblk0p07";
BootPart = "/dev/block/mmcblk0p11";
SysPart = "/dev/block/mmcblk0p12";
}
The SU ClassIn the class I build a custom set of methods to handle the super user commands require to create the back ups.
Looks something like this:
Code:
public void cmdSU(String suCmd){
DataOutputStream suShell = new DataOutputStream(user.getOutputStream());
try{
suShell.writeBytes(suCmd + "\n");
suShell.writeBytes("wait\n");
suShell.writeBytes("exit\n");
suShell.flush();
try { user.waitFor();
if (user.exitValue() != 255) { } else { }
} catch (InterruptedException e) { Log.e("SU", e.getMessage()); }
} catch (IOException e) { Log.e("SU", e.getMessage()); }
}
The Script EngineI still very much consider this a work in progress.In the class I build a custom set of methods to handle the creation of the edify script required by Recovery to install a ROM. To save time and resources instead of creating a new file, the app simply echos a new one through the SU class. The script engine also detects some of the phone settigns and prepares the script
Looks something like this:
Code:
// Script Engine v0.6 * By Samuel Rivera "SamCripp"
//
// This code is constantly evolving. So if you use this on your project please keep an eye on the repository the code came from.
//
// http://zombidev.com * http://fcm.zombidev.com * http://repo.zombidev.com
//
// This code is the intellectual property of Samuel Rivera, 2011-2012. I, Samuel Rivera, grant you the following rights.
// 1. You may modify and redistribute this code. 2. You may compile and redistribute this code. 3. You may use this code in personal or educational projects.
//
// With that said, here is a list of rights revoked.
// 1. You may not use this code on commercial projects. 2. You may not use this code on corporate environment.
// 3. You may not use the code in any malicious way. 4. You may not use it for profit.
//
// Conditions:
// 1. Any project utilizing this code, whether close or open source, must always provide the latest version of this code, including all modifications.
// 2. Any project utilizing this code, must provide a link back to http://fcm.zombidev.com and http://repo.zombidev.com.
// 3. Any project utilizing this code, must provide credit to Samuel Rivera as original author of code. ie:
// Script Engine v0.6 - Original Author: Samuel Rivera "SamCripp"
//
// Thanks for following this simple rules.
package com.samcripp.romff;
public class ScriptEng {
String SEVersion = new String("--Script Engine v0.6");
String boot = new String();
String system = new String();
String os = new String();
String romName = new String();
String devName = new String();
String device = new String();
String formatType = new String();
boolean SndInit = false;
boolean NormalM = false;
boolean AdvMode = false;
boolean AppMode = false;
boolean backupMode = false;
String TheScript = new String();
String sym = "\"";
String beginCmd = "(";
String endCmd = ") > ";
String echo = "echo "+ sym;
String and = " && ";
String pend = ");" + sym;
String prog = "show_progress(";
String sprog = "set_progress(";
String ui_print = "ui_print(\\" + sym;
String ui_end = "\\" + sym + ");"+ sym;
String warning = "--This script is generated automatically--";
String line = "- - - - - - - - - - - - - - - - - - - - - - -";
String pkgexb = "package_extract_file(\\" + sym + "/boot.img" + "\\" + sym + "," + "\\" + sym + boot + "\\" + sym + ");" + sym;
String pkgexs = "package_extract_file(\\" + sym + "/system.img" + "\\" + sym + "," + "\\" + sym + system + "\\" + sym + ");" + sym;
String fdlexs = "package_extract_dir(\\" + sym + "system" + "\\" + sym + "," + "\\" + sym + "/system" + "\\" + sym + ");" + sym;
String fdlexaa = "package_extract_dir(\\" + sym + "apps" + "\\" + sym + "," + "\\" + sym + "/tmp/apps" + "\\" + sym + ");" + sym;
String fdlexdd = "package_extract_dir(\\" + sym + "data" + "\\" + sym + "," + "\\" + sym + "/tmp/data" + "\\" + sym + ");" + sym;
String fdlexa = "run_program(\\" + sym + "/system/xbin/busybox" + "\\" + sym + ", " + "\\" + sym + "cp -R" + "\\" + sym + ", " + "\\" + sym + "/tmp/apps" +", " + "\\" + sym + "/data/app" + "\\" + sym + ");" + sym;
String busymount = "run_program(\\" + sym + "/system/xbin/busybox" + "\\" + sym + ", " + "\\" + sym + "mount" + "\\" + sym + ", " + "\\" + sym + "/data" + "\\" + sym + ");" + sym;
String busydata = "run_program(\\" + sym + "/system/xbin/busybox" + "\\" + sym + ", " + "\\" + sym + "cp -R" + "\\" + sym + ", " + "\\" + sym + "/tmp/data" +", " + "\\" + sym + "/data" + "\\" + sym + ");" + sym;
String umountS = "unmount(\\" + sym + "/system" + "\\" + sym + ");" + sym;
public ScriptEng(boolean Init, String dev, String dName, String deviceN, String bootL, String sysL, String rom, String romversion,String dOs){
boot = bootL;
system = sysL;
romName = rom + " " + romversion;
devName = dev;
os = dOs;
device = dName + " " + deviceN;
SndInit = Init;
// AdvMode = adv;
// AppMode = app;
// backupMode = backup;
}
public void Make(){
String formatS = new String();
String mountS = new String();
if(formatType == "ext4"){
formatS = "format(\\" + sym + "ext4" + "\\" + sym + "," + "\\" + sym + "EMMC" + "\\" + sym + "," + "\\" + sym + system + "\\" + sym + ");" + sym;
mountS = "mount(\\" + sym + "ext4" + "\\" + sym + "," + "\\" + sym + "EMMC" + "\\" + sym + "," + "\\" + sym + system + "\\" + sym + "," + "\\" + sym + "/system" + "\\" + sym + ");" + sym;
} else if(formatType == "yaffs"){
formatS = "format(\\" + sym;
}else{
formatS = "format(\\" + sym + "ext3" + "\\" + sym + "," + "\\" + sym + "EMMC" + "\\" + sym + "," + "\\" + sym + system + "\\" + sym + ");" + sym;
mountS = "mount(\\" + sym + "ext3" + "\\" + sym + "," + "\\" + sym + "EMMC" + "\\" + sym + "," + "\\" + sym + system + "\\" + sym + "," + "\\" + sym + "/system" + "\\" + sym + ");" + sym;
}
if(SndInit == true){
NormalM = false;
}else{
NormalM = true;
}
if(NormalM == true && SndInit == false && AdvMode == false && AppMode == false){
// good old normal phone
TheScript = beginCmd + echo + prog + "1.000000, 0" + pend + and + echo + ui_print + warning + ui_end
+ and + echo + ui_print + SEVersion + ui_end + and + echo + ui_print + "--Rom Name: "+ romName + ui_end
+ and + echo + ui_print + "--Rom Developer: " + devName + ui_end + and + echo + ui_print
+ "--Rom Base: " + os + ui_end + and + echo + ui_print + "--Device Name: " + device + ui_end
+ and + echo + ui_print + line + ui_end + and + echo + ui_print + "--Installing Boot" + ui_end
+ and + echo + sprog + "0.300000" + pend + and + echo + pkgexb
+ and + echo + ui_print + "--Installing System" + ui_end
+ and + echo + sprog + "0.650000" + pend + and + echo + pkgexs + and + echo + ui_print + line
+ ui_end + and + echo + ui_print + "--Don't forget to format data and cache" + ui_end
+ and + echo + sprog + "1.000000" + pend + endCmd;
} if(NormalM == false && SndInit == true && AdvMode == false && AppMode == false){
// normal second init
TheScript = beginCmd + echo + prog + "1.000000, 0" + pend + and + echo + ui_print + warning + ui_end
+ and + echo + ui_print + SEVersion + ui_end + and + echo + ui_print + "--Rom Name: "+ romName + ui_end
+ and + echo + ui_print + "--Rom Developer: " + devName + ui_end + and + echo + ui_print
+ "--Rom Base: " + os + ui_end + and + echo + ui_print + "--Device Name: " + device + ui_end
+ and + echo + ui_print + line + ui_end + and + echo + ui_print + "--Installing System" + ui_end
+ and + echo + sprog + "0.650000" + pend + and + echo + pkgexs + and + echo + ui_print + line
+ ui_end + and + echo + ui_print + "--Don't forget to format data and cache" + ui_end
+ and + echo + sprog + "1.000000" + pend + endCmd;
} if(NormalM == true && SndInit == false && AdvMode == true && AppMode == false && backupMode == false){
// normal device with advance mode
TheScript = beginCmd + echo + prog + "1.000000, 0" + pend + and + echo + ui_print + warning + ui_end
+ and + echo + ui_print + SEVersion + ui_end + and + echo + ui_print + "--Rom Name: "+ romName + ui_end
+ and + echo + ui_print + "--Rom Developer: " + devName + ui_end + and + echo + ui_print
+ "--Rom Base: " + os + ui_end + and + echo + ui_print + "--Device Name: " + device + ui_end
+ and + echo + ui_print + line + ui_end + and + echo + ui_print + "--Installing Boot" + ui_end
+ and + echo + sprog + "0.300000" + pend + and + echo + pkgexb
+ and + echo + ui_print + "--Formating System" + ui_end
+ and + echo + sprog + "0.550000" + pend + and + echo + formatS
+ and + echo + ui_print + "--Installing System" + ui_end
+ and + echo + sprog + "0.600000" + pend + and + echo + pkgexs
+ and + echo + ui_print + "--Mounting System" + ui_end
+ and + echo + sprog + "0.900000" + pend + and + echo + mountS
+ and + echo + ui_print + "--Extracting System Mods" + ui_end
+ and + echo + sprog + "0.950000" + pend + and + echo + fdlexs
+ and + echo + ui_print + "--UnMounting System" + ui_end
+ and + echo + sprog + "0.990000" + pend + and + echo + umountS
+ and + echo + ui_print + line
+ ui_end + and + echo + ui_print + "--Don't forget to format data and cache" + ui_end
+ and + echo + sprog + "1.000000" + pend + endCmd;
} if(NormalM == false && SndInit == true && AdvMode == true && AppMode == false && backupMode == false){
// second init device with advance mode
TheScript = beginCmd + echo + prog + "1.000000, 0" + pend + and + echo + ui_print + warning + ui_end
+ and + echo + ui_print + SEVersion + ui_end + and + echo + ui_print + "--Rom Name: "+ romName + ui_end
+ and + echo + ui_print + "--Rom Developer: " + devName + ui_end + and + echo + ui_print
+ "--Rom Base: " + os + ui_end + and + echo + ui_print + "--Device Name: " + device + ui_end
+ and + echo + ui_print + line + ui_end + and + echo + ui_print + "--Formating System" + ui_end
+ and + echo + sprog + "0.550000" + pend + and + echo + formatS
+ and + echo + ui_print + "--Installing System" + ui_end
+ and + echo + sprog + "0.600000" + pend + and + echo + pkgexs
+ and + echo + ui_print + "--Mounting System" + ui_end
+ and + echo + sprog + "0.900000" + pend + and + echo + mountS
+ and + echo + ui_print + "--Extracting System Mods" + ui_end
+ and + echo + sprog + "0.950000" + pend + and + echo + fdlexs
+ and + echo + ui_print + "--UnMounting System" + ui_end
+ and + echo + sprog + "0.990000" + pend + and + echo + umountS
+ and + echo + ui_print + line
+ ui_end + and + echo + ui_print + "--Don't forget to format data and cache" + ui_end
+ and + echo + sprog + "1.000000" + pend + endCmd;
} if(NormalM == true && SndInit == false && AdvMode == false && AppMode == true && backupMode == false){
// normal device with apps mode
TheScript = beginCmd + echo + prog + "1.000000, 0" + pend + and + echo + ui_print + warning + ui_end
+ and + echo + ui_print + SEVersion + ui_end + and + echo + ui_print + "--Rom Name: "+ romName + ui_end
+ and + echo + ui_print + "--Rom Developer: " + devName + ui_end + and + echo + ui_print
+ "--Rom Base: " + os + ui_end + and + echo + ui_print + "--Device Name: " + device + ui_end
+ and + echo + ui_print + line + ui_end + and + echo + ui_print + "--Installing Boot" + ui_end
+ and + echo + sprog + "0.300000" + pend + and + echo + pkgexb
+ and + echo + ui_print + "--Formating System" + ui_end
+ and + echo + sprog + "0.550000" + pend + and + echo + formatS
+ and + echo + ui_print + "--Installing System" + ui_end
+ and + echo + sprog + "0.600000" + pend + and + echo + pkgexs
+ and + echo + ui_print + "--Mounting System" + ui_end
+ and + echo + sprog + "0.900000" + pend + and + echo + mountS
+ and + echo + ui_print + "--Extracting Apps" + ui_end
+ and + echo + sprog + "0.930000" + pend + and + echo + fdlexaa
+ and + echo + sprog + "0.950000" + pend + and + echo + fdlexa
+ and + echo + ui_print + "--UnMounting System" + ui_end
+ and + echo + sprog + "0.990000" + pend + and + echo + umountS
+ and + echo + ui_print + line
+ ui_end + and + echo + ui_print + "--Don't forget to format data and cache" + ui_end
+ and + echo + sprog + "1.000000" + pend + endCmd;
} if(NormalM == false && SndInit == true && AdvMode == false && AppMode == true && backupMode == false){
// second init device with apps mode
TheScript = beginCmd + echo + prog + "1.000000, 0" + pend + and + echo + ui_print + warning + ui_end
+ and + echo + ui_print + SEVersion + ui_end + and + echo + ui_print + "--Rom Name: "+ romName + ui_end
+ and + echo + ui_print + "--Rom Developer: " + devName + ui_end + and + echo + ui_print
+ "--Rom Base: " + os + ui_end + and + echo + ui_print + "--Device Name: " + device + ui_end
+ and + echo + ui_print + line + ui_end + and + echo + ui_print + "--Formating System" + ui_end
+ and + echo + sprog + "0.550000" + pend + and + echo + formatS
+ and + echo + ui_print + "--Installing System" + ui_end
+ and + echo + sprog + "0.600000" + pend + and + echo + pkgexs
+ and + echo + ui_print + "--Mounting System" + ui_end
+ and + echo + sprog + "0.900000" + pend + and + echo + mountS
+ and + echo + ui_print + "--Extracting Apps" + ui_end
+ and + echo + sprog + "0.930000" + pend + and + echo + fdlexaa
+ and + echo + sprog + "0.950000" + pend + and + echo + fdlexa
+ and + echo + ui_print + "--UnMounting System" + ui_end
+ and + echo + sprog + "0.990000" + pend + and + echo + umountS
+ and + echo + ui_print + line
+ ui_end + and + echo + ui_print + "--Don't forget to format data and cache" + ui_end
+ and + echo + sprog + "1.000000" + pend + endCmd;
} if(NormalM == true && SndInit == false && AdvMode == false && AppMode == false && backupMode == true){
// normal device with back up mode
TheScript = beginCmd + echo + prog + "1.000000, 0" + pend + and + echo + ui_print + warning + ui_end
+ and + echo + ui_print + SEVersion + ui_end + and + echo + ui_print + "--Rom Name: "+ romName + ui_end
+ and + echo + ui_print + "--Rom Developer: " + devName + ui_end + and + echo + ui_print
+ "--Rom Base: " + os + ui_end + and + echo + ui_print + "--Device Name: " + device + ui_end
+ and + echo + ui_print + line + ui_end + and + echo + ui_print + "--Installing Boot" + ui_end
+ and + echo + sprog + "0.300000" + pend + and + echo + pkgexb
+ and + echo + ui_print + "--Formating System" + ui_end
+ and + echo + sprog + "0.550000" + pend + and + echo + formatS
+ and + echo + ui_print + "--Installing System" + ui_end
+ and + echo + sprog + "0.600000" + pend + and + echo + pkgexs
+ and + echo + ui_print + "--Mounting Data" + ui_end
+ and + echo + sprog + "0.900000" + pend + and + echo + busymount
+ and + echo + ui_print + "--Extracting Back Up" + ui_end
+ and + echo + sprog + "0.930000" + pend + and + echo + fdlexdd
+ and + echo + sprog + "0.950000" + pend + and + echo + busydata
+ and + echo + ui_print + line
+ ui_end + and + echo + ui_print + "--Don't forget to format data and cache" + ui_end
+ and + echo + sprog + "1.000000" + pend + endCmd;
} if(NormalM == false && SndInit == true && AdvMode == false && AppMode == false && backupMode == true){
// second init device with apps mode
TheScript = beginCmd + echo + prog + "1.000000, 0" + pend + and + echo + ui_print + warning + ui_end
+ and + echo + ui_print + SEVersion + ui_end + and + echo + ui_print + "--Rom Name: "+ romName + ui_end
+ and + echo + ui_print + "--Rom Developer: " + devName + ui_end + and + echo + ui_print
+ "--Rom Base: " + os + ui_end + and + echo + ui_print + "--Device Name: " + device + ui_end
+ and + echo + ui_print + line + ui_end + and + echo + ui_print + "--Formating System" + ui_end
+ and + echo + sprog + "0.550000" + pend + and + echo + formatS
+ and + echo + ui_print + "--Installing System" + ui_end
+ and + echo + sprog + "0.600000" + pend + and + echo + pkgexs
+ and + echo + ui_print + "--Mounting Data" + ui_end
+ and + echo + sprog + "0.900000" + pend + and + echo + busymount
+ and + echo + ui_print + "--Extracting Back Up" + ui_end
+ and + echo + sprog + "0.930000" + pend + and + echo + fdlexdd
+ and + echo + sprog + "0.950000" + pend + and + echo + busydata
+ and + echo + ui_print + line
+ ui_end + and + echo + ui_print + "--Don't forget to format data and cache" + ui_end
+ and + echo + sprog + "1.000000" + pend + endCmd;
}
}
public String Script(){
return TheScript;
}
}
And finally Linux!Pay attention, here is where the magic happens. The apps sends a simple "dd" command to linux to create a "live image" of your emmc contents.
Looks something like this:
Code:
// creates system
new Thread(new Runnable() {
public void run() {
upBar(35);
log.V("Creating the system image");
log.V("Command: " + "dd if=" + device.System() + " of=" + device.Storage() + "/romf/workdir/system.img");
UBER.requestSU();
UBER.cmdSU("dd if=" + device.System() + " of=" + device.Storage() + "/romf/workdir/system.img");
endCreateSystem.sendEmptyMessage(0);
}
})
.start();
Making it all work togetherStep 1: App loads and detects device. (First install downloads a payload zip with the update.bin)
Step 2: User begins the rom creation triggering...
Step 3: Generates the script and echo it through linux, with the device info. (su class use)
Step 4: Then the back ups are created using dd through linux. (su class use)
Step 5: Some good old java zip takes care of packaging, the update.bin, the system.img, and boot.img.
Ta da, creating a rom through android.Why don't they files corrupt using this methodThe data does not corrupt using my method because instead of copying directly changing files, im copying the latest "modified" version. also because of the image is ext3 or ext4 the files can be fixed during the dd if the change.ROM Factory 2 is going to use a new approach, instead of a list of devices, that class will be redesign to work with vold.fstab, and other methods of detecting the phones absolute partition location.
ameer1234567890 said:
Thank you for the details. I am guessing you are using an Atrix 4G.
There is an issue where I am unable to programmatically find the boot partition on some devices which does not have /proc/mtd and /proc/emmc
I have opened an issue for this. I am working on it. I shall post here when it is fixed.
For the time being, you can just restore backup done with Online Nandroid and then restore only the boot partition from a previous nandroid done with CWM.
Click to expand...
Click to collapse
I will continue to use CWM backup/restore until you have this resolved. The error occurs as soon as the restore starts as the boot partition is the first thing which is restored, so there is no opportunity for /system or /data to be restored. Hope you get this working for us because I like the idea of not rebooting to recovery to backup.
Cheers!
CaelanT said:
I will continue to use CWM backup/restore until you have this resolved. The error occurs as soon as the restore starts as the boot partition is the first thing which is restored, so there is no opportunity for /system or /data to be restored. Hope you get this working for us because I like the idea of not rebooting to recovery to backup.
Cheers!
Click to expand...
Click to collapse
I am working on a fix for this. If you could help me in testing it. Send me a PM and I shall send you the files.
ameer1234567890 said:
I am working on a fix for this. If you could help me in testing it. Send me a PM and I shall send you the files.
Click to expand...
Click to collapse
Back off, people, he can't accept so many volunteers.
I guess the worst thing that could happen is soft bricking. Right?
Right???
If so.. give short instructions on testing - what feedback you'd expect, log filest, etc. I might try it myself. Thanks!
Hi All,
Things I am trying to do:
1. Connect to remote system
2. Run perl command and get the output on screen.
Could you please guide me on the process where in I can connect to a remote windows/unix machine and run build commands.
Any examples?
Thanks for your help.
Thanks,
Kino
Hi!
I've made something similar - An App that runs some shell scripts on an Ubuntu server over SSH.
Here are some code snippets, hope this helps you
Code:
JSch jsch = new JSch();
Session session = jsch.getSession([I]'ssh-username'[/I],IP, [I]'ssh-port'[/I]);
session.setPassword(SW); // SW ... password ssh-user (for me it's the same pw, ssh-user = su)
Properties prop = new Properties();
prop.put("StrictHostKeyChecking", "no");
session.setConfig(prop);
session.connect();
Channel channel = session.openChannel("exec");
Code:
if(SU) // If Command should run as SU
{
sudoCommand = "sudo -S -p '' " + command;
}
else
{
sudoCommand = command;
}
((ChannelExec) channel).setCommand(sudoCommand);
((ChannelExec) channel).setPty(true);
channel.connect();
OutputStream out = channel.getOutputStream();
ByteArrayOutputStream responseStream = new ByteArrayOutputStream();
channel.setOutputStream(responseStream);
if(SU)
{
out.write((SW + "\n").getBytes());
out.flush();
}
Thread.sleep(1000);
out.write(("logout" + "\n").getBytes());
out.flush();
Thread.sleep(500);
out.write(("exit" + "\n").getBytes());
out.flush();
out.close();
session.disconnect();
channel.disconnect();
Thank you LinuxForce. Thats helpful. I am trying to work on this.
LinuxForce said:
Hi!
I've made something similar - An App that runs some shell scripts on an Ubuntu server over SSH.
Here are some code snippets, hope this helps you
Click to expand...
Click to collapse