wangyj18 преди 9 години
родител
ревизия
e85b6cbfe8

+ 109 - 109
display-client/AndroidManifest.xml

@ -1,110 +1,110 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
    package="com.ai.mobile.display"
4
    android:versionCode="1"
5
    android:versionName="1.2" >
6
7
    <uses-sdk
8
        android:minSdkVersion="8"
9
        android:targetSdkVersion="15" />
10
11
    <uses-permission android:name="android.permission.CAMERA" />
12
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
13
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
14
    <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
15
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
16
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
17
    <uses-permission android:name="android.permission.INTERNET" />
18
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
19
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
20
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
21
    <uses-permission android:name="android.permission.READ_CONTACTS" />
22
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
23
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
24
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
25
    <uses-permission android:name="android.permission.CALL_PHONE" />
26
    <uses-permission android:name="android.permission.SEND_SMS" />
27
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
28
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
29
    <uses-permission android:name="android.permission.BLUETOOTH" />
30
    <uses-permission android:name="android.permission.VIBRATE" /> <!-- 震动权限 -->
31
    <uses-feature android:name="android.hardware.camera" /> <!-- 使用照相机权限 -->
32
    <uses-feature android:name="android.hardware.camera.autofocus" /> <!-- 自动聚焦权限 -->
33
    <uses-permission android:name="android.permission.FLASHLIGHT" /> <!-- 开启闪光灯权限 -->
34
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <!-- 蓝牙 -->
35
    <uses-permission android:name="android.permission.BLUETOOTH" />
36
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
37
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
38
    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
39
    <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
40
41
    <application
42
        android:allowBackup="true"
43
        android:icon="@drawable/ic_launcher"
44
        android:label="@string/app_name"
45
        android:theme="@style/AppTheme" >
46
        <meta-data
47
            android:name="com.amap.api.v2.apikey"
48
            android:value="6afee5dced4c3b3a43c0feb11399bded"/>
49
        <activity
50
            android:name="com.ai.mobile.display.MainActivity"
51
            android:configChanges="orientation|keyboardHidden"
52
            android:label="@string/app_name"
53
            android:screenOrientation="portrait"
54
            android:windowSoftInputMode="stateHidden|adjustResize" >
55
            <intent-filter>
56
                <action android:name="android.intent.action.MAIN" />
57
58
                <category android:name="android.intent.category.LAUNCHER" />
59
            </intent-filter>
60
        </activity>
61
        <!-- 注册推送服务 -->
62
        <service android:name="com.ai.mobile.im.PushService" android:process=":WmPush" />
63
        
64
        <!-- 对话框 -->
65
        <activity
66
            android:name="com.wade.mobile.ui.activity.CustomDialogActivity"
67
            android:theme="@style/CustomDialogTheme" >
68
        </activity>
69
        <!-- 窗口 -->
70
        <activity
71
            android:name="com.wade.mobile.ui.activity.CustomWindowActivity">
72
        </activity>
73
        <!-- 侧滑菜单 -->
74
        <activity android:name="com.wade.mobile.ui.activity.SlidingMenuActivity"
75
            android:theme="@style/SlidingMenuTheme" >
76
        </activity>
77
        <!-- 蓝牙分享 -->
78
        <activity
79
            android:name="com.wade.mobile.common.bluetooth.activity.ShareByBluetoothActivity"
80
            android:theme="@style/ShareApkDialogTheme" >
81
        </activity>
82
        <!-- 二维码扫描 -->
83
        <activity
84
            android:name="com.wade.mobile.common.scan.activity.CaptureActivity"
85
            android:configChanges="orientation|keyboardHidden"   
86
            android:screenOrientation="portrait" >
87
        </activity>
88
        <!-- 音乐播放服务 -->
89
        <service android:name="com.wade.mobile.common.audio.play.AudioPlayerService" />
90
        <!-- 录制声音 -->
91
        <activity
92
            android:name="com.wade.mobile.common.audio.activity.AudioRecorderActivity"
93
            android:theme="@style/AudioDialogTheme" >
94
        </activity>
95
		<!-- 播放音乐 -->
96
        <activity
97
            android:name="com.wade.mobile.common.audio.activity.AudioPlayerActivity"
98
            android:theme="@style/AudioDialogTheme" >
99
        </activity>
100
        <!-- 标记地图 -->
101
        <activity android:name="com.wade.mobile.common.map.activity.MarkMapActivity">
102
        </activity>
103
        <!-- 设定位置 -->
104
        <activity
105
            android:name="com.wade.mobile.common.map.activity.SelectLocationActivity"
