num lines-num-new"> 74
				execute("openWindow", [pageAction,param],err);
75
			},closeWindow:function(result,state,err){
76
				execute("closeWindow", [result,state],err);
77
			},openSlidingMenu:function(callback,action,param,width,height,leftMargin,topMargin,err){
78
				WadeMobile.callback.storageCallback("openSlidingMenu",callback);
79
				execute("openSlidingMenu", [action,param,width,height,leftMargin,topMargin],err);
80
			},closeSlidingMenu:function(result,state,err){
81
				execute("closeSlidingMenu", [result,state],err);
82
			}
83
		};
84
	})();
85
	
86
	//全局变量
87
	var callbackId = 0;
88
	var callbacks = {};//用来存放成功和失败的js回调函数
89
	var callbackDefine = {};//用来存放自定义的js回调函数
90
	var globalErrorKey = null;//全局错误关键字,定位错误
91
	
92
	/*绝大多数情况下,success回调函数是用不上的,有需要回调函数的时候异步方式传入取值*/
93
	var isAlert = true;//防止反复弹出alert
94
	var execute = function(action, args, error, success){
95
        args = stringify(args);
96
		if(terminalType=="a"){
97
			androidExecute(action, args, error, success);
98
		}else if(terminalType=="i"){
99
			iosExecute(action, args, error, success);
100
		}else if(terminalType=="w"){
101
			winphoneExecute(action, args, error, success);
102
		}else{
103
			if(isAlert){
104
				isAlert = false
105
				alert(action+"无终端类型");
106
			}else{
107
				console.log(action+"无终端类型");
108
			}
109
		}
110
	};
111
	
112
	WadeMobile.execute = execute;
113
	
114
	var androidExecute = function(action, args, error, success){
115
        var callbackKey = globalErrorKey = action+callbackId++;
116
        if (success || error) {
117
    		callbacks[callbackKey] = {success:success, error:error};
118
        }
119
        if(WadeMobile.debug){
120
        	//alert("准备调用"+action+" 参数:"+args);
121
        	console.log("action:"+action+" param:"+args);
122
        }
123
        PluginManager.exec(action, callbackKey, args);
124
        globalErrorKey = null;
125
	};
126
 
127
    var iosExecute = function(action, args, error, success){
128
        var callbackKey = globalErrorKey = action+callbackId++;
129
        if (success || error) {
130
            callbacks[callbackKey] = {success:success, error:error};
131
        }
132
        if(WadeMobile.debug){
133
            //alert("准备调用"+action+" 参数:"+args);
134
            console.log("action:"+action+" param:"+args);
135
        }
136
        
137
        var WADE_SCHEME = "wade://";
138
        var url = WADE_SCHEME+action+"?param="+encodeURIComponent(args)+"&callback="+callbackKey;
139
        //一个动作请求客户端的最大数量,超过会造成请求覆盖
140
        var limitAction = 10;
141
        var ifrmName = "WADE_FRAME_"+(callbackId%limitAction);
142
        var ifrm = document.getElementById(ifrmName);
143
        if(!ifrm){
144
            var ifrm = document.createElement("iframe");
145
            ifrm.setAttribute("id",ifrmName);
146
            ifrm.setAttribute("width","0");
147
            ifrm.setAttribute("height","0");
148
            ifrm.setAttribute("border","0");
149
            ifrm.setAttribute("frameBorder","0");
150
            ifrm.setAttribute("name",ifrmName);
151
            document.body.appendChild(ifrm);
152
        }
153
        document.getElementById(ifrmName).contentWindow.location = encodeURIComponent(url);
154
        //document.getElementById(ifrmName).src = encodeURI(url);//无法处理&符号
155
        globalErrorKey = null;
156
	};
157
	
158
	var winphoneExecute = function(action, args, error, success){
159
        var callbackKey = globalErrorKey = action+callbackId++;
160
        if (success || error) {
161
    		callbacks[callbackKey] = {success:success, error:error};
162
        }
163
        if(WadeMobile.debug){
164
        	//alert("准备调用"+action+" 参数:"+args);
165
        	console.log("action:"+action+" param:"+args);
166
        }
167
      	window.external.Notify(stringify([action, callbackKey, args])); //[action, callbackKey, args]
168
      	globalErrorKey = null;
169
	};
