From 6158a7ad2b77e6e6e8fa979565954719611807e7 Mon Sep 17 00:00:00 2001
From: ecpvint
Date: Thu, 15 Aug 2024 18:35:25 +0800
Subject: [PATCH] init
---
.gitignore | 2 +
app.iml | 124 +++++++++++++
build.gradle | 26 +++
libs/Utils.jar | Bin 0 -> 8227 bytes
proguard-rules.pro | 21 +++
readme.md | 7 +
.../agct/ExampleInstrumentedTest.java | 26 +++
src/main/AndroidManifest.xml | 29 +++
.../java/net/droidtech/agct/DecodeThread.java | 49 +++++
.../java/net/droidtech/agct/EncodeThread.java | 49 +++++
.../java/net/droidtech/agct/MainActivity.java | 172 ++++++++++++++++++
.../drawable-v24/ic_launcher_foreground.xml | 34 ++++
.../res/drawable/ic_launcher_background.xml | 170 +++++++++++++++++
src/main/res/layout/activity_main.xml | 62 +++++++
src/main/res/values/strings.xml | 26 +++
src/main/res/values/styles.xml | 8 +
.../net/droidtech/agct/ExampleUnitTest.java | 17 ++
17 files changed, 822 insertions(+)
create mode 100644 .gitignore
create mode 100644 app.iml
create mode 100644 build.gradle
create mode 100644 libs/Utils.jar
create mode 100644 proguard-rules.pro
create mode 100644 readme.md
create mode 100644 src/androidTest/java/net/droidtech/agct/ExampleInstrumentedTest.java
create mode 100644 src/main/AndroidManifest.xml
create mode 100644 src/main/java/net/droidtech/agct/DecodeThread.java
create mode 100644 src/main/java/net/droidtech/agct/EncodeThread.java
create mode 100644 src/main/java/net/droidtech/agct/MainActivity.java
create mode 100644 src/main/res/drawable-v24/ic_launcher_foreground.xml
create mode 100644 src/main/res/drawable/ic_launcher_background.xml
create mode 100644 src/main/res/layout/activity_main.xml
create mode 100644 src/main/res/values/strings.xml
create mode 100644 src/main/res/values/styles.xml
create mode 100644 src/test/java/net/droidtech/agct/ExampleUnitTest.java
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..956c004
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/build
+/release
\ No newline at end of file
diff --git a/app.iml b/app.iml
new file mode 100644
index 0000000..d99b865
--- /dev/null
+++ b/app.iml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateDebugSources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..9ef114a
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,26 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 26
+ defaultConfig {
+ applicationId "net.droidtech.agct"
+ minSdkVersion 14
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ implementation files('libs/Utils.jar')
+
+}
diff --git a/libs/Utils.jar b/libs/Utils.jar
new file mode 100644
index 0000000000000000000000000000000000000000..498b61e5e7c81b723e1881e694bc5a9e278ea622
GIT binary patch
literal 8227
zcmaJ`1yEec)+Ru3had^=Hh6IN07GyM?(Xg$+=5#mNU-1o1b26LcNrkK~b%ib@PX@yC7$h#$bg0U2ok!x*wOfOdFrq)LHll67_K3^+JA;WYe?o&luLD-9Tv
zrs*G%p?L=!9vyf`KO{XY2^fc>S=(CQf`pKJ@{91~7vc}UPwxIJ@K2-v`u)8c^pl#k
zkt5^pHBkPoVQ6n-X6R^S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fs8t$PY#o{DhKhO>~)xLG%u2KR79-~ejQ=HC8
zN(J=?RYyXi`}@Kr^BqAwAqvooJYSC(^6A7hiUQu9Aw`~AcJ0EXaM@ULD!1*|6??)>
z8pTTLI*7T9u!wn1@7}N^xYw-WyCkRx%YrnXMw7?PDAiP;B_1|#|X&r(
zs(x~%lFbjvqD=2s)m*ero6^?keckg^
z8cCXsj5WPgj|%xtb&6nPLgk??(x4Fg#kn!!2+b2}d4|BWXSiUy0hdTFA!oht*87mX)iw1&}$soNIJe9*`qGdh5R0o)ZI>@ZMT63*I|j(Uxd>
zi-$=@kVCw|0L=QUu(4*L7&iuR9Z{j!r+)@Re`$C?O&0PYb03vH(;9RnB6};EyytCs
zHSxOb#d#qrY!ve&G3MTmCEZ}ito|DC6wN=Hf>3t`${MFr(^b<5@uPs=ZQwEM!1gTd
zCWdf7E}}H8o{!pVrEZNn7-=29Zv@l9o)U!)@QLEl{6CuTM{B&v^d0Fp5KC7glJWPu
z(oD~eklBjVM7kIZ6b@>uz42lv!_66Om;$ilf#7hyr~XGZ{5X~MXpd@|o)Gb|LA
z8(M)Yt2C!Sf=QAsR+1gQ^ruH|*>y@UI@}I|WBVjK0bNJ|y>Z5VE_3G;9+XwIsgiZ#
zt9jWQI@}9Hqp|4+;S~D593AQ@#VfmHIzd7my1buWO%
zj!|80V?-;q2y=SkL~;$G7}|loK4s+pGnxNw
z+Wr;ruYIIvzq0{*$H^iRw6t15mLE!4jP{;5WOUbMfflAl51eh>0oGyl_^e$_e8
zLWJ?xIsK>Vd7jYU)jiJ$^1ng&yDI3{yoi3CqQ6Zt$o~yW{PgC2TDt%LZ~kju&nXAO
yAEY$|#0v;qh;%Ip-Ts#|FaGm(7|1a0d-|4>e)-hShk!tSdO%OjLRI`利用AGCT四种碱基字符编码任何字符串
+
+安卓项目
\ No newline at end of file
diff --git a/src/androidTest/java/net/droidtech/agct/ExampleInstrumentedTest.java b/src/androidTest/java/net/droidtech/agct/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..84f1e20
--- /dev/null
+++ b/src/androidTest/java/net/droidtech/agct/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package net.droidtech.agct;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("net.droidtech.acgt", appContext.getPackageName());
+ }
+}
diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..501185a
--- /dev/null
+++ b/src/main/AndroidManifest.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/net/droidtech/agct/DecodeThread.java b/src/main/java/net/droidtech/agct/DecodeThread.java
new file mode 100644
index 0000000..1721fdc
--- /dev/null
+++ b/src/main/java/net/droidtech/agct/DecodeThread.java
@@ -0,0 +1,49 @@
+package net.droidtech.agct;
+
+import android.os.Handler;
+import android.os.Message;
+
+import net.droidtech.utils.AGCT;
+
+/**
+ * Created by root on 2019/7/17.
+ */
+
+public class DecodeThread extends Thread {
+
+ private String data;
+ private Handler handler;
+
+ public void putEncodedData(String data){
+ this.data=data;
+ }
+
+ public void setHandler(Handler handler){
+ this.handler=handler;
+ }
+
+
+ @Override
+ public void run(){
+
+ Message msg=handler.obtainMessage();
+
+ byte[] result=AGCT.decode(this.data);
+
+ if(result!=null){
+
+ msg.what=4;
+
+ msg.obj=result;
+
+ }else{
+
+ msg.what=1;
+
+ }
+
+ msg.sendToTarget();
+
+ }
+}
+
diff --git a/src/main/java/net/droidtech/agct/EncodeThread.java b/src/main/java/net/droidtech/agct/EncodeThread.java
new file mode 100644
index 0000000..72c883b
--- /dev/null
+++ b/src/main/java/net/droidtech/agct/EncodeThread.java
@@ -0,0 +1,49 @@
+package net.droidtech.agct;
+
+import android.os.Handler;
+import android.os.Message;
+
+import net.droidtech.utils.AGCT;
+
+/**
+ * Created by root on 2019/7/16.
+ */
+
+public class EncodeThread extends Thread {
+
+ private byte[] data;
+ private Handler handler;
+
+ public void putRawData(byte[] data){
+ this.data=data;
+ }
+
+ public void setHandler(Handler handler){
+ this.handler=handler;
+ }
+
+
+ @Override
+ public void run(){
+
+ Message msg=handler.obtainMessage();
+
+ String result=AGCT.encode(this.data);
+
+ if(result!=null){
+
+ msg.what=2;
+
+ msg.obj=result;
+
+ }else{
+
+ msg.what=1;
+
+ }
+
+ msg.sendToTarget();
+
+ }
+
+}
diff --git a/src/main/java/net/droidtech/agct/MainActivity.java b/src/main/java/net/droidtech/agct/MainActivity.java
new file mode 100644
index 0000000..ab78475
--- /dev/null
+++ b/src/main/java/net/droidtech/agct/MainActivity.java
@@ -0,0 +1,172 @@
+package net.droidtech.agct;
+
+import android.app.Activity;
+import android.app.ProgressDialog;
+import android.content.ClipData;
+import android.content.ClipboardManager;
+import android.content.Context;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Toast;
+
+public class MainActivity extends Activity {
+
+ private ProgressDialog inProgress;
+ private EditText msgInput;
+ private EditText output;
+ private static ThreadResultHandler threadHandler;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+
+ super.onCreate(savedInstanceState);
+
+ setContentView(R.layout.activity_main);
+
+ inProgress=new ProgressDialog(this);
+ inProgress.setTitle(R.string.please_wait);
+ inProgress.setMessage(this.getApplicationContext().getResources().getString(R.string.in_progress));
+ inProgress.setCancelable(false);
+
+ threadHandler = new ThreadResultHandler();
+;
+ this.msgInput=this.findViewById(R.id.messageInput);
+ this.output=this.findViewById(R.id.output);
+
+ output.setEnabled(false);
+
+ Button encode=this.findViewById(R.id.encode);
+ encode.setOnClickListener(new View.OnClickListener(){
+
+ @Override
+ public void onClick(View view){
+
+ EncodeThread thread=new EncodeThread();
+
+ try {
+
+ thread.putRawData(msgInput.getText().toString().getBytes("UTF-8"));
+
+ }catch (Exception e){
+
+ Toast.makeText(MainActivity.this,R.string.encoding_error,Toast.LENGTH_LONG).show();
+
+ return;
+
+ }
+ thread.setHandler(threadHandler);
+ inProgress.show();
+ thread.start();
+
+ }
+
+ });
+
+ Button decode=findViewById(R.id.decode);
+ decode.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ DecodeThread thread=new DecodeThread();
+ thread.setHandler(threadHandler);
+
+ if(msgInput.getText().toString().trim().isEmpty()){
+
+ String first=((ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE)).getPrimaryClip().getItemAt(0).getText().toString();
+
+ Toast.makeText(MainActivity.this,R.string.read_clipboard,Toast.LENGTH_LONG).show();
+ thread.putEncodedData(first);
+
+ }else {
+
+ thread.putEncodedData(msgInput.getText().toString());
+
+ }
+
+ inProgress.show();
+ thread.start();
+
+ }
+ });
+
+ Button copy_output=findViewById(R.id.copy_output);
+ copy_output.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ if(threadHandler.lastOutputMessage!=null){
+
+ ClipboardManager cm =(ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE);
+
+ ClipData cd = ClipData.newPlainText("output",threadHandler.lastOutputMessage);
+
+ cm.setPrimaryClip(cd);
+
+ Toast.makeText(MainActivity.this,R.string.copied,Toast.LENGTH_LONG).show();
+
+ }
+
+
+ }
+ });
+
+ }
+
+ private class ThreadResultHandler extends Handler{
+
+ private String lastOutputMessage=null;
+
+ @Override
+ public void handleMessage(Message msg){
+ try {
+
+ if (msg.what == 2) {
+
+ output.setEnabled(false);
+
+ if(((String)msg.obj).length()>1024){
+
+ output.setText(MainActivity.this.getResources().getText(R.string.message_too_long));
+
+ }else {
+
+ output.setText((String) msg.obj);
+
+ }
+
+ lastOutputMessage=(String)msg.obj;
+
+ } else if (msg.what == 4) {
+
+ output.setEnabled(true);
+
+ output.setText(new String(((byte[]) msg.obj), "UTF-8"));
+
+ this.lastOutputMessage=new String(((byte[]) msg.obj), "UTF-8");
+
+ }
+
+ }catch(Exception e){
+
+ output.setText(MainActivity.this.getResources().getString(R.string.error));
+ output.setEnabled(false);
+
+ }
+
+ if(msg.what==1) {
+
+ output.setText(R.string.error);
+ lastOutputMessage=MainActivity.this.getString(R.string.error);
+ output.setEnabled(false);
+
+ }
+
+ inProgress.dismiss();
+ }
+ }
+
+}
diff --git a/src/main/res/drawable-v24/ic_launcher_foreground.xml b/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..c7bd21d
--- /dev/null
+++ b/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/res/drawable/ic_launcher_background.xml b/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..d5fccc5
--- /dev/null
+++ b/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/res/layout/activity_main.xml b/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..9d72e95
--- /dev/null
+++ b/src/main/res/layout/activity_main.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
new file mode 100644
index 0000000..adfacbc
--- /dev/null
+++ b/src/main/res/values/strings.xml
@@ -0,0 +1,26 @@
+
+
+ AGCT 编解码器
+
+ 应用程序正常初始化失败。
+
+ 请在此输入您的原文/已编码的字符串。
+ 这里是编码/解码输出区。
+ 复制成功。
+ 复制失败。
+ 您未输入任何内容,将读取剪贴板进行解码。
+ 无任何输入,操作已终止。
+ 确定
+ 取消
+ 请稍候
+ 正在运行AGCT模块......
+ 编码
+ 解码
+ 复制输出
+ 编码结果过长,无法预览,请点击复制输出。
+ 很抱歉,您的设备不支持UTF-8编码.
+ 出现错误,请检查您的输入是否正确。
+
+ 警告: 此函数未被实现.
+
+
diff --git a/src/main/res/values/styles.xml b/src/main/res/values/styles.xml
new file mode 100644
index 0000000..ff6c9d2
--- /dev/null
+++ b/src/main/res/values/styles.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/src/test/java/net/droidtech/agct/ExampleUnitTest.java b/src/test/java/net/droidtech/agct/ExampleUnitTest.java
new file mode 100644
index 0000000..be4a1df
--- /dev/null
+++ b/src/test/java/net/droidtech/agct/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package net.droidtech.agct;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file