106
            android:screenOrientation="portrait" >
107
        </activity>
108
    </application>
109
1
<?xml version="1.0" encoding="utf-8"?>
2
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
    package="com.ai.mobile.display"
4
    android:versionCode="1"
5
    android:versionName="1.2" >
6

7
    <uses-sdk
8
        android:minSdkVersion="8"
9
        android:targetSdkVersion="15" />
10

11
    <uses-permission android:name="android.permission.CAMERA" />
12
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
13
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
14
    <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
15
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
16
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
17
    <uses-permission android:name="android.permission.INTERNET" />
18
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
19
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
20
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
21
    <uses-permission android:name="android.permission.READ_CONTACTS" />
22
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
23
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
24
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
25
    <uses-permission android:name="android.permission.CALL_PHONE" />
26
    <uses-permission android:name="android.permission.SEND_SMS" />
27
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
28
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
29
    <uses-permission android:name="android.permission.BLUETOOTH" />
30
    <uses-permission android:name="android.permission.VIBRATE" /> <!-- 震动权限 -->
31
    <uses-feature android:name="android.hardware.camera" /> <!-- 使用照相机权限 -->
32
    <uses-feature android:name="android.hardware.camera.autofocus" /> <!-- 自动聚焦权限 -->
33
    <uses-permission android:name="android.permission.FLASHLIGHT" /> <!-- 开启闪光灯权限 -->
34
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <!-- 蓝牙 -->
35
    <uses-permission android:name="android.permission.BLUETOOTH" />
36
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
37
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
38
    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
39
    <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
40

41
    <application
42
        android:allowBackup="true"
43
        android:icon="@drawable/ic_launcher"
44
        android:label="@string/app_name"
45
        android:theme="@style/AppTheme" >
46
        <meta-data
47
            android:name="com.amap.api.v2.apikey"
48
            android:value="6afee5dced4c3b3a43c0feb11399bded"/>
49
        <activity
50
            android:name="com.ai.mobile.display.MainActivity"
51
            android:configChanges="orientation|keyboardHidden"
52
            android:label="@string/app_name"
53
            android:screenOrientation="portrait"
54
            android:windowSoftInputMode="stateHidden|adjustResize" >
55
            <intent-filter>
56
                <action android:name="android.intent.action.MAIN" />
57

58
                <category android:name="android.intent.category.LAUNCHER" />
59
            </intent-filter>
60
        </activity>
61
        <!-- 注册推送服务 -->
62
        <service android:name="com.ai.mobile.im.PushService" android:process=":WmPush" />
63
        
64
        <!-- 对话框 -->
65
        <activity
66
            android:name="com.wade.mobile.ui.activity.CustomDialogActivity"
67
            android:theme="@style/CustomDialogTheme" >
68
        </activity>
69
        <!-- 窗口 -->
70
        <activity
71
            android:name="com.wade.mobile.ui.activity.CustomWindowActivity">
72
        </activity>
73
        <!-- 侧滑菜单 -->
74
        <activity android:name="com.wade.mobile.ui.activity.SlidingMenuActivity"
75
            android:theme="@style/SlidingMenuTheme" >
76
        </activity>
77
        <!-- 蓝牙分享 -->
78
        <activity
79
            android:name="com.wade.mobile.common.bluetooth.activity.ShareByBluetoothActivity"
80
            android:theme="@style/ShareApkDialogTheme" >
81
        </activity>
82
        <!-- 二维码扫描 -->
83
        <activity
84
            android:name="com.wade.mobile.common.scan.activity.CaptureActivity"
85
            android:configChanges="orientation|keyboardHidden"   
86
            android:screenOrientation="portrait" >
87
        </activity>
88
        <!-- 音乐播放服务 -->
89
        <service android:name="com.wade.mobile.common.audio.play.AudioPlayerService" />
90
        <!-- 录制声音 -->
91
        <activity
92
            android:name="com.wade.mobile.common.audio.activity.AudioRecorderActivity"
93
            android:theme="@style/AudioDialogTheme" >
94
        </activity>
95
		<!-- 播放音乐 -->
96
        <activity
97
            android:name="com.wade.mobile.common.audio.activity.AudioPlayerActivity"
98
            android:theme="@style/AudioDialogTheme" >
99
        </activity>
100
        <!-- 标记地图 -->
101
        <activity android:name="com.wade.mobile.common.map.activity.MarkMapActivity">
102
        </activity>
103
        <!-- 设定位置 -->
104
        <activity
105
            android:name="com.wade.mobile.common.map.activity.SelectLocationActivity"
