完成发布

Signed-off-by: ziberg <cnziberg@gmail.com>
This commit is contained in:
ziberg 2013-11-20 21:36:56 +08:00
parent b2af4eb391
commit 6c5c70e670
12 changed files with 185 additions and 122 deletions

View File

@ -1,51 +1,20 @@
@echo off
set CurDir=%~dp0
set UserSetting=D:\eclipses\eclipseJuno\gbzh_maven_settings_localhost.xml
set GlobalSetting=D:\eclipses\eclipseJuno\gbzh_maven_settings_localhost.xml
set Maven=D:\GreenTools\apache-maven-3.1.1\bin\mvn.bat
set OutF=E:\git\wdmvc\log.txt
cmd /C %Maven% deploy -f E:\git\wdmvc\com.android.dx\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.droid.constant\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\edu.cmu.sphinx4\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.anchormodel\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.demo.xslt\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.dmvc\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.droid.booter\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.droid.bootloader\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.droid.classloader\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.earoral\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.event\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.listener\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.maven.rcp-tools\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.msadu.booter\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.msadu.booterinfo\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.msadu.core\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.msadu.desc\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.msadu.droidbooter\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.objhome\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.roll.mpad\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.roll.sync\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.rpc\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.dirindex\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.log\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.match\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.objproxy\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.param\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.path\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.persistence\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.reflector\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.resource\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.rpccore\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.security\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.sysprop\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.thread\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.typedef\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.wdmvc\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.workflow\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.workflow.ctxgui\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.javassist.android\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.jui.gui\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.jui.gui.Iandroid\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.jui.xmlgui\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.msadu.droidmanager\pom.xml -s %UserSetting% -gs %GlobalSetting%
echo Log of deploy...>%OutF%
for /d %%i in (*) do (
if exist %CurDir%/%%i/pom.xml (
(findstr /C:distributionManagement %CurDir%\%%i\pom.xml) | find "distributionManagement" && (
echo ²¿ÊðÏîÄ¿%%i
cmd /C %Maven% deploy -f %CurDir%\%%i\pom.xml -s %UserSetting% -gs %GlobalSetting% >>%OutF%
)
)
)
pause

View File

@ -1,51 +1,20 @@
@echo off
set CurDir=%~dp0
set UserSetting=D:\eclipses\eclipseJuno\gbzh_maven_settings_trustie.xml
set GlobalSetting=D:\eclipses\eclipseJuno\gbzh_maven_settings_trustie.xml
set Maven=D:\GreenTools\apache-maven-3.1.1\bin\mvn.bat
set OutF=E:\git\wdmvc\log.txt
cmd /C %Maven% deploy -f E:\git\wdmvc\com.android.dx\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.droid.constant\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\edu.cmu.sphinx4\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.anchormodel\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.demo.xslt\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.dmvc\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.droid.booter\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.droid.bootloader\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.droid.classloader\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.earoral\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.event\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.listener\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.maven.rcp-tools\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.msadu.booter\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.msadu.booterinfo\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.msadu.core\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.msadu.desc\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.msadu.droidbooter\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.objhome\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.roll.mpad\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.roll.sync\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.rpc\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.dirindex\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.log\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.match\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.objproxy\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.param\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.path\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.persistence\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.reflector\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.resource\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.rpccore\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.security\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.sysprop\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.thread\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.util.typedef\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.wdmvc\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.workflow\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.workflow.ctxgui\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.javassist.android\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.jui.gui\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.jui.gui.Iandroid\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.jui.xmlgui\pom.xml -s %UserSetting% -gs %GlobalSetting%
cmd /C %Maven% deploy -f E:\git\wdmvc\org.gbzh.msadu.droidmanager\pom.xml -s %UserSetting% -gs %GlobalSetting%
echo Log of deploy...>%OutF%
for /d %%i in (*) do (
if exist %CurDir%/%%i/pom.xml (
(findstr /C:distributionManagement %CurDir%\%%i\pom.xml) | find "distributionManagement" && (
echo ²¿ÊðÏîÄ¿%%i
cmd /C %Maven% deploy -f %CurDir%\%%i\pom.xml -s %UserSetting% -gs %GlobalSetting% >>%OutF%
)
)
)
pause

View File

