This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String decrypt(String encryptedData) throws Exception { | |
Key key = new SecretKeySpec(KEY.getBytes(), "AES"); | |
Cipher c = Cipher.getInstance("AES/CBC/NoPadding"); | |
IvParameterSpec iv = new IvParameterSpec(IV.getBytes()); | |
c.init(Cipher.DECRYPT_MODE, key,iv); | |
byte[] decValue = c.doFinal(encryptedData.getBytes()); | |
String decryptedValue = new String(decValue); | |
return decryptedValue; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 16进制MD5值 | |
* @param message | |
* @return | |
* @throws Exception | |
*/ | |
private String hexdigest(String message) throws Exception { | |
String hd; | |
MessageDigest md5 = MessageDigest.getInstance("MD5"); | |
md5.update(message.getBytes()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(intent.getAction())) { | |
Parcelable parcelableExtra = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO); | |
if (null != parcelableExtra) { | |
NetworkInfo networkInfo = (NetworkInfo) parcelableExtra; | |
if (networkInfo.getState() == State.CONNECTED) { | |
netManager.start(true); | |
} else if (networkInfo.getState() == State.DISCONNECTED) { | |
Const.IS_CONNECTED = false; | |
netManager.close(); | |
Intent netDis = new Intent(Const.NET_STATE_DISCONNECT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import selenium | |
from scrapy.spider import BaseSpider | |
from scrapy.http import Request | |
import time | |
import lxml.html | |
class SeleniumSprider(BaseSpider): | |
name = "selenium" | |
allowed_domains = ['selenium.com'] | |
start_urls = ["http://localhost"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void showNotification(Context context){ | |
Bitmap btm = BitmapFactory.decodeResource(context.getResources(), R.drawable.ic_launcher); | |
NotificationCompat.Builder builder = new NotificationCompat.Builder(context) | |
.setSmallIcon(R.drawable.ic_launcher) | |
.setContentTitle(context.getString(R.string.please_record_today_event)) | |
.setContentText(context.getString(R.string.alarm_summary)); | |
// 第一次提示消息的时候显示在通知栏上 | |
builder.setTicker(context.getString(R.string.please_record_today_event)); | |
// builder.setNumber(12); | |
builder.setLargeIcon(btm); |
NewerOlder