106
            android:screenOrientation="portrait" >
107
        </activity>
108
    </application>
109

110 110
</manifest>

+ 3 - 3
display-server/.gitignore

@ -1,3 +1,3 @@
1
/.classpath
2
/.settings
3
/display.war
1
/.classpath
2
/.settings
3
/display.war

+ 7 - 3
display-server/etc/server-page.xml

@ -19,7 +19,10 @@
19 19
	<!-- 提供给UI使用 -->
20 20
	<action name="UI-CustomDialog" template="template/webapp/plugin/UI-CustomDialog.html"></action>
21 21
	<action name="UI-CustomWindow" template="template/webapp/plugin/UI-CustomWindow.html"></action>
22
	<action name="UI-SlidingMenu" template="template/webapp/plugin/UI-SlidingMenu.html"></action>
22
	<action name="UI-SlidingMenu" template="template/webapp/plugin/UI-SlidingMenu.html"></action>
23
	<action name="FileUpload" template="template/webapp/plugin/FileUpload.html"></action>
24
	<action name="RecordVideo" template="template/webapp/plugin/Video.html"></action>
25
23 26
	<action name="QR" template="template/webapp/plugin/QR.html"></action>
24 27
	<action name="Audio" template="template/webapp/plugin/Audio.html"></action>
25 28
	<action name="Video" template="template/webapp/plugin/Video.html"></action>
@ -27,7 +30,7 @@
27 30
	<action name="UploadDownload" template="template/webapp/plugin/UploadDownload.html"></action>
28 31
	<action name="YunbaPush" template="template/webapp/plugin/YunbaPush.html"></action>
29 32
	<action name="Contacts" template="template/webapp/plugin/Contacts.html"></action>
30
	
33
31 34
	<!-- Web Component Demo-->
32 35
	<action name="WmTab" template="template/webapp/tag/WmTab.html"></action>
33 36
	<action name="WmTabbar" template="template/webapp/tag/WmTabbar.html"></action>
@ -103,5 +106,6 @@
103 106
	<action name="TemplateRefresh" template="template/webapp/scene/TemplateRefresh.html"></action>
104 107
	<action name="PageRefresh" template="template/webapp/scene/PageRefresh.html"></action>
105 108
	
109
	<!-- 测试gum日历插件 -->	
106 110
	<action name="testCalendar" template="template/calendar/calendar.html"></action>
107
</pages>
111
</pages>

+ 88 - 88
display-server/src/com/ai/server/util/ImageVerify.java

@ -1,88 +1,88 @@
1
package com.ai.server.util;
2
3
import java.awt.Color;
4
import java.awt.Font;
5
import java.awt.Graphics2D;
6
import java.awt.image.BufferedImage;
7
import java.io.ByteArrayOutputStream;
8
import java.io.IOException;
9
import java.util.Random;
10
11
import javax.imageio.ImageIO;
12
13
import org.apache.commons.codec.binary.Base64;
14
15
/**
16
 * @author huangbo
17
 * 图片验证码类库
18
 */
19
public class ImageVerify {
20
	private static Random random = new Random();
21
22
	/**得到图片背景色*/
23
	private static Color getBack() {
24
		return new Color(random.nextInt(255), random.nextInt(255), random.nextInt(255));
25
	}
26
27
	/**生成颜色的反色*/
28
	private static Color getFront(Color c) {
29
		return new Color(255 - c.getRed(), 255 - c.getGreen(),
30
				255 - c.getBlue());
31
	}
32
	
33
	/**
34
	 * 图片转化成Base64编码
35
	 * @param filePath 文件过大可能内存溢出
36
	 */
37
	public static String getImageBase64(BufferedImage image) throws IOException {
38
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
39
		ImageIO.write(image, "jpg", baos);
40
		byte[] jpegData = baos.toByteArray();
41
		return new String(Base64.encodeBase64(jpegData), "utf-8");
42
	}
43
	
44
	/**
45
	 * 生成校验图片
46
	 */
47
	public static BufferedImage getImageVerify(String code) {
48
		int width = 100;
49
		int height = 45; // 验证图片的宽度,高度
50
		Color back = getBack();
51
		Color front = getFront(back);
52
		BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_BGR);
53
		Graphics2D g = bi.createGraphics(); // 得到画布
54
		g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 20)); // 设置字体
55
		g.setColor(back);
56
		g.fillRect(0, 0, width, height); // 画背景
57
		g.setColor(front);
58
		g.drawString(code, 18, 20); // 画字符