@ -81,9 +81,9 @@ public class DroidBooter {
}
private static void initJavassist() {
JarClassLoader jcl = JavaCommand.getInstance().getClassLoader();
SubClassDirClassLoader scdcl = jcl.addClassDir2ClassPath("/mnt/sdcard/gbzhdex");
SubClassDirClassLoader scdcl = jcl.addClassDir2ClassPath("/mnt/sdcard/softlet/dexclass");
JarClassLoaderClassPath jccp = new JarClassLoaderClassPath(jcl);
ClassPool.getDefault().appendClassPath(jccp);
ClassPool.getDefault().insertClassPath(jccp);
ClassPool.getDefault().setCtClassLoader(scdcl);
}
public static void main(String[] args) {

View File

@ -203,7 +203,7 @@ public class JarClassLoader extends ClassLoader{
}
/**
* @param classPath
* the path(e.g. "/mnt/sdcar/gbzhdex") of *.class files
* the path(e.g. "/mnt/sdcard/softlet/dexclass") of *.class files
* @return
*/
public SubClassDirClassLoader addClassDir2ClassPath(String classPath){
@ -262,7 +262,7 @@ public class JarClassLoader extends ClassLoader{
break method;
}
}
Log.d("Failed to find class "+className);
//Log.d("Failed to find class "+className);
} while (false);
//Thread.currentThread().setContextClassLoader(this);//强制使用本加载器
return result;

View File

@ -36,7 +36,7 @@ public class SubClassDirClassLoader extends ClassLoader implements ISubDalvikCla
* Constructor.
*
* @param classPath
* the path(e.g. "/mnt/sdcar/gbzhdex") of *.class files
* the path(e.g. "/mnt/sdcard/softlet/dexclass") of *.class files
* @param parent
* the parent class loader
*/
@ -44,7 +44,7 @@ public class SubClassDirClassLoader extends ClassLoader implements ISubDalvikCla
super(jarLoader.getParent());//设置父加载器为JarClassLoader加载器的父类防止循环调用
this.jarLoader = jarLoader;
if(classPath==null || classPath.trim().length()==0){
this.classPath = "/mnt/sdcard/gbzhdex";
this.classPath = "/mnt/sdcard/softlet/dexclass";
}else{
this.classPath = classPath;
}
@ -214,7 +214,7 @@ public class SubClassDirClassLoader extends ClassLoader implements ISubDalvikCla
try {
// String optDir = this.optimizedDirectory;
// if(optDir==null){
// optDir = "/mnt/sdcard/gbzhdex";
// optDir = "/mnt/sdcard/softlet/dexclass";
// }
Log.d("Loading dex file %s in opt dir %s", zipFilePathName, optFilePathName);
dalvikDexFile = dalvik.system.DexFile.loadDex(zipFilePathName, optFilePathName, 0);
@ -240,8 +240,10 @@ public class SubClassDirClassLoader extends ClassLoader implements ISubDalvikCla
break method;
}
String filePathName = this.genJavaClassFile(ct);
Log.d("generated class file @ "+filePathName);
result = this._findClass(ct.getName());
if(filePathName==null){
Log.e("Failed to genJavaClassFile for CtClass "+ct.getName());
break method;
}
File file = new File(filePathName);

View File

