2014-03-07 29 views

回答

0

我會做將啓用/禁用整個應用程序的使用Cookie的方式:

CookieManager mCookieManager = CookieManager.getInstance(); 
CookieSyncManager.createInstance(this); 
mCookieManager.setAcceptCookie(false); //disables cookies for the WebView until the user enters a correct pin 

if(getUsersPin()) { //getUsersPin() gets the pin from the user 
    mCookieManager.setAcceptCookie(true); 
} 
+0

如果攻擊者獲取裝置,該cookie會坐在那裏,在磁盤上。這是我試圖阻止的矢量。該應用程序正在保護關鍵信息。 – returneax

+0

Cookie以應用程序數據保護,因此除非設備植根,否則獲取設備的用戶無法訪問它們。看起來你要求的是加密cookies數據庫本身,我不知道該怎麼做,但是如果你已經有了一個加密方法,只需要加密包含cookies的.db文件。它位於您的應用的/ data文件夾中。 – anthonycr

+0

@returneax提到這個問題http://stackoverflow.com/questions/4275311/how-to-encrypt-and-decrypt-file-in-android爲了加密/解密cookie文件。 – anthonycr

相關問題