Bug 584218 Android SUT agent needs ability to update itself r=ctalbert a=NPOTB

This commit is contained in:
Bob Moss 2010-08-25 11:47:39 -07:00
Родитель d1bfd7c143
Коммит f47beb4e89
8 изменённых файлов: 216 добавлений и 0 удалений

Просмотреть файл

@ -115,6 +115,8 @@ public class DoCommand {
String currentDir = "/";
String sErrorPrefix = "##AGENT-ERROR## ";
private final String prgVersion = "SUTAgentAndroid Version 0.80";
public enum Command
{
RUN ("run"),
@ -163,8 +165,10 @@ public class DoCommand {
FTPG ("ftpg"),
FTPP ("ftpp"),
INST ("inst"),
UPDT ("updt"),
UNINST ("uninst"),
TEST ("test"),
VER ("ver"),
UNKNOWN ("unknown");
private final String theCmd;
@ -207,6 +211,14 @@ public class DoCommand {
switch(cCmd)
{
case VER:
strReturn = prgVersion;
break;
case UPDT:
strReturn = StartUpdateOMatic(Argv[1], Argv[2]);
break;
case CWD:
try {
strReturn = new java.io.File(currentDir).getCanonicalPath();
@ -2294,6 +2306,58 @@ public class DoCommand {
return (sRet);
}
public String StartUpdateOMatic(String sPkgName, String sPkgFileName)
{
String sRet = "";
// Context ctx = SUTAgentAndroid.me.getApplicationContext();
Context ctx = contextWrapper.getApplicationContext();
PackageManager pm = ctx.getPackageManager();
Intent prgIntent = new Intent();
prgIntent.setPackage("com.mozilla.UpdateOMatic");
prgIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
PackageInfo pi = pm.getPackageInfo("com.mozilla.UpdateOMatic", PackageManager.GET_ACTIVITIES | PackageManager.GET_INTENT_FILTERS);
ActivityInfo [] ai = pi.activities;
for (int i = 0; i < ai.length; i++)
{
ActivityInfo a = ai[i];
if (a.name.length() > 0)
{
prgIntent.setClassName(a.packageName, a.name);
break;
}
}
}
catch (NameNotFoundException e)
{
e.printStackTrace();
}
prgIntent.putExtra("pkgName", sPkgName);
prgIntent.putExtra("pkgFileName", sPkgFileName);
try
{
contextWrapper.startActivity(prgIntent);
// Thread.sleep(5000);
sRet = "exit";
}
catch(ActivityNotFoundException anf)
{
anf.printStackTrace();
}
// catch (InterruptedException e)
// {
// e.printStackTrace();
// }
ctx = null;
return (sRet);
}
public String StartJavaPrg(String [] sArgs)
{
String sRet = "";
@ -2485,8 +2549,12 @@ public class DoCommand {
"unzp zipfile destdir - unzip the zipfile into the destination dir\n" +
"zip zipfile src - zip the source file/dir into zipfile\n" +
"rebt - reboot device\n" +
"inst /path/filename.apk - install the referenced apk file\n" +
"uninst packagename - uninstall the referenced package\n" +
"rebt - reboot device\n" +
"quit - disconnect SUTAgent\n" +
"exit - close SUTAgent\n" +
"ver - SUTAgent version\n" +
"help - you're reading it";
return (sRet);
}

Просмотреть файл

@ -63,6 +63,10 @@ JAVAFILES = \
RES_FILES = \
res/drawable/icon.png \
res/drawable/ateamlogo.png \
res/drawable/ic_stat_first.png \
res/drawable/ic_stat_neterror.png \
res/drawable/ic_stat_warning.png \
res/layout/main.xml \
res/values/strings.xml \
$(NULL)

Просмотреть файл

@ -221,7 +221,10 @@ public class SUTAgentAndroid extends Activity
}
}
else
{
sUniqueID = ba.getAddress();
sUniqueID.toLowerCase();
}
}
if (sUniqueID == null)

Просмотреть файл

@ -0,0 +1,35 @@
--- ateamlogo.png
+++ ateamlogo.png
GIT binary patch
literal 1512
zc$@*~1sD2>P)<h;3K|Lk000e1NJLTq001@s000>X1^@s6dcWO100001b5ch_0Itp)
z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf06}y`Sad^gZEa<4
zbO1wAML|?gQaT`KWG!lNWoICEF)lD5D0OpbZf77#N=G0{P(?=|b~Z98EFf`pVQgu1
zc_2L?I5i5)@W$Z)00l5fL_t(oN5xoKD0W>Ge#;jZ=6RmSl&J`1jG~APxiJ(X7fNKf
zKoaG`5Em#iyPyn7Q8JV<ajBG{xKToqxG=51XVrc?Ug!8;ec${2yLM-vea;@9z1Dix
zT3hAk=SQBNp5*B0NVc}N<mBYUZF_rrva_?}Hu~_6>gDA{7~|{f%TLXUej6Jbvb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