最基本的是在app 剛開啟時試讀 DB,
private static boolean doesDatabaseExist(Context context, String dbName) {
File dbFile = context.getDatabasePath(dbName);
return dbFile.exists();
}
要是不存在DB就創建一個,紀錄現時time stemp,那你就會有用戶第一次開啟app 時的日期時間
要是存在DB,就比較現時 time stemp 和紀錄中的 time stemp,要是相差的時間大於試用期的時間,就限制app 的功能
這個方法的問題是要是用戶清理了資料就會重置試用期
但基本上……任何一種的試用期都總有方法破解啊~~
(If something could be read and understood by computer, then it could be also edited by computer)
|