alipay 无线 & PHP

详细下载demo,看文档:

http://download.alipay.com/public/api/base/WS_SECURE_PAY_SDK.zip

移动快捷支付应用集成接入包支付接口接入与使用规则.pdf

主要说明:

php 端,技术客服说,新版本sdk,使用统一公钥,即:

1.android端用商家生成的公钥和密钥,android的配置 密钥需要  pkcs8

2.php端,使用原来的demo里的公钥和密钥

郁闷呐。东西搞好后心血来潮去修改反而挂了.

测试小技巧.

服务器端测试数据post以var_export保存成文本文件,然后进行验证测试.

主要解决函数的相关启用是否开启.

转发请注明出处http://blog.martoo.cn
如有漏缺,请联系我 QQ 243008827

ANDROID & PHP 通讯加密解密

参考:

http://www.androidsnippets.com/encrypt-decrypt-between-android-and-php

注意:密钥和填充函数的类型和值.

附加动态密钥解决方案:

每次会话生成一个token外反回一个关联的密钥,客户端和服务器端的通讯基于这个密钥.

原理简单,可以降低危害。即使代码反编译成功,也无法对其它帐号造成影响.

 

附加json 处理

附加包的参考:

http://blog.csdn.net/zenson_g/article/details/8491436

注:

JSONObject!=JSONArray

 

demo-php:

$mcrypt = new MCrypt ();
// ncrypt
$data = array (
		'asd' => 'as!@#!@你dfas' 
);
$data = json_encode ( $data );
echo $data;
echo '<br>';
echo $encrypted = $mcrypt->encrypt ($data);

demo-java:

