1.å
³äºAndroidå¼åä¸Java对äº.soåºçè°ç¨
å ³äºAndroidå¼åä¸Java对äº.soåºçè°ç¨
å家并没æ欺éªä½ æè æ¯å«ç³ä½ çææï¼ç¡®å®æ¯åªæä¾ç»ä½ jarå 以å so åºå°±å¯ä»¥äºï¼åæ³æ¯è¿æ ·åçï¼
1.æ¯å¦æç°å¨å¨ç¨net.sqlcipher.database è¿ä¸ªå å¯åºï¼ç½ä¸è½æå¾å°çï¼ç¨äºæ°æ®åºå å¯ï¼ã é£ä¹æç°å¨å°±å¨é¡¹ç®ç¨å è½½è¿ä¸ªjarå ï¼å¨ä½ ç项ç®åå»å³é®-ãå±æ§-ãJava Build Path-ãLibraries-ãAdd Jarsï¼éæ©æä¾ç»ä½ çjarå ï¼æè¿éæ¯ sqlcipher.jarï¼ç¶åå¨Order and Exportå¾éä½ ååå è½½ç jarå ãï¼
2.æå¼ä½ çworkspaceç®å½ï¼å¨ä½ ç项ç®ç®å½ä¸å建ä¸ä¸ªæ件夹libsï¼å¦ææ件夹ä¸åå¨çè¯ï¼,炼狱飞飞源码ç¶åå°æä¾ç»ä½ çsoåºæ¾å ¥è¯¥ç®å½ï¼åºæ¬æ¶æå°±ç®æ¯æ建好äºã
3.è¿è¡å¼åï¼è¿éä½ éè¦é®ä¸ä¸æä¾ç»ä½ jarå çå家ï¼åºæ¬çç¨æ³ï¼å¦åçè¯æ¯æ æ³è¿è¡å¼åçï¼å ä¸ºä½ é½ä¸ç¥éæä¹å»ç¨ã sqlcipherçåºæ¬ç¨æ³æ¯ï¼
SQLiteDatabase.loadLibs(this); //å è½½ soåºæ件ï¼ä½ çå家çæ¹æ³åºè¯¥ä¹æ¯ç±»ä¼¼ã
File databaseFile = getDatabasePath(SQLite_toll.DATABASE_NAME);
databaseFile.mkdirs();
databaseFile.delete();
SQLiteDatabase database = SQLiteDatabase.openOrCreateDatabase(databaseFile, helper_SharedPreferences.get_str_sp("database_cipher",this), null);
SQLite_toll initToll = new SQLite_toll(this, avaSys);
initToll.onCreate(database);
database.close();
//å 为æsqlcipheræ¯ç¨äºæ°æ®åºå å¯çï¼æä»¥ä½ æçå°çé½æ¯æ°æ®åºçä¸äºæ¹æ³ï¼ä½ å家æä¾ç»ä½ çjarå çç¨æ³ï¼ä½ æ¯è¦å»é®ä»ä»¬çï¼æè ä»ä»¬çæ¯å¦æå¼æºä»£ç ï¼åæè æ¯ç½ä¸ä¹æå¾å¤äººä½¿ç¨ï¼é£ä¹è½æå°ç¸å ³èµæã
æ ¹æ®ä½ è¡¥å çæé®ï¼é£ä¹å°±æ¯System.loadLibrary(this); ï¼å°±å¯ä»¥è°ç¨äº
2024-12-22 09:00
2024-12-22 08:58
2024-12-22 07:56
2024-12-22 07:40
2024-12-22 07:18
2024-12-22 06:24