sqlcipher / sqlcipher-android-tests

A collection of tests that can be run on an emulator or device to verify SQLCipher for Android.
Other
94 stars 66 forks source link

sqlcipher flash back #11

Closed WangXiminDev closed 5 years ago

WangXiminDev commented 8 years ago

Hi: I had a problem when I use sqlcipher to encrypt the database: 1.Declare the Camera permissions in AndroidManifest.xml. 2.Using Config.ARGB_8888 configuration, the JPG picture into Bitmap. Meet the above conditions,app will flash back.

This problem is only on the use of the MTK chip on the phone. Could you please help me to see this question. Thank you very much

Here is code: package com.ricky.android.sqlitecipher;

import java.util.List;

import com.lidroid.xutils.BitmapUtils; import com.ricky.android.sqlitecipher.dao.StudentDAO; import com.ricky.android.sqlitecipher.dao.StudentDAOImpl; import com.ricky.android.sqlitecipher.model.Student; import com.ricky.android.sqlitecipher.util.Logger;

import android.app.Activity; import android.graphics.Bitmap.Config; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.ImageView;

public class MainActivity extends Activity implements OnClickListener {

private static final String TAG = MainActivity.class.getSimpleName();

private Button bt_insert;
private Button bt_query;
private StudentDAO studentDAO;
private ImageView image;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    findViewById();
    setListener();
    processLogic();

    BitmapUtils bitmapUtils = new BitmapUtils(this);
    bitmapUtils.configDefaultBitmapConfig(Config.ARGB_8888);
    bitmapUtils.display(image, "https://www.baidu.com/img/bd_logo1.png");
}

private void findViewById() {

    bt_insert = (Button) findViewById(R.id.bt_insert);
    bt_query = (Button) findViewById(R.id.bt_query);
    image = (ImageView) findViewById(R.id.img);
}

private void setListener() {
    bt_insert.setOnClickListener(this);
    bt_query.setOnClickListener(this);
}

private void processLogic() {

    studentDAO = new StudentDAOImpl(this);

}

@Override
public void onClick(View v) {
    switch (v.getId()) {
    case R.id.bt_insert:

        Student stu = new Student();
        stu.setName("Mike");
        stu.setAge(24);

        long id = studentDAO.insert(stu);

        Logger.i(TAG, "insert id="+id);

        break;

    case R.id.bt_query:

        List<Student> list = studentDAO.query();
        if(list!=null){
            Logger.i(TAG, "student list size="+list.size());
        }else{
            Logger.i(TAG, "student list is empty");
        }

        break;

    default:
        break;
    }
}

}

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ricky.android.sqlitecipher" android:versionCode="1" android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="17" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA"/>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

developernotes commented 8 years ago

Hello @UnkownMr

Do you have a specific issue with SQLCipher? If so, could you post the problematic code and the stack trace you receive? Thanks!

stale[bot] commented 5 years ago

Hello, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug", "enhancement", or "security" and I will leave it open. Thank you for your contributions.

stale[bot] commented 5 years ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to reopen with up-to-date information.