Android实现短信加密功能(发送加密短信、解密本地短信)

2019-12-10 19:29:23于丽

activity_send:

<?xml version="1.0" encoding="utf-8"?> 
 
<LinearLayout xmlns:android="http://www.easck.com/apk/res/android" 
 android:layout_width="match_parent" 
 android:layout_height="match_parent" 
 android:orientation="vertical"> 
 
 
 <LinearLayout 
 android:layout_width="match_parent" 
 android:layout_height="match_parent" 
 android:orientation="vertical" 
 android:padding="10dp"> 
 
 <TextView 
  android:layout_width="match_parent" 
  android:layout_height="wrap_content" 
  android:text="加密短信发送" 
  android:textColor="#000" 
  android:textSize="35sp" /> 
 
 <View 
  android:layout_width="match_parent" 
  android:layout_height="3dp" 
  android:layout_marginBottom="20dp" 
  android:background="#CECECE" /> 
 
 <TextView 
  android:layout_width="match_parent" 
  android:layout_height="wrap_content" 
  android:layout_marginBottom="5dp" 
  android:text="发送至:" 
  android:textSize="25sp" /> 
 
 <EditText 
  android:id="@+id/phone_edit_text" 
  android:layout_width="match_parent" 
  android:layout_height="wrap_content" 
  android:layout_marginBottom="10dp" 
  android:background="@drawable/edit_text_style" 
  android:hint="接收人手机号码" 
  android:maxLength="15" 
  android:maxLines="1" 
  android:textSize="19sp" 
  android:singleLine="true" /> 
 
 <TextView 
  android:layout_width="match_parent" 
  android:layout_height="wrap_content" 
  android:layout_marginBottom="5dp" 
  android:text="发送内容" 
  android:textSize="25sp" /> 
 
 <EditText 
  android:id="@+id/content_edit_text" 
  android:layout_width="match_parent" 
  android:layout_height="0dp" 
  android:layout_weight="1" 
  android:background="@drawable/edit_text_style" 
  android:gravity="start" 
  android:hint="单条短信请保持在70字以内" 
  android:maxLength="70" 
  android:textSize="19sp" 
  /> 
 
 <LinearLayout 
  android:layout_width="match_parent" 
  android:layout_height="wrap_content" 
  android:layout_margin="10dp"> 
 
  <Button 
  android:id="@+id/cancel_edit" 
  android:layout_width="0dp" 
  android:layout_height="wrap_content" 
  android:layout_weight="1" 
  android:text="取消编辑" 
  android:textSize="20sp" /> 
 
  <Button 
  android:id="@+id/send_edit" 
  android:layout_width="0dp" 
  android:layout_height="wrap_content" 
  android:layout_weight="1" 
  android:text="发 送" 
  android:textSize="20sp" /> 
 </LinearLayout> 
 </LinearLayout> 
</LinearLayout>