170
	
171
	WadeMobile.callback = (function(){
172
		return{
173
			success:function(callbackKey, message) {
174
				if(typeof message == "undefined"){
175
					return;
176
				}
177
			    if (callbacks[callbackKey]) {
178
	                if (callbacks[callbackKey].success) {
179
	                	if(typeof callbacks[callbackKey].success==="function"){
180
	                		var func = callbacks[callbackKey].success;
181
	                		func(message);
182
	                	}else{
183
	                		_eval(callbacks[callbackKey].success+"('"+message+"','"+callbackKey+"')");
184
	                	}
185
	                }
186
			        if (callbacks[callbackKey]) {
187
			            delete callbacks[callbackKey];
188
			        }
189
			    }
190
			},error:function(callbackKey, message, isEncode) {
191
				if(typeof message == "undefined"){
192
					return;
193
				}
194
        		if(isEncode){
195
        			message = decodeURIComponent(message);
196
        		}
197
			    if (callbacks[callbackKey]) {
198
		            if (callbacks[callbackKey].error) {
199
		                if(typeof callbacks[callbackKey].error==="function"){
200
		                	var func = callbacks[callbackKey].error;
201
		                	func(message);
202
	                	}else{
203
	                		_eval(callbacks[callbackKey].error+"('"+message+"','"+callbackKey+"')");
204
	                	}
205
		            }
206
			        if (callbacks[callbackKey]) {
207
			            delete callbacks[callbackKey];
208
			        }
209
			    }else{
210
			    	alert(message);
211
			    }
212
			},storageCallback:function(action,callback){
213
				var callbackKey = action+callbackId;
214
				if (callback) {
215
		            callbackDefine[callbackKey] = {callback:callback};
216
		        }
217
			},execCallback:function(callbackKey, data, isEncode){
218
				globalErrorKey = callbackKey;
219
				var callbackItem = callbackDefine[callbackKey];
220
				if (callbackItem) {
221
					data = data=="null"?null:data;
222
					if(data){
223
		        		if(isEncode){
224
		        			data = decodeURIComponent(data);
225
		        		}
226
		        	}
227
		            if (callbackItem.callback) {   
228
		                if(typeof callbackItem.callback==="function"){
229
		                	var func = callbackItem.callback;
230
		                	func(data);
231
	                	}else{
232
	                		_eval(callbackItem.callback+"('"+data+"','"+callbackKey+"')");
233
	                	}
234
		            }
235
			        if (callbackItem) {
236
			            delete callbackDefine[callbackKey];
237
			        }
238
			    }
239
				globalErrorKey = null;
240
			}
241
		};
242
	})();
243
	
244
	WadeMobile.event = (function(){
245
		if(WadeMobile.isApp()){
246
			var e = document.createEvent('Events');
247
			return {
248
				back:function(){
249
					e.initEvent('backKeyDown');
250
					document.dispatchEvent(e);
251
				},menu:function(){
252
					e.initEvent('menuKeyDown');
253
				    document.dispatchEvent(e);
254
				},search:function(){
255
					e.initEvent('searchKeyDown');
256
				    document.dispatchEvent(e);
257
				}
258
			};
259
		}
260
	})();
261
	
262
	/************公共方法**************/
263
	/**
264
	 * @param {String}  errorMessage   错误信息
265
	 * @param {String}  scriptURI      错误文件
266
	 * @param {Long}    lineNumber     错误行号
267
	 */
268
	window.onerror = function(errorMessage, scriptURI, lineNumber) {
269
		var msgArray = new Array();
270
		if (errorMessage)
271
			msgArray.push("错误信息:" + errorMessage);
272
		if (lineNumber)
273
			msgArray.push("错误行号:" + lineNumber);
274
		if (globalErrorKey)
275
			msgArray.push("错误关键字:" + globalErrorKey);
276
		if (scriptURI)
277
			msgArray.push("错误文件:" + scriptURI);
278
		var msg = msgArray.join("\t\n");
279
		console.log(msg);
280
		alert(msg);
281
	};
282
	
283
	//动态执行js方法
284
	function _eval(code,action){
285
		if(WadeMobile.debug){
286
			alert(code);
287
		}
288
		var func = eval(code);
289
		if(typeof func==="function"){
290
			func();
291
		}
292
	}