package my3des;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class tempx {
	public static void main(String[] arges) {
		MCrypt mcrypt = new MCrypt();
		String encrypted;
		try {
			String decrypted = new String(mcrypt.decrypt("3a219b7b3990fc86b8d96f8d14c7a17c5800794dcd1b5f42113f7e0473a8a22e"));
			System.out.print(decrypted);
			JSONObject jsonArray = JSONObject.fromObject(decrypted);  
			System.out.println( jsonArray );  
			System.out.print(jsonArray.get("asd"));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

转发请注明出处http://blog.martoo.cn
如有漏缺,请联系我 QQ 243008827

Andriod 模拟操作

getevent sendevent 不好用,使用也比较繁琐

推荐

input  [text|keyevent|touchscreen|trackball] //[文本|按键|触摸点|拖动]

text <scring> 在检点处输入文本
keyevent <key code number or name> 按键触发
touchscreen tap <x> <y> 点
touchscreen swipe <x1> <y1> <x2> <y2> 多点触摸
trackball press 触摸
trackball roll <dx> <dy> 拖

keyevent 比较多参考:

http://stackoverflow.com/questions/7789826/adb-shell-input-events

其它都是简单即可查看

转发请注明出处http://blog.martoo.cn
如有漏缺,请联系我 QQ 243008827

windows server service pack2 iis 配置

服务器:windows server service pack2

iis 版本:iis 7.0

相关问题解决方式:

目录设置了iis用户组,但是程序提示没有写入权限,一个一个看哪个没有设置写入权限。发现唯独users没有,设之。解决

php安装:

参考:http://php.net/manual/zh/install.windows.iis7.php

注意php5.3版本才有安装类型5.4以上都为配置类型。用5.3

注意开启需要在服务器管理中,以角色方式添加

http://pengjh.blog.51cto.com/2793198/616069

默认没有开启短标签,需要在php.ini里设置

urlrewrite安装:

实现asp.net网站整站伪静态化需要以下条件:
1.IIS7.0 (目前Url Rewrite Module仅支持IIS7);
2.Url Rewrite Module,

下载地址:http://www.iis.net/expand/URLRewrite

如果提示未验证无法安装,点击站点。看管理中是否有平台安装。

在产品里找到url重写2.0进行安装.

注:新版本平台安装打不开,需要手动下载安装

http://www.microsoft.com/zh-cn/download/confirmation.aspx?id=7435

安装后需要重启

重写设置问题

这边有个便捷的设置方式。原项目如果有.htaccess或者会配置,在url规则中选择导入原.htaccess即可 ^_^~~!

Mysql 省略.

ftp 版本:6.0

创建ftp用户组,创建ftp用户

主要是隔离方式登录有问题。

因为只针对一个户,不设置隔离模式。即可。

匿名关闭。

转发请注明出处http://blog.martoo.cn
如有漏缺,请联系我 QQ 243008827

 

探究 Zend Guard 加密&解密

参考:http://zhainan.org/post-1667.html

解密:黑刀  http://www.tmd.me/2008/read.php/50.htm

补充:

zend guard 6.0的费用不低,在接连5.0~5.5被轻松反编译的现在。估计6.0也是早晚的事。觉得还是干扰名比较好。

但是基于维护不方便性,比如原来的项目已经部署上线的情况下。不可能进行重新生成。和覆盖。这块需要继续探究解决方案。

做为单一小脚本和核心功能模块处理的情况下仍推荐用变量名干扰。这样用5.0即可,且支持的5.2的环境比较多。

转发请注明出处http://blog.martoo.cn
如有漏缺,请联系我 QQ 243008827

 

生成随机身份证和中文名

中文名:

var originalString='赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何吕施张孔曹严华金魏陶姜戚谢邹喻柏水窦章云苏潘葛奚范彭郎鲁韦昌马苗凤花方俞任袁柳酆鲍史唐费廉岑薛雷贺倪汤滕殷罗毕郝邬安常乐于时傅皮卞齐康伍余元卜顾孟平黄和穆萧尹姚邵湛汪祁毛禹狄米贝明臧计伏成戴谈宋茅庞熊纪舒屈项祝董梁杜阮蓝闵席季麻强贾路娄危江童颜郭梅盛林刁钟徐邱骆高夏蔡田樊胡凌霍虞万支柯昝管卢莫柯房裘缪干解应宗丁宣贲邓郁单杭洪包诸左石崔吉钮龚程嵇邢滑裴陆荣翁荀羊于惠甄曲家封芮羿储靳汲邴糜松井段富巫乌焦巴弓牧隗山谷车侯宓蓬全郗班仰秋仲伊宫宁仇栾暴甘钭历戎祖武符刘景詹束龙叶幸司韶郜黎蓟溥印宿白怀蒲邰从鄂索咸籍赖卓蔺屠蒙池乔阳郁胥能苍双闻莘党翟谭贡劳逄姬申扶堵冉宰郦雍却璩桑桂濮牛寿通边扈燕冀浦尚农温别庄晏柴瞿阎充慕连茹习宦艾鱼容向古易慎戈廖庾终暨居衡步都耿满弘匡国文寇广禄阙东欧殳沃利蔚越夔隆师巩厍聂晁勾敖融冷訾辛阚那简饶空曾毋沙乜养鞠须丰巢关蒯相查后荆红游竺权逮盍益桓公万俟司马上官欧阳夏侯诸葛闻人东方赫连皇甫尉迟公羊澹台公冶宗政濮阳淳于单于太叔申屠公孙仲孙轩辕令狐徐离宇文长孙慕容司徒司空';
function getStr(){
	var tmp="";
	for(var i=0;i<3;i++)
	{
	var stringLength=Math.random()*originalString.length;
	tmp+=originalString.charAt(Math.ceil(stringLength)%originalString.length);
	}
	return tmp;
}

身份证号:

// /地区编码
	var city = new Array("110113","120223","130403","130425","130433","130731","131000","131023","131024","131081","140106","140222","140226","140227","140524","140600","140828","140922","140981","141129","141130","150426","150525","150727","152525","210201","210300","210801","211101","220103","220182","220203","220323","220500","220821","222400","230108","230307","230703","230710","230833","231003","231222","231223","231281","232721","232722","320201","320302","320503","320584","320724","320831","320902","320982","321003","321081","321181","321201","330000","330108","330122","330183","330205","330225","330411","330600","330723","340103","340207","340301","340603","340802","341221","341421","341521","341822","350206","350427","350526","350721","360421","360425","360428","370105","370611","370685","370687","370883","370900","370921","371311","371422","371424","410302","410782","411081","411421","420607","420800","420900","430102","430122","430225","430301","430401","430511","430624","430922","431027","431127","431201","440306","440703","440923","441400","441821","441827","441882","445321","450100","450224","450521","450701","450923","450981","451022","451029","451421","451424","460200","500232","500237","510106","510112","510183","510503","510601","510683","510903","511524","511602","511823","513224","513229","513328","520300","520326","522422","522633","522700","530103","530501","530702","532600","532622","533324","542100","542125","542227","542322","542331","542421","542424","542525","542626","610301","610429","610528","610702","610901","610926","620524","620901","621124","621201","621226","623026","632126","632523","632821","652300","652901","653000","653022","653121","653123","653128","653200","654021"
	);

	var pow = new Array("7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2");
	var ex = new Array("1","0","X","9","8","7","6","5","4","3","2");

	// /年月日
	function getYMD() {
	    var ymd = "";
	    var y =  parseInt(Math.random() * 99);
	    if(y < 10)y = "0" + y;
	    y = "19" + y;
	    var m =  parseInt(Math.random() * 13);
	    if(m < 10)m = "0" + m;
	    if(m == "00")m = "01";
	    var d =  parseInt(Math.random() * 28);
	    if(d < 10) d = "0" + d;
	    if(d == "00") d = "01";
	    ymd = "" + y + m + d;
	    return ymd;
	}

	//生成号码
	function makeId(){
	    var idcard;
	    idcard = city[parseInt(Math.random() * 189)]
	    + getYMD()
	    + parseInt(Math.random() * 9)       //
	    + parseInt(Math.random() * 9)       //
	    + parseInt(Math.random() * 9);      //

	    var sum = 0;
	    for(var i = 0;i < idcard.length;i++){
	        sum += parseInt(idcard.substring(i,i + 1)) * parseInt(pow[i]);
	    }
	    return  idcard + ex[sum % 11];
	}

 

转发请注明出处http://blog.martoo.cn
如有漏缺,请联系我 QQ 243008827

j2se exe4j 打包 + 注册码

参考: http://www.cnblogs.com/icewee/articles/2073203.html

版本:4.5.2

系统:xp

附64位:http://download.csdn.net/detail/inkfish/5290262

注册码:L-g782dn2d-1f1yqxx1rv1sqd

简单写了个弹出框,用了exe4j 和 jsmooth做尝试 但是发现  jsmooth 容易出些奇怪的问题.exe4j的使用也不算难。暂时不考虑.

 

转发请注明出处http://blog.martoo.cn
如有漏缺,请联系我 QQ 243008827