59
		for (int i = 0, n = random.nextInt(20); i < n; i++) {
60
			g.fillRect(random.nextInt(width), random.nextInt(height), 1, 1);
61
		} // 产生至多20个噪点
62
		return bi;
63
	}
64
65
	/**
66
	 * 作用:获取六位随机码
67
	 */
68
	public static String getVerifyCode(int length, int verifyCodeType) throws Exception {
69
		String num = "0123456789";
70
		String ch = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ";
71
		String vc = "";
72
73
		if (verifyCodeType == 0)
74
			vc = num;
75
		else if (verifyCodeType == 1)
76
			vc = ch;
77
		else
78
			vc = num + ch;
79
80
		char[] chs = vc.toCharArray();
81
		String code = "";
82
		for (int i = 0; i < length; i++) {
83
			code += chs[(int) (Math.random() * vc.length())];
84
		}
85
		
86
		return code;
87
	}
88
}
1
package com.ai.server.util;
2

3
import java.awt.Color;
4
import java.awt.Font;
5
import java.awt.Graphics2D;
6
import java.awt.image.BufferedImage;
7
import java.io.ByteArrayOutputStream;
8
import java.io.IOException;
9
import java.util.Random;
10

11
import javax.imageio.ImageIO;
12

13
import org.apache.commons.codec.binary.Base64;
14

15
/**
16
 * @author huangbo
17
 * 图片验证码类库
18
 */
19
public class ImageVerify {
20
	private static Random random = new Random();
21

22
	/**得到图片背景色*/
23
	private static Color getBack() {
24
		return new Color(random.nextInt(255), random.nextInt(255), random.nextInt(255));
25
	}
26

27
	/**生成颜色的反色*/
28
	private static Color getFront(Color c) {
29
		return new Color(255 - c.getRed(), 255 - c.getGreen(),
30
				255 - c.getBlue());
31
	}
32
	
33
	/**
34
	 * 图片转化成Base64编码
35
	 * @param filePath 文件过大可能内存溢出
36
	 */
37
	public static String getImageBase64(BufferedImage image) throws IOException {
38
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
39
		ImageIO.write(image, "jpg", baos);
40
		byte[] jpegData = baos.toByteArray();
41
		return new String(Base64.encodeBase64(jpegData), "utf-8");
42
	}
43
	
44
	/**
45
	 * 生成校验图片
46
	 */
47
	public static BufferedImage getImageVerify(String code) {
48
		int width = 100;
49
		int height = 45; // 验证图片的宽度,高度
50
		Color back = getBack();
51
		Color front = getFront(back);
52
		BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_BGR);
53
		Graphics2D g = bi.createGraphics(); // 得到画布
54
		g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 20)); // 设置字体
55
		g.setColor(back);
56
		g.fillRect(0, 0, width, height); // 画背景
57
		g.setColor(front);
58
		g.drawString(code, 18, 20); // 画字符
59
		for (int i = 0, n = random.nextInt(20); i < n; i++) {
60
			g.fillRect(random.nextInt(width), random.nextInt(height), 1, 1);
61
		} // 产生至多20个噪点
62
		return bi;
63
	}
64

65
	/**
66
	 * 作用:获取六位随机码
67
	 */
68
	public static String getVerifyCode(int length, int verifyCodeType) throws Exception {
69
		String num = "0123456789";
70
		String ch = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ";
71
		String vc = "";
72

73
		if (verifyCodeType == 0)
74
			vc = num;
75
		else if (verifyCodeType == 1)
76
			vc = ch;
77
		else
78
			vc = num + ch;
79

80
		char[] chs = vc.toCharArray();
81
		String code = "";
82
		for (int i = 0; i < length; i++) {
83
			code += chs[(int) (Math.random() * vc.length())];
84
		}
85
		
86
		return code;
87
	}
88
}

+ 4 - 1
display-server/web/res/js/mobile/expand-mobile.js

@ -248,6 +248,9 @@ define(["require"],function(require) {
248 248
			},playVideo:function(callback,videoPath,err){
249 249
				storageCallback("playVideo",callback);
250 250
				execute("playVideo",[videoPath],err);	
251
			},getContacts:function(callback,err){
252
				storageCallback("getContacts",callback);
253
				execute("getContacts",[], err);	
251 254
			}
252 255
		};
253 256
	})();
@ -269,4 +272,4 @@ define(["require"],function(require) {
269 272
	}
270 273
	
271 274
	return ExpandMobile;
272
});
275
});

+ 3 - 3
push-server/.gitignore

@ -1,3 +1,3 @@
1
/push.war
2
/.classpath
3
/bin/*
1
/push.war
2
/.classpath
3
/bin/*