mirror of
https://github.com/fumiama/android-base16384.git
synced 2026-06-11 05:20:24 +08:00
v1.3.1
This commit is contained in:
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"cmake.configureOnOpen": false
|
||||||
|
}
|
||||||
9
README.md
Normal file
9
README.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Base16384 for Android
|
||||||
|
> 本项目的核心基于[Base16384](https://github.com/fumiama/base16384),这是使用`JNI`适配的安卓版本,支持深色模式主题,使用`Material Design`
|
||||||
|
# 功能
|
||||||
|
- 进行文本的编码/译码
|
||||||
|
- 从系统文件管理器选择任意二进制文件进行编码/译码
|
||||||
|
# 用途
|
||||||
|
- 文本加密通信
|
||||||
|
- 汉字文本压缩
|
||||||
|
- 二进制文件的文本化传输
|
||||||
@@ -12,8 +12,8 @@ android {
|
|||||||
applicationId "top.fumiama.base16384"
|
applicationId "top.fumiama.base16384"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 7
|
versionCode 8
|
||||||
versionName '1.3'
|
versionName '1.3.1'
|
||||||
resConfigs "zh", "en"
|
resConfigs "zh", "en"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -10,8 +10,8 @@
|
|||||||
{
|
{
|
||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"versionCode": 7,
|
"versionCode": 8,
|
||||||
"versionName": "1.3",
|
"versionName": "1.3.1",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -26,13 +26,29 @@ import java.io.FileInputStream
|
|||||||
import java.nio.charset.Charset
|
import java.nio.charset.Charset
|
||||||
|
|
||||||
class MainActivity : Activity() {
|
class MainActivity : Activity() {
|
||||||
|
var forceDecode = false
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
val cm = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
val cm = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||||
val pCharsets = PropertiesTools(File(filesDir, "charsets.prop"))
|
val pCharsets = PropertiesTools(File(filesDir, "charsets.prop"))
|
||||||
|
|
||||||
sv.viewTreeObserver.addOnGlobalLayoutListener { setTitleVisibility() }
|
sv.viewTreeObserver.addOnGlobalLayoutListener { setTitleVisibility() }
|
||||||
fab.setOnClickListener { pickFile() }
|
fab.setOnClickListener { pickFile() }
|
||||||
|
fab.setOnLongClickListener {
|
||||||
|
AlertDialog.Builder(this)
|
||||||
|
.setTitle(R.string.alert)
|
||||||
|
.setMessage(R.string.force_decode)
|
||||||
|
.setIcon(R.mipmap.ic_launcher)
|
||||||
|
.setPositiveButton(android.R.string.ok){ _, _ ->
|
||||||
|
forceDecode = true
|
||||||
|
pickFile()
|
||||||
|
}
|
||||||
|
.setNegativeButton(android.R.string.cancel){ _, _ ->}
|
||||||
|
.show()
|
||||||
|
false
|
||||||
|
}
|
||||||
ben.setOnClickListener { clickButton(true, cm, pCharsets) }
|
ben.setOnClickListener { clickButton(true, cm, pCharsets) }
|
||||||
bde.setOnClickListener { clickButton(false, cm, pCharsets) }
|
bde.setOnClickListener { clickButton(false, cm, pCharsets) }
|
||||||
ben.setOnLongClickListener {
|
ben.setOnLongClickListener {
|
||||||
@@ -67,7 +83,8 @@ class MainActivity : Activity() {
|
|||||||
val br = inputFile.inputStream()
|
val br = inputFile.inputStream()
|
||||||
br.read(bbf)
|
br.read(bbf)
|
||||||
br.close()
|
br.close()
|
||||||
val isDecode = bbf[0] == (-2).toByte() && bbf[1] == (-1).toByte()
|
val isDecode = (bbf[0] == (-2).toByte() && bbf[1] == (-1).toByte()) || forceDecode
|
||||||
|
if (forceDecode) forceDecode = false
|
||||||
|
|
||||||
val re = if(isDecode) decode(inputFile.absolutePath, outputFile.absolutePath)
|
val re = if(isDecode) decode(inputFile.absolutePath, outputFile.absolutePath)
|
||||||
else encode(inputFile.absolutePath, outputFile.absolutePath)
|
else encode(inputFile.absolutePath, outputFile.absolutePath)
|
||||||
|
|||||||
@@ -17,4 +17,6 @@
|
|||||||
<string name="info_content">作者:源文雨。感谢咲桜动漫社成员的支持。</string>
|
<string name="info_content">作者:源文雨。感谢咲桜动漫社成员的支持。</string>
|
||||||
<string name="copied">已复制</string>
|
<string name="copied">已复制</string>
|
||||||
<string name="select_charset">选择字符集</string>
|
<string name="select_charset">选择字符集</string>
|
||||||
|
<string name="alert">提示</string>
|
||||||
|
<string name="force_decode">执行强制解码?</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -16,4 +16,6 @@
|
|||||||
<string name="info_content">Author: Fumiama, with precious supports from the members in Sakura Anime Club.</string>
|
<string name="info_content">Author: Fumiama, with precious supports from the members in Sakura Anime Club.</string>
|
||||||
<string name="copied">Copied Text</string>
|
<string name="copied">Copied Text</string>
|
||||||
<string name="select_charset">Select Charset</string>
|
<string name="select_charset">Select Charset</string>
|
||||||
|
<string name="alert">Alert</string>
|
||||||
|
<string name="force_decode">Force Decode?</string>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user