Android text message source code dependent library and runable source code

Source: Internet
Author: User

Android text message source code dependent library and runable source code

The text message module function is required for the new project. The text message module is an open-source framework dominated by 360 Zhang Yong, which is not an android text message module.

Step 1:

Download the Android system source code. By comparing the source code of version 4.4 and version 4.4 +, we use the source code of version 4.4. Why? Because there will be fewer text message source code classes and fewer bugs in the future, the code of the text message module is as follows:

 

Step 2:

I will take the As example (I first debugged it on eclipse, and then moved it to the As), and imported the above classes into, it must be a lot of bugs, later, I found the associated class in the source code. I first posted the final class.

 

Let me talk about several bugs:

1. First, the code of this text message module is dependent on inventory (it may be moved to the project later). Therefore, you need to fill in the following information in the configuration file of the main project:

 

xmlns:tools="http://schemas.android.com/tools"
 
2. Because the 360 security module is dependent on the 23 api, I relied on the 22 api to avoid unknown conflicts.

 

 

 compileSdkVersion 22    buildToolsVersion "23.0.2"    defaultConfig {        minSdkVersion 22        targetSdkVersion 23        versionCode 1        versionName "1.0"    }

3. Because there are many errors in the code, setAppOps (AppOpsManager. OP_READ_SMS, AppOpsManager. OP_WRITE_SMS) indicates an error. The solution is as follows:

 

Because my code is excerpted from the 4.4 system text message source code, I downloaded the 4.4 Source Code Compiled class file from the Internet. Here I will first download these class files

 

4. After the class file is downloaded, go to the following directory. The blue box is the modified android. the jar red box is built-in. We need the jar package modified by the blue box, because this jar can solve methods such as setAppOps, which is compiled. the class file is compared with the android sdk.

 

5. Check the cp in the configuration file. Here we will change it to "true" and then customize the SMS url.

 

6. Next we will use sms to describe,

SetAppOppsAt the beginning, we modified android to solve this problem. jar is provided by the system and has not been commented out or removed from the Code at the beginning. I am afraid that I will not be able to get started with the later bug. The setAppOpps method needs to be removed, otherwise, it cannot be created. I solve this bug through log.

 

Android4.4 the default SMS mechanism is used to prevent the background from sending text messages silently. Unfortunately, the native does not prohibit non-default text messages.

I also wrote this blog. This is just the first step. It seems that I have not tested the deletion and modification. I have previously written a demo, after 4.4, the default system SMS cannot be deleted or modified directly. You must use the Reflection Method to perform the operation.

 

 

@Overridepublic boolean onCreate() {//setAppOps(AppOpsManager.OP_READ_SMS, AppOpsManager.OP_WRITE_SMS);mOpenHelper = MmsSmsDatabaseHelper.getInstance(getContext());return true;}

7. Modify the reflection methods of some bugs.

 

8. Delete the red file and delete the style file.

 

So far, the bug is almost the same.

 

Here, there will be fewer bugs in eclipse. You can reference lib for convenience. Are there any unnecessary style themebugs in?

I also started to use as in early April, which is tough on as, but as has a better place than eclipse. Sometimes the eclipse compilation library fails and keeps getting stuck. as compilation is very fast.

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.