mirror of
https://github.com/fumiama/android-base16384.git
synced 2026-06-08 20:10:35 +08:00
v1.3.1
This commit is contained in:
@@ -12,8 +12,8 @@ android {
|
||||
applicationId "top.fumiama.base16384"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 7
|
||||
versionName '1.3'
|
||||
versionCode 8
|
||||
versionName '1.3.1'
|
||||
resConfigs "zh", "en"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -10,8 +10,8 @@
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 7,
|
||||
"versionName": "1.3",
|
||||
"versionCode": 8,
|
||||
"versionName": "1.3.1",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -26,13 +26,29 @@ import java.io.FileInputStream
|
||||
import java.nio.charset.Charset
|
||||
|
||||
class MainActivity : Activity() {
|
||||
var forceDecode = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
val cm = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
val pCharsets = PropertiesTools(File(filesDir, "charsets.prop"))
|
||||
|
||||
sv.viewTreeObserver.addOnGlobalLayoutListener { setTitleVisibility() }
|
||||
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) }
|
||||
bde.setOnClickListener { clickButton(false, cm, pCharsets) }
|
||||
ben.setOnLongClickListener {
|
||||
@@ -67,7 +83,8 @@ class MainActivity : Activity() {
|
||||
val br = inputFile.inputStream()
|
||||
br.read(bbf)
|
||||
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)
|
||||
else encode(inputFile.absolutePath, outputFile.absolutePath)
|
||||
|
||||
@@ -17,4 +17,6 @@
|
||||
<string name="info_content">作者:源文雨。感谢咲桜动漫社成员的支持。</string>
|
||||
<string name="copied">已复制</string>
|
||||
<string name="select_charset">选择字符集</string>
|
||||
<string name="alert">提示</string>
|
||||
<string name="force_decode">执行强制解码?</string>
|
||||
</resources>
|
||||
@@ -16,4 +16,6 @@
|
||||
<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="select_charset">Select Charset</string>
|
||||
<string name="alert">Alert</string>
|
||||
<string name="force_decode">Force Decode?</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user