Skip to content

Instantly share code, notes, and snippets.

View zodani's full-sized avatar

Seo Jaeryong zodani

  • Seoul
View GitHub Profile
FROM node:6.11.0
RUN mkdir -p /app
WORKDIR /app
COPY . /app
RUN npm install
EXPOSE 3000 80
CMD ["npm", "start"]
@zodani
zodani / Decrypt.java
Created December 20, 2016 00:40
SQLCipher decrypt
public void decrypt() {
if(db.isOpen()) {
File unencFile = mContext.getDatabasePath("decrypted.db");
if(!unencFile.exists()) {
db.rawExecSQL(String.format("ATTACH DATABASE '%s' as plaintext KEY '';", unencFile.getAbsolutePath()));
db.rawExecSQL("SELECT sqlcipher_export('plaintext');");
db.rawExecSQL("DETACH DATABASE plaintext;");
SQLiteDatabase sqlDB = SQLiteDatabase.openOrCreateDatabase(unencFile, null);
sqlDB.close();
}
@zodani
zodani / MainActivity.java
Created December 15, 2016 02:47
AIDL client
public class MainActivity extends AppCompatActivity {
private static final String SERVER_PACKAGE = "com.jaeryong.android.aidlserver";
private static final String SERVER_ACTION = "com.jaeryong.android.action.aidlserver";
private IRemoteService mRemoteService;
@Override
protected void onCreate(Bundle savedInstanceState) {
@zodani
zodani / AndroidManifest.xml
Created December 15, 2016 02:44
aidl server manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.jaeryong.android.aidlserver"
xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
@zodani
zodani / ServerService.java
Created December 15, 2016 02:36
aidl server service
public class ServerService extends Service {
@Nullable
@Override
public IBinder onBind(Intent intent) {
return new CalculatorServiceImpl();
}
@Override
public void onCreate() {
super.onCreate();
@zodani
zodani / decrypt.java
Created October 27, 2016 04:21
decrypt a encrypted database file by sqlcipher
public void decrypt() {
if(db.isOpen()) {
File unencFile = mContext.getDatabasePath("decrypted.db");
if(!unencFile.exists()) {
db.rawExecSQL(String.format("ATTACH DATABASE '%s' as plaintext KEY '';", unencFile.getAbsolutePath()));
db.rawExecSQL("SELECT sqlcipher_export('plaintext');");
db.rawExecSQL("DETACH DATABASE plaintext;");
android.database.sqlite.SQLiteDatabase sqlDB = android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(unencFile, null);
sqlDB.close();
}