@ -59,18 +59,19 @@ public class JarClassLoaderClassPath implements DalvikClassPath {
public URL find(String classname) {
URL result = null;
method: do {
Log.d("Finding URL of class "+classname);
Class<?> cls = this.getClass(classname);
URL url;
if(cls==null){
break method;
}
try {
url = null == cls ? null : new URL("file", "", classname);
result = url;
result = new URL("file", "", classname);
} catch (MalformedURLException e) {
e.printStackTrace(Log.getLogStream());
}
if(result == null){
Log.d("Failed to find class %s.", classname);
Log.d("Failed to create URL of class %s.", classname);
}
break method;
} while (false);
return result;
@ -144,21 +145,34 @@ public class JarClassLoaderClassPath implements DalvikClassPath {
* @return
*/
private Class<?> getClass(String classname) {
Class<?> clazz = null;
try {
clazz = Class.forName(classname);
} catch (ClassNotFoundException e) {
//do nothing e.printStackTrace();
//return null;
}
if(clazz==null && this.dexClassLoader!=null){
clazz = this.dexClassLoader.loadClass(classname);
if(clazz==null && !classname.contains(".")){//Try to find internal class.
classname = "java.lang."+classname;
clazz = this.dexClassLoader.loadClass(classname);
Class<?> result = null;
method: do {
try {
result = Class.forName(classname);
} catch (ClassNotFoundException e) {
//do nothing e.printStackTrace();
//return null;
}
}
return clazz;
if(result!=null){
break method;
}
if(this.dexClassLoader==null){
break method;
}
result = this.dexClassLoader.loadClass(classname);
if(result!=null){
break method;
}
//Try to find internal class.
if(!classname.contains(".")){
result = this.dexClassLoader.loadClass("java.lang."+classname);
}
if(result!=null){
break method;
}
Log.w("Failed to find the class " + classname);
} while (false);
return result;
}
private void addFields(ClassFile cfile, Class<?> clazz) {

View File

@ -5,3 +5,4 @@
/libs
/gen
/lib
/manifest.xml

View File

@ -0,0 +1,101 @@
按照如下步骤生成Android的启动管理和加载器。
1、启动器就是本项目
使用maven install即可生成启动器的apk文件。
如在mpad上安装则需要进行签名。
签名可以参考运行GenInstall.bat脚本。
2、管理器是项目org.gbzh.msadu.droidmanager
该项目是一个典型的小软件按照通常的方法在application.xml中使用如下的记录检出它
<application>
<name>小软件管理器</name>
<groupId>org.gbzh</groupId>
<artifactId>org.gbzh.msadu.droidmanager</artifactId>
<version>1.0.0-SNAPSHOT</version>
<description>直接启动Android上管理器时运行的小软件用于管理已安装的软件目前添加小软件的桌面快捷图标。</description>
<boot-args>%root%/rescaches/resources/wdmvc/boot.txt</boot-args>
<frozen>false</frozen>
</application>
3、加载器是项目org.gbzh.droid.booter
启动器启动后将目标小软件的GAV等信息交给加载器进行加载运行。这样是为了隔离依赖关系。
加载器不是一个真正的小软件,但需要按照小软件的方式检出它,记录如下:
<application>
<name>Android软件加载器</name>
<groupId>org.gbzh</groupId>
<artifactId>org.gbzh.droid.booter</artifactId>
<version>1.0.0-SNAPSHOT</version>
<description>为了隔离依赖关系Android的启动Activity首先启动本软件由本软件加载目标软件。这不是一个真正的小软件。</description>
<boot-args>%root%/rescaches/resources/wdmvc/boot.txt</boot-args>
<frozen>true</frozen>
</application>
检出后将其根目录org.gbzh.droid.booter重命名为org.gbzh.msadu.droidbooter。
4、为了加快运行可以将2和3中得到的lib目录下的jar包全部转换为dex文件并拷贝到/mnt/sdcard/softlet/dexcache目录下。
其它小软件的jar包同样可以转换后放到该目录。
注意如果maven检出了androidxxx.jar包则直接删除它且不要为其生成dex文件。
5、安装和使用
以平板备案为例。
5.1 使用如下记录检出该小软件:
<application>
<name>备案服务端</name>
<groupId>org.gbzh</groupId>
<artifactId>org.gbzh.roll.enroll</artifactId>
<version>1.0.0-SNAPSHOT</version>
<description>description</description>
<boot-args>%root%/rescaches/resources/wdmvc/boot.txt</boot-args>
<frozen>false</frozen>
</application>
5.2 修改服务端和客户端的IP地址
在<softlet>\org.gbzh\org.gbzh.roll.enroll\1.0.0-SNAPSHOT\rescaches\resources\wdmvc\objcfg下的
rpcdaemon.xml和rpcdaemon_client.xml文件中修改IP地址。
注意均修改为服务端的IP地址。
5.3 服务端的运行
直接启动<softlet>\org.gbzh\org.gbzh.roll.enroll\1.0.0-SNAPSHOT\run.bat即可在安装科jdk1.6以上的windows中运行服务端。
服务端程序会弹出一个窗体,窗体中仅有一个退出按钮,因为服务端“等待”客户端发来的备案请求。
5.4 客户端的准备和运行
将2、3、4和5.1中得到的目录拷贝到平板的/mnt/sdcard/softlet目录下。
同样应将备案小软件lib目录中的jar包转换放到dexcache目录中。
安装启动器的apk文件准备运行它。
缺省情况下,启动器会调用加载器,加载运行管理器这个小软件。
管理器目前仅有一个功能:根据<softlet>\application.xml文件创建其中小软件的启动快捷方式。
运行启动器前,确保平板中<softlet>\application.xml的内容如下
<?xml version="1.0" encoding="UTF-8"?>
<maven-config>
<default-boot-args>default/boot/file</default-boot-args>
<applications>
<application>
<name>备案客户端</name>
<groupId>org.gbzh</groupId>
<artifactId>org.gbzh.roll.enroll</artifactId>
<version>1.0.0-SNAPSHOT</version>
<description>description</description>
<boot-args>%root%/rescaches/resources/wdmvc/boot_client.txt</boot-args>
</application>
</applications>
</maven-config>
可以看出我们修改了软件的名称name和启动参数boot-args
运行启动器,在弹出的管理器界面中点击“安装快捷方式”按钮,如果一次点击不行,可再次乃至多次点击它。
待提示快捷方式安装好后,(多次)点击返回按钮,在提示中确定退出软件(所有小软件运行时都可以如此直接退出)。
返回到桌面可以看到“备案客户端”的快捷方式。确保客户端和服务端是联通的按照5.2配置好IP地址
例如将服务端配置为1.1.1.2客户端配置为1.1.1.3则5.2中两个IP均设置为1.1.1.2),且服务端已经运行。
点击快捷方式,启动客户端,待界面显示后,点击“发送备案信息”按钮。
当客户端连接到服务端后,服务端的命令行窗口会出现如下字样:
netty-channelConnected@org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext@157b46f
点击“发送备案信息”按钮后——若无反映可再次乃至多次点击——服务端会弹出“填写注册信息”窗口。
填写好信息后,点击“确定”按钮,即可将信息发送到邮箱中。若不想发送或弹出了多余的窗口,可点击“取消”按钮。
邮件发送过程中,服务端的命令行窗口会出现如下字样,表示正常发送:
39DEBUG[[sun.reflect.NativeMethodAccessorImpl.invoke0()]: 备案邮件发送中,请稍等...
39DEBUG[[org.jui.awt.Component.repaint()]: ...
39DEBUG[[sun.reflect.NativeMethodAccessorImpl.invoke0()]: 邮件发送成功 CPUID 00000020
发送成功后,平板的备案就完成了。此时可以保留服务端,按照同样的操作对其它平板进行备案。

View File

@ -17,6 +17,8 @@ import org.jui.gui.android.IDroidWindowSystem;
import android.os.Bundle;
import android.os.Looper;
import android.view.Window;
import android.view.WindowManager;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
@ -100,6 +102,12 @@ public class StarterActivity extends Activity{
}catch(Exception e){
e.printStackTrace(Log.getLogStream());
}
//隐藏标题栏
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//隐藏状态栏
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.surfaceView = new DroidSurfaceView(this);
this.setContentView(this.surfaceView);
DroidWindowSystem.initDroidWinSystem(this, surfaceView);

View File

@ -7,7 +7,6 @@
import org.gbzh.util.log.Log;
import org.gbzh.roll.enroll.EnrollMessage;
onStart(){
Log.d("Loading client enroll filling UI...");
xui_viewerset.setVisible(true);
EnrollMessage eMessage = (EnrollMessage)wf_context.getValue("EnrollMessage");
String cpuID = eMessage.fetchData("CPUID");
@ -59,7 +58,7 @@
}
onCancle(e){//取消,不做备案
//以下语句可以用一个流程来完成
Log.d("Enrolling cancled...");
Log.d("取消备案。");
xui_viewerset.sendSignal();
xui_viewerset.setVisible(false);
}

View File

@ -140,9 +140,9 @@ public class RPCProxyFactory {
*/
private void genStubInterface(ClassPool classPool, CtClass ctStubClazz)
throws NotFoundException {
CtClass anInterface = classPool.get(IStubClass.class.getName());
ctStubClazz.addInterface(anInterface);
try {
CtClass anInterface = classPool.get(IStubClass.class.getName());
ctStubClazz.addInterface(anInterface);
CtField cff;
try {
cff = CtField.make("private java.lang.Object _gbzhStubInfo_;", ctStubClazz);
@ -164,8 +164,7 @@ public class RPCProxyFactory {
ctStubClazz.addMethod(m2);
} catch (CannotCompileException e) {
e.printStackTrace();
}
catch (NotFoundException e){
} catch (NotFoundException e){
e.printStackTrace();
}
}

View File

@ -582,6 +582,7 @@ public class ClassPool {
return new CtArray(classname, this);
} else{
if (find(classname) == null){
Log.e("Failed to find the target class "+classname);
return null;
}else
return new CtClassType(classname, this);