xiongzhu 1 год назад
Родитель
Сommit
edc8ffed63

+ 3 - 2
app/src/main/java/com/example/uicceditor/ApduChannel.kt

@@ -87,11 +87,12 @@ class ApduChannel(private val telephonyManager: TelephonyManager, aid: String) {
     }
 
     fun reset() {
-        execute(0x00, 0xE0, 0x00, 0x00, 0x00, "")
+//        execute(0x00, 0xE0, 0x00, 0x00, 0x00, "")
+        telephonyManager.rebootModem()
     }
 
     fun select(fid: String) {
-        if (execute(0x80, INS_SEL, 0x00, 0x00, 0x02, fid).sw != "9000") {
+        if (execute(0x80, INS_SEL, 0x00, 0x00, fid.length / 2, fid).sw != "9000") {
             throw Exception("Failed to select file")
         }
     }

+ 37 - 7
app/src/main/java/com/example/uicceditor/Encoder.kt

@@ -1,10 +1,11 @@
 package com.example.uicceditor
 
+import android.util.Log
 import java.math.BigDecimal
 import java.math.RoundingMode
 
 fun String.stripF(): String {
-    return this.replace(Regex("^f+"), "").replace(Regex("f+$"), "")
+    return this.replace(Regex("^[fF]+"), "").replace(Regex("[fF]+$"), "")
 }
 
 fun String.swapNibbles(): String {
@@ -77,14 +78,15 @@ fun encICCID(iccid: String): String {
     0x05: Alphanumeric (coded according to the GSM 7-bit default alphabet)
     0x06: Abbreviated number
 * */
-fun decMSISDN(efMsisdn: String): Triple<Int, Int, String?>? {
+fun decMSISDN(efMsisdn: String): String? {
     println("ef_msisdn: $efMsisdn")
     // Convert from String to ByteArray
     val efMsisdnBytes = efMsisdn.chunked(2).map { it.toInt(16).toByte() }.toByteArray()
 
     // Make sure mandatory fields are present
     if (efMsisdnBytes.size < 14) {
-        throw IllegalArgumentException("EF.MSISDN is too short")
+        Log.e("DecMSISDN", "EF.MSISDN is too short")
+        return null
     }
 
     // Skip optional Alpha Identifier
@@ -97,7 +99,8 @@ fun decMSISDN(efMsisdn: String): Triple<Int, Int, String?>? {
     if (bcdLen == 0xff) {
         return null
     } else if (bcdLen > 11 || bcdLen < 1) {
-        throw IllegalArgumentException("Length of MSISDN ($bcdLen bytes) is out of range")
+        Log.e("DecMSISDN", "Length of MSISDN ($bcdLen bytes) is out of range")
+        return null
     }
 
     // Parse ToN / NPI
@@ -107,7 +110,7 @@ fun decMSISDN(efMsisdn: String): Triple<Int, Int, String?>? {
 
     // No MSISDN?
     if (bcdLen == 0) {
-        return Triple(npi, ton, null)
+        return null
     }
 
     val msisdn =
@@ -116,8 +119,8 @@ fun decMSISDN(efMsisdn: String): Triple<Int, Int, String?>? {
             .stripF()
     // International number 10.5.118/3GPP TS 24.008
     val formattedMsisdn = if (ton == 0x01) "+$msisdn" else msisdn
-
-    return Triple(npi, ton, formattedMsisdn)
+    Log.i("DecMSISDN", "EF: $efMsisdn, MSISDN: $formattedMsisdn, NPI: $npi, ToN: $ton")
+    return formattedMsisdn
 }
 
 fun encMSISDN(msisdn: String, npi: Int = 0x01, ton: Int = 0x03): String {
@@ -151,4 +154,31 @@ fun encMSISDN(msisdn: String, npi: Int = 0x01, ton: Int = 0x03): String {
     val bcd = msisdnVar.swapNibbles().padEnd(10 * 2, 'f')  // pad to 10 octets
 
     return String.format("%02x", bcdLen) + String.format("%02x", npiTon) + bcd + "ff".repeat(2)
+}
+
+fun decPLMN(efPlmn: String): String? {
+    if (efPlmn.length < 6) {
+        return null
+    }
+    return efPlmn.stripF().chunked(6).joinToString(",") {
+        val str = it.swapNibbles()
+        val mcc = str.substring(0, 3)
+        val mnc = str.substring(3).stripF()
+        "$mcc$mnc"
+    }
+}
+
+fun decPLMNwAcT(efPlmn: String): String? {
+    if (efPlmn.length < 10) {
+        return null
+    }
+    return efPlmn.chunked(10)
+        .filter { !it.substring(0, 6).matches(Regex("^f{3,}", RegexOption.IGNORE_CASE)) }
+        .joinToString(",") {
+            val str = it.substring(0, 6).swapNibbles()
+            val mcc = str.substring(0, 3)
+            val mnc = str.substring(3).stripF()
+            val act = it.substring(6)
+            "$mcc$mnc:$act"
+        }
 }

+ 52 - 8
app/src/main/java/com/example/uicceditor/MainActivity.kt

@@ -34,7 +34,6 @@ class MainActivity : AppCompatActivity() {
 
         val telephonyManager = getSystemService(TELEPHONY_SERVICE) as TelephonyManager
 
-
         binding.btnReadIccid.setOnClickListener {
             val apduChannel = ApduChannel(telephonyManager, AID)
             val iccid = apduChannel.readICCID()
@@ -83,7 +82,7 @@ class MainActivity : AppCompatActivity() {
             apduChannel.select(SIMView.FID_MF)
             apduChannel.select(SIMView.FID_DF_TELECOM)
             apduChannel.select(SIMView.FID_EF_MSISDN)
-            val msisdn = decMSISDN(apduChannel.readRecord(1, 28).substring(28))?.third ?: ""
+            val msisdn = decMSISDN(apduChannel.readRecord(1, 28).substring(28)) ?: ""
             binding.etMsisdn.setText(msisdn)
             apduChannel.close()
         }
@@ -99,18 +98,63 @@ class MainActivity : AppCompatActivity() {
             apduChannel.close()
         }
 
-        binding.btnReset.setOnClickListener {
+        binding.btnReadPlmn.setOnClickListener {
             val apduChannel = ApduChannel(telephonyManager, AID)
-            apduChannel.reset()
+            apduChannel.select(SIMView.FID_MF)
+            apduChannel.select(SIMView.FID_DF_GSM)
+            apduChannel.select(SIMView.FID_EF_PLMNSEL)
+            binding.etPlmn.setText(decPLMN(apduChannel.readBinary(60)))
             apduChannel.close()
         }
 
-        binding.btnPlmn.setOnClickListener {
+        binding.btnReadEhplmn.setOnClickListener {
             val apduChannel = ApduChannel(telephonyManager, AID)
             apduChannel.select(SIMView.FID_MF)
-            apduChannel.select(SIMView.FID_DF_TELECOM)
-            apduChannel.select(SIMView.FID_EF_MSISDN)
-            apduChannel.readRecord(1, 28)
+            apduChannel.select(SIMView.FID_DF_GSM)
+            apduChannel.select(SIMView.FID_EF_EHPLMN)
+            binding.etEhplmn.setText(decPLMN(apduChannel.readBinary(12)))
+            apduChannel.close()
+        }
+
+        binding.btnReadFplmn.setOnClickListener {
+            val apduChannel = ApduChannel(telephonyManager, AID)
+            apduChannel.select(SIMView.FID_MF)
+            apduChannel.select(SIMView.FID_DF_GSM)
+            apduChannel.select(SIMView.FID_EF_FPLMN)
+            binding.etFplmn.setText(decPLMN(apduChannel.readBinary(30)))
+            apduChannel.close()
+        }
+
+        binding.btnReadPlmnwact.setOnClickListener{
+            val apduChannel = ApduChannel(telephonyManager, AID)
+            apduChannel.select(SIMView.FID_MF)
+            apduChannel.select(SIMView.FID_DF_GSM)
+            apduChannel.select(SIMView.FID_EF_PLMNWACT)
+            binding.etPlmnwact.setText(decPLMNwAcT(apduChannel.readBinary(120)))
+            apduChannel.close()
+        }
+
+        binding.btnReadOplmnwact.setOnClickListener{
+            val apduChannel = ApduChannel(telephonyManager, AID)
+            apduChannel.select(SIMView.FID_MF)
+            apduChannel.select(SIMView.FID_DF_GSM)
+            apduChannel.select(SIMView.FID_EF_OPLMNWACT)
+            binding.etOplmnwact.setText(decPLMNwAcT(apduChannel.readBinary(60)))
+            apduChannel.close()
+        }
+
+        binding.btnReadHplmnwact.setOnClickListener{
+            val apduChannel = ApduChannel(telephonyManager, AID)
+            apduChannel.select(SIMView.FID_MF)
+            apduChannel.select(SIMView.FID_DF_GSM)
+            apduChannel.select(SIMView.FID_EF_HPLMNWACT)
+            binding.etHplmnwact.setText(decPLMNwAcT(apduChannel.readBinary(20)))
+            apduChannel.close()
+        }
+
+        binding.btnReset.setOnClickListener {
+            val apduChannel = ApduChannel(telephonyManager, AID)
+            apduChannel.reset()
             apduChannel.close()
         }
     }

+ 2 - 0
app/src/main/java/com/example/uicceditor/SIMView.kt

@@ -155,6 +155,8 @@ class SIMView {
         /** File identifier : EF HPLMN = "6F31" (under DF GSM)                    */
         const val FID_EF_HPLMN = "6F31"
 
+        const val FID_EF_EHPLMN = "6FD9"
+
         /** File identifier : EF ACMmax = "6F37" (under DF GSM)                   */
         const val FID_EF_ACMMAX = "6F37"
 

+ 304 - 95
app/src/main/res/layout/activity_main.xml

@@ -9,131 +9,340 @@
     android:orientation="vertical"
     tools:context=".MainActivity">
 
-    <LinearLayout
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical"
-        android:paddingHorizontal="16dp">
+        android:layout_height="match_parent">
 
-        <com.google.android.material.textfield.TextInputLayout
+        <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginTop="8dp"
-            android:hint="ICCID">
+            android:orientation="vertical"
+            android:paddingHorizontal="16dp">
 
-            <com.google.android.material.textfield.TextInputEditText
-                android:id="@+id/et_iccid"
+            <com.google.android.material.textfield.TextInputLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:inputType="numberDecimal"
-                android:lines="1" />
-        </com.google.android.material.textfield.TextInputLayout>
+                android:layout_marginTop="8dp"
+                android:hint="ICCID">
 
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="8dp"
-            android:gravity="center"
-            android:orientation="horizontal">
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_iccid"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:inputType="numberDecimal"
+                    android:lines="1" />
+            </com.google.android.material.textfield.TextInputLayout>
 
-            <com.google.android.material.button.MaterialButton
-                android:id="@+id/btn_read_iccid"
-                android:layout_width="wrap_content"
+            <LinearLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:text="READ" />
+                android:layout_marginTop="8dp"
+                android:gravity="center"
+                android:orientation="horizontal">
 
-            <com.google.android.material.button.MaterialButton
-                android:id="@+id/btn_write_iccid"
-                android:layout_width="wrap_content"
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_read_iccid"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="READ" />
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_write_iccid"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="16dp"
+                    android:text="WRITE" />
+            </LinearLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="16dp"
-                android:text="WRITE" />
-        </LinearLayout>
+                android:layout_marginTop="16dp"
+                android:hint="IMSI">
 
-        <com.google.android.material.textfield.TextInputLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="16dp"
-            android:hint="IMSI">
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_imsi"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:inputType="numberDecimal"
+                    android:lines="1" />
+            </com.google.android.material.textfield.TextInputLayout>
 
-            <com.google.android.material.textfield.TextInputEditText
-                android:id="@+id/et_imsi"
+            <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:inputType="numberDecimal"
-                android:lines="1" />
-        </com.google.android.material.textfield.TextInputLayout>
+                android:layout_marginTop="8dp"
+                android:gravity="center"
+                android:orientation="horizontal">
 
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="8dp"
-            android:gravity="center"
-            android:orientation="horizontal">
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_read_imsi"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="READ" />
 
-            <com.google.android.material.button.MaterialButton
-                android:id="@+id/btn_read_imsi"
-                android:layout_width="wrap_content"
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_write_imsi"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="16dp"
+                    android:text="WRITE" />
+            </LinearLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:text="READ" />
+                android:layout_marginTop="16dp"
+                android:hint="MSISDN">
 
-            <com.google.android.material.button.MaterialButton
-                android:id="@+id/btn_write_imsi"
-                android:layout_width="wrap_content"
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_msisdn"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:inputType="numberDecimal"
+                    android:lines="1" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="16dp"
-                android:text="WRITE" />
-        </LinearLayout>
+                android:layout_marginTop="8dp"
+                android:gravity="center"
+                android:orientation="horizontal">
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_read_msisdn"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="READ" />
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_write_msisdn"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="16dp"
+                    android:text="WRITE" />
+            </LinearLayout>
 
-        <com.google.android.material.textfield.TextInputLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="16dp"
-            android:hint="MSISDN">
 
-            <com.google.android.material.textfield.TextInputEditText
-                android:id="@+id/et_msisdn"
+            <com.google.android.material.textfield.TextInputLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:inputType="numberDecimal"
-                android:lines="1" />
-        </com.google.android.material.textfield.TextInputLayout>
+                android:layout_marginTop="16dp"
+                android:hint="PLMN">
 
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="8dp"
-            android:gravity="center"
-            android:orientation="horizontal">
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_plmn"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:digits="0123456789,"
+                    android:lines="1" />
+            </com.google.android.material.textfield.TextInputLayout>
 
-            <com.google.android.material.button.MaterialButton
-                android:id="@+id/btn_read_msisdn"
-                android:layout_width="wrap_content"
+            <LinearLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:text="READ" />
+                android:layout_marginTop="8dp"
+                android:gravity="center"
+                android:orientation="horizontal">
 
-            <com.google.android.material.button.MaterialButton
-                android:id="@+id/btn_write_msisdn"
-                android:layout_width="wrap_content"
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_read_plmn"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="READ" />
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_write_plmn"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="16dp"
+                    android:text="WRITE" />
+            </LinearLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="16dp"
-                android:text="WRITE" />
-        </LinearLayout>
+                android:layout_marginTop="16dp"
+                android:hint="EHPLMN">
 
-        <Button
-            android:id="@+id/btn_reset"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center"
-            android:layout_marginTop="16dp"
-            android:text="RESET" />
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_ehplmn"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:digits="0123456789,"
+                    android:lines="1" />
+            </com.google.android.material.textfield.TextInputLayout>
 
-        <Button
-            android:id="@+id/btn_plmn"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center"
-            android:layout_marginTop="16dp"
-            android:text="PLMN" />
-    </LinearLayout>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="8dp"
+                android:gravity="center"
+                android:orientation="horizontal">
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_read_ehplmn"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="READ" />
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_write_ehplmn"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="16dp"
+                    android:text="WRITE" />
+            </LinearLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="16dp"
+                android:hint="FPLMN">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_fplmn"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:digits="0123456789,"
+                    android:lines="1" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="8dp"
+                android:gravity="center"
+                android:orientation="horizontal">
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_read_fplmn"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="READ" />
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_write_fplmn"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="16dp"
+                    android:text="WRITE" />
+            </LinearLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="16dp"
+                android:hint="PLMNwAcT">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_plmnwact"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:digits="0123456789,"
+                    android:lines="1" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="8dp"
+                android:gravity="center"
+                android:orientation="horizontal">
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_read_plmnwact"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="READ" />
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_write_plmnwact"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="16dp"
+                    android:text="WRITE" />
+            </LinearLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="16dp"
+                android:hint="OPLMNwAcT">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_oplmnwact"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:digits="0123456789,"
+                    android:lines="1" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="8dp"
+                android:gravity="center"
+                android:orientation="horizontal">
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_read_oplmnwact"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="READ" />
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_write_oplmnwact"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="16dp"
+                    android:text="WRITE" />
+            </LinearLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="16dp"
+                android:hint="HPLMNwAcT">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_hplmnwact"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:digits="0123456789,"
+                    android:lines="1" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="8dp"
+                android:gravity="center"
+                android:orientation="horizontal">
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_read_hplmnwact"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="READ" />
+
+                <com.google.android.material.button.MaterialButton
+                    android:id="@+id/btn_write_hplmnwact"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="16dp"
+                    android:text="WRITE" />
+            </LinearLayout>
+
+            <Button
+                android:id="@+id/btn_reset"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center"
+                android:layout_marginTop="16dp"
+                android:text="RESET" />
+
+        </LinearLayout>
+    </ScrollView>
 </androidx.constraintlayout.widget.ConstraintLayout>