1.winrar
2.githubのJD-GUI
http://java-decompiler.github.io/
SignNatureTest.javaの パッケージcom.gatewayrmb。 輸入java.utilの。*; 輸入org.apache.commons.codec.digest.DigestUtils。 輸入org.apache.commons.lang3.StringUtils。 輸入java.text.SimpleDateFormatの。 輸入java.util.Date; パブリッククラスSignNatureTest { 公共の静的な文字列createSign(MAP <文字列、文字列> paramsは、文字列のPrivateKey){ StringBuilderのSB =新規のStringBuilder(); //韩 地図<文字列、文字列> sortParams =新しいTreeMapを<文字列、文字列>(のparams); 用(のMap.Entry <文字列、文字列>エントリ:sortParams.entrySet()){ 文字列キー= entry.getKey()。 文字列値= entry.getValue()(トリム)。 もし(StringUtils.isNotEmpty(値)) sb.append( "&")(キー).append( "=")を付加(値)を追加します。。。 } System.out.print(SB)。 ストリングstringA = sb.toString()replaceFirstという( "&"、 "")。 文字列stringSignTemp = stringA +のPrivateKey; DigestUtils.md5Hex(stringSignTemp)を返します。 } 公共の静的な文字列getTimestamp(){ // INT STRに INT S = 2。 列B =持つInteger.toString(S)。 // String.valueOf(O) を返すString.valueOf(のSystem.currentTimeMillis()); } 公共の静的な文字列testTime(){ てSimpleDateFormat形式=新しいてSimpleDateFormat( "YYYY-MM-DD HH:MM:SS")。 文字列のスタンプ= formats.format(新しいDate()); System.out.print(スタンプ)。 String.valueOf(スタンプ)を返します。 } パブリック静的無効メイン(文字列[] args){ HashMapの<文字列、文字列>マップ=新しいHashMapの<>(); map.put( "K1"、 "values1"); map.put( "K2"、 "33")。 文字列にmykey =「塩」。 System.out.print( "\ nMD5stringは:" + createSign(マップ、mykeyという)); testTime(); // System.out.print( "私はクラスを置き換えています"); } }
//依存 <依存性> <! - https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 - > <依存> <groupIdを> org.apache.commons </ groupIdを> <たartifactId>コモンズ-lang3 </たartifactId> <バージョン> 3.9 </ version>の </依存関係> <! - https://mvnrepository.com/artifact/org.apache.directory.studio/org.apache.commons.codec - > <依存> <groupIdを> org.apache.directory.studio </ groupIdを> <たartifactId> org.apache.commons.codec </たartifactId> <バージョン> 1.3 </ version>の </依存関係>