293
	//格式转换方法
294
	function stringify(args) {
295
	    if (typeof JSON == "undefined") {
296
	        var s = "[";
297
	        for (var i=0; i<args.length; i++) {
298
	            if (i > 0) {
299
	                s = s + ",";
300
	            }
301
	            var type = typeof args[i];
302
	            if ((type == "number") || (type == "boolean")) {
303
	                s = s + args[i];
304
	            }
305
	            else if (args[i] instanceof Array) {
306
	            	s = s + "[" + args[i] + "]";
307
	            }
308
	            else if (args[i] instanceof Object) {
309
	            	var start = true;
310
	            	s = s + '{';
311
	            	for (var name in args[i]) {
312
	            		if (args[i][name] != null) {
313
		            		if (!start) {
314
		            			s = s + ',';
315
		            		}
316
		            		s = s + '"' + name + '":';
317
		            		var nameType = typeof args[i][name];
318
		            		if ((nameType == "number") || (nameType == "boolean")) {
319
		            			s = s + args[i][name];
320
		            		}
321
		            		else if ((typeof args[i][name]) == 'function') {
322
			           			// don't copy the functions
323
		            			s = s + '""'; 
324
		            		}
325
		            		else if (args[i][name] instanceof Object) {
326
		            			s = s + stringify(args[i][name]);
327
		            		}
328
		            		else {
329
		                        s = s + '"' + args[i][name] + '"';            			
330
		            		}
331
		                    start=false;
332
		                 }
333
	            	} 
334
	            	s = s + '}';
335
	            }else {
336
	                var a = args[i].replace(/\\/g, '\\\\');
337
	                a = a.replace(/"/g, '\\"');
338
	                s = s + '"' + a + '"';
339
	            }
340
	        }
341
	        s = s + "]";
342
	        return s;
343
	    }else {
344
	        return JSON.stringify(args);
345
	    }
346
	};
347
	
348
	return WadeMobile;
349
})();

二進制
wade-mobile-common/libs/wade-mobile-com.jar


二進制
wade-mobile-common/libs/wade-mobile-data.jar


二進制
wade-mobile-common/libs/wade-mobile-func.jar


二進制
wade-mobile-common/libs/wade-mobile-im.jar


二進制
wade-mobile-common/libs/wade-mobile-ui.jar


二進制
wade-mobile-common/libs/wade-mobile.jar


@优化:打包 包名配置 · 961d7b7cf5 - Nuosi Git Service
Quellcode durchsuchen

@优化:打包 包名配置

liuyf23 vor 2 Jahren
Ursprung
Commit
961d7b7cf5
1 geänderte Dateien mit 26 neuen und 1 gelöschten Zeilen
  1. 26 1
      superapp-client/app/build.gradle

+ 26 - 1
superapp-client/app/build.gradle

@ -30,16 +30,41 @@ android {
30 30
            storePassword 'showshow'
31 31
        }
32 32
    }
33
    
33
34 34
    buildTypes {
35 35
        release {
36 36
            minifyEnabled true
37 37
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
38 38
            signingConfig signingConfigs.release
39
40
            // 修改输出 apk 名称,如:超级客户端_v1.0_202209011022_release.apk
41
            applicationVariants.all { variant ->
42
                def suffix
43
                if (variant.buildType.name == 'release') {
44
                    suffix = 'release'
45
                } else {
46
                    suffix = 'debug'
47
                }
48
                variant.outputs.all { output ->
49
                    def outputFile = output.outputFile
50
                    if (outputFile != null && outputFile.name.endsWith('.apk')) {
51
                        def fileName = "超级客户端_v${defaultConfig.versionName}_${releaseTime()}_${suffix}.apk"
52
                        outputFileName = fileName
53
                    }
54
                }
55
            }
56
        }
57
        debug{
58
            signingConfig signingConfigs.debug
39 59
        }
40 60
    }
41 61
}
42 62
63
// 定义打包时间
64
static def releaseTime() {
65
    return new Date().format("yyyyMMddHHmm")
66
}
67
43 68
dependencies {
44 69
    implementation fileTree(dir: 'libs', include: ['*.jar'])
45 70
    /**