diff --git a/README.md b/README.md
index 04fcf26..481454c 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,6 @@
-#验证码助手
+#验证码助手 SmsCodeHelper
-是由原「[贝壳单词](http://www.beikedanci.com)」团队开发的一款新的开源轻App.
-
-它可以在手机接收到验证码短信的时候,自动浮现验证码,并自动复制验证码到用户的剪切板。当用户接收到短信验证码,只要长按验证码的输入框,粘贴验证码即可。
+在手机接收到验证码短信的时候,自动浮现验证码,并自动复制验证码到用户的剪切板。当用户接收到短信验证码,只要长按验证码的输入框,粘贴验证码即可。
除此之外,还可以让用户批量删除无用验证码短信,帮助用户反向推理出绑定了哪些业务(换号必备啊有木有)。
@@ -16,12 +14,32 @@
-#源代码在GPLv3协议下发布
-###我们开源,我们做好设计,我们不乱使用权限,只求你如果喜欢,可以分享给你的朋友们,好东西需要分享才能让其健康成长,每一次分享都是我们的动力,非常感谢!
+#源代码在 GPLv3 协议下发布
+###我们开源,做好设计,不乱使用权限,只求你如果喜欢,可以分享给你的朋友们,好东西需要分享才能让其健康成长,每一次分享都是我们的动力,非常感谢!
-#下载
+#下载 Download
Google Play:https://play.google.com/store/apps/details?id=me.drakeet.inmessage
-Fir:http://fir.im/codehelper
\ No newline at end of file
+Fir:http://fir.im/codehelper
+
+#English introduction
+SmsCodeHelper, is a new open source and light App.
+
+It can automatically emerge verification code when your phone receives a text message contains a verification code. And automatically copy the code to the user's clipboard. When the user receives the message verification code, just long press the EditText to paste the verification code.
+
+In addition, it can also allow users to bulk delete unwanted SMS verification code; It can also help users Backward inference out what the business is bound (for a new phone number, it is useful).
+
+It is very light, but also adhering to the usual good design and user-friendly, since it does not start at leisure, will not take up any memory (unbelievers or concern, welcome to view the source code) .
+
+
+We open source, good design, not indiscriminately use rights. Just hope if you like it, you can share with your friends, because good things need to share with others in order to let it grow, every share is our power, thanks!
+
+## About me
+
+I am a student in China, I love reading pure literature, love Japanese culture and Hongkong music. At the same time, I am also obsessed with writing code. If you have any questions or want to make friends with me, you can write to me: drakeet.me@gmail.com
+
+In addition, my blog: http://drakeet.me
+
+If you like my open source projects, you can follow me: https://github.com/drakeet
diff --git a/app/build.gradle b/app/build.gradle
index d41f8f6..2429687 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -4,6 +4,8 @@ def releaseTime() {
return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
}
+def key = file('s.keystore')
+
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
@@ -11,14 +13,9 @@ android {
defaultConfig {
applicationId "me.drakeet.inmessage"
minSdkVersion 15
- targetSdkVersion 21
- versionCode 4
- versionName "1.0"
- }
- sourceSets {
- main {
- jniLibs.srcDirs = ['libs']
- }
+ targetSdkVersion 22
+ versionCode 33
+ versionName "1.3.3"
}
packagingOptions {
@@ -44,10 +41,10 @@ android {
signingConfigs {
app1 {
- storeFile file("s.keystore")
- storePassword STOREPASS
- keyAlias KEYALIAS
- keyPassword KEYPASS
+ storeFile key
+ storePassword project.hasProperty('STOREPASS') ? STOREPASS : ''
+ keyAlias project.hasProperty('KEYALIAS') ? KEYALIAS : ''
+ keyPassword project.hasProperty('KEYPASS') ? KEYPASS : ''
}
}
@@ -57,16 +54,21 @@ android {
buildConfigField "boolean", "LOG_DEBUG", "false"
debuggable false
- minifyEnabled true
- shrinkResources true
+ minifyEnabled false
+ shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- signingConfig signingConfigs.app1
+ if (key.exists()) {
+ println "using drakeet's key"
+ signingConfig signingConfigs.app1
+ } else {
+ println "no key"
+ }
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
- // 输出apk名称为boohee_v1.0_2015-01-15_wandoujia.apk
+ // 输出apk名称为SmsCodeHelper_v1.0_2015-01-15_wandoujia.apk
def fileName = "SmsCodeHelper_v${defaultConfig.versionName}_${releaseTime()}_${variant.productFlavors[0].name}.apk"
output.outputFile = new File(outputFile.parent, fileName)
}
@@ -114,11 +116,10 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'com.android.support:appcompat-v7:22.2.0'
- compile 'com.android.support:recyclerview-v7:22.2.0'
+ compile 'com.android.support:appcompat-v7:22.2.1'
+ compile 'com.android.support:recyclerview-v7:22.2.1'
+ compile 'com.android.support:design:22.2.1'
compile 'com.daimajia.numberprogressbar:library:1.2@aar'
- compile 'com.getbase:floatingactionbutton:1.4.0'
- compile 'com.github.ksoichiro:android-observablescrollview:1.4.0'
compile 'com.squareup:otto:1.3.5'
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.badoo.mobile:android-weak-handler:1.0'
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
index 9b41c64..64460bf 100755
--- a/app/proguard-rules.pro
+++ b/app/proguard-rules.pro
@@ -58,12 +58,9 @@
-keep public class * extends android.os.Binder
# Keep the support library
--keep class android.support.v4.** { *; }
--keep interface android.support.v4.** { *; }
+-keep class android.support.** { *; }
+-keep interface android.support.** { *; }
-# Keep the support library
--keep class android.support.v7.** { *; }
--keep interface android.support.v7.** { *; }
## GSON 2.2.4 specific rules ##
@@ -167,7 +164,7 @@
native ;
}
--keep class me.drakeet.inmessage.model.** { *;}
+-keep class me.drakeet.inmessage.** { *;}
-keep class cn.smssdk.** { *;}
-keepclasseswithmembernames class * {
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 757ec6d..04e3a88 100755
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,15 +1,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -18,21 +18,22 @@
android:allowBackup="true"
android:icon="@mipmap/ic_incode"
android:label="@string/app_name"
- android:theme="@style/MaterialTheme" >
+ android:theme="@style/MaterialTheme">
+ android:launchMode="singleTask"
+ android:label="@string/app_name">
-
+
-
+
-
-
-
-
+
+
+
+
@@ -41,15 +42,17 @@
-
-
-
+
+
+
-
-
+
+
diff --git a/app/src/main/assets/litepal.xml b/app/src/main/assets/litepal.xml
index c6b6fdd..21b5e5b 100755
--- a/app/src/main/assets/litepal.xml
+++ b/app/src/main/assets/litepal.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/app/src/main/java/me/drakeet/inmessage/AboutActivity.java b/app/src/main/java/me/drakeet/inmessage/AboutActivity.java
index a86594f..c553dee 100644
--- a/app/src/main/java/me/drakeet/inmessage/AboutActivity.java
+++ b/app/src/main/java/me/drakeet/inmessage/AboutActivity.java
@@ -2,26 +2,30 @@
import android.content.Intent;
import android.os.Bundle;
+import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
+import android.widget.TextView;
-import com.github.ksoichiro.android.observablescrollview.ObservableScrollView;
-import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks;
-import com.github.ksoichiro.android.observablescrollview.ScrollState;
import com.umeng.analytics.MobclickAgent;
import butterknife.ButterKnife;
import butterknife.InjectView;
+/**
+ * Created by drakeet on 15/6/5.
+ */
public class AboutActivity extends AppCompatActivity {
@InjectView(R.id.toolbar)
Toolbar mToolbar;
- @InjectView(R.id.sv_about)
- ObservableScrollView mScrollView;
+ @InjectView(R.id.tv_version)
+ TextView mVersionTextView;
+ @InjectView(R.id.collapsing_toolbar)
+ CollapsingToolbarLayout mCollapsingToolbarLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -29,9 +33,12 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_about);
ButterKnife.inject(this);
- final int headerHeight = getResources().getDimensionPixelSize(R.dimen.about_header_height);
- mToolbar.setTitle("");
+ setUpVersionName();
+
+ mCollapsingToolbarLayout.setTitle(getString(R.string.app_name));
+
setSupportActionBar(mToolbar);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mToolbar.setNavigationOnClickListener(
new View.OnClickListener() {
@Override
@@ -41,29 +48,10 @@ public void onClick(View v) {
}
);
- mScrollView.setScrollViewCallbacks(
- new ObservableScrollViewCallbacks() {
- @Override
- public void onScrollChanged(int scrollY, boolean firstScroll,
- boolean dragging) {
- if (scrollY > headerHeight + 192) {
- mScrollView.setBackgroundColor(getResources().getColor(R.color.background));
- } else {
- mScrollView.setBackgroundColor(getResources().getColor(R.color.transparent));
- }
- }
-
- @Override
- public void onDownMotionEvent() {
-
- }
-
- @Override
- public void onUpOrCancelMotionEvent(ScrollState scrollState) {
+ }
- }
- }
- );
+ private void setUpVersionName() {
+ mVersionTextView.setText("Version " + BuildConfig.VERSION_NAME);
}
@Override
@@ -74,9 +62,13 @@ public boolean onCreateOptionsMenu(Menu menu) {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
- int id = item.getItemId();
- if (id == R.id.menu_share) {
- onClickShare();
+ switch (item.getItemId()) {
+ case android.R.id.home:
+ this.finish();
+ return true;
+ case R.id.menu_share:
+ onClickShare();
+ return true;
}
return super.onOptionsItemSelected(item);
}
diff --git a/app/src/main/java/me/drakeet/inmessage/MainActivity.java b/app/src/main/java/me/drakeet/inmessage/MainActivity.java
index a401b5b..6d10ad6 100755
--- a/app/src/main/java/me/drakeet/inmessage/MainActivity.java
+++ b/app/src/main/java/me/drakeet/inmessage/MainActivity.java
@@ -9,7 +9,9 @@
import android.os.Bundle;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AlertDialog;
+import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SwitchCompat;
import android.support.v7.widget.Toolbar;
import android.view.KeyEvent;
@@ -22,7 +24,6 @@
import com.badoo.mobile.util.WeakHandler;
import com.daimajia.numberprogressbar.NumberProgressBar;
-import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView;
import com.umeng.analytics.MobclickAgent;
import org.litepal.crud.DataSupport;
@@ -42,17 +43,18 @@
import me.drakeet.inmessage.utils.TaskUtils;
import me.drakeet.inmessage.utils.ToastUtils;
import me.drakeet.inmessage.utils.VersionUtils;
+import me.drakeet.inmessage.widget.SeparatorItemDecoration;
public class MainActivity extends SwipeRefreshBaseActivity {
@InjectView(R.id.message_rv)
- ObservableRecyclerView mRecyclerView;
+ RecyclerView mRecyclerView;
- NumberProgressBar mNumberProgressBar;
- MainMessageAdapter mMainMessageAdapter;
- WeakHandler mHandler;
- private int mCurrentCaptchasCount = 0;
+ private NumberProgressBar mNumberProgressBar;
+ private MainMessageAdapter mMainMessageAdapter;
private List mMessages;
+ private WeakHandler mHandler;
+ private int mCurrentCaptchasCount = 0;
private boolean mIsRefreshing = false;
private boolean mStopDelete;
private boolean mShowResult;
@@ -67,9 +69,7 @@ protected void onCreate(Bundle savedInstanceState) {
mShowResult = false;
setupActionBar();
initRecyclerView();
-
MobclickAgent.updateOnlineConfig(this);
-
checkFirstTimeUse();
}
@@ -94,6 +94,8 @@ private void initRecyclerView() {
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(linearLayoutManager);
+ mRecyclerView.addItemDecoration(new SeparatorItemDecoration(this));
+ mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.setOnTouchListener(
new View.OnTouchListener() {
@Override
@@ -105,26 +107,27 @@ public boolean onTouch(View v, MotionEvent event) {
}
private void setAdapter() {
- mMainMessageAdapter = new MainMessageAdapter(this, mMessages);
+ mMainMessageAdapter = new MainMessageAdapter(mMessages);
mMainMessageAdapter.setShowResult(mShowResult);
mRecyclerView.setAdapter(mMainMessageAdapter);
mMainMessageAdapter.setOnItemClickListener(
new OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
- if (mMessages.get(position).getIsMessage()) {
- showDetailSMS(mMessages.get(position));
+ if (!mIsRefreshing) {
+ if (mMessages.get(position).getIsMessage()) {
+ showDetailSMS(mMessages.get(position));
+ }
}
}
}
);
}
-
private void getAllMessage() {
setRefreshing(true);
mIsRefreshing = true;
- TaskUtils.executeAsyncTask(
+ TaskUtils.execute(
new AsyncTask