First of all, I declare that I am not the implementation author of The kuaidail software. I thought that similar functions were also implemented during the related project.
The implementation details are not published, so I would like to share with you here.
Here, you can understand some of the installation effects of kuaidail software: http://bbs.app43.com/thread-15553-1-1.html
I. Summary
Kuaidail runs on the IOS system of the jailbreak platform. It is not so much a software as a plug-in, because what users see is only its setting interface.
And optimized some forms of phone and SMS functions. It allows iPhone users to conveniently edit the call records for the locations and images of contacts,
Text messages are intercepted to show strangers to their locations, and calls are intercepted and can be blacklisted in the white list. You can quickly search for contacts and other functions that are especially required by users on the phone call page.
It works well with the system's telephone, text message, and address book software, and is very efficient, such as the built-in system, which can be described as excellent products.
Ii. Software Implementation Summary
Kuaidail implementation should not be very complex. For the platform, jailbreak is a necessary prerequisite. To integrate with the system interface and modify the system interface information,
Dependency on mobilesubstrate is also a prerequisite. The location where the number is obtained can be read by the database where the number is located. The most complicated part of implementation,
It should be how to hook appropriate methods or functions to correctly change the system's behaviors, including display of the interface and running steps. Here, the most
The complexity is nothing more than the interception of text messages and calls. The system interface appending function corresponds to the function of the system library. This process is not easy.
Iii. Implementation
The following describes the implementation details of the software's score modules.
1. Set the program:
Kuaidail has a setting item on the system setting interface. For its implementation, refer to the method for creating the setting item of the iPhone application. Of course, it still requires some other support,
That is, support for configuration files in the System Preferences directory.
2. Program subjects:
The Program subject must be implemented by a dynamic library, that is, in the system/library/mobilesubstrate/dynamiclibraries
The kuaidail main implementation program, such as kuaidail. dylib, and kuaidail. plist, contains loaded configuration items, such as com. Apple. mobilephone,
Com. Apple. SMS.
3. Call History editable
In the iPhone phone program, call records are displayed using the uitableview control, which can be edited by setting the uitableview.
The "edit" button in the upper-left corner of the phone program can be added to the left of uinavigationbar as uibarbuttonitem. You may need to delete a call record.
Update the system call history database, which is in the call records in the/library. The call history database is an SQLite database.
4. display of contact pictures
The acquisition of contact images is not complex. You can use the abpersoncopyimagedata function to implement it, and then set it on the cell of uitableview based on the size.
5. Display contacts in the specified region
It is a good way to use the trusted database, and the efficiency can be kept up with it. The appstore's software quick SMS + is an example. However, the most efficient way is to customize the region
Data format: generate a bind file by means of sequential or reverse sorting of the information in the local database, use fopen to read the information, and use binary search to obtain the number.
Kuaidail adopts this method.
6. the call records are displayed in different locations.
In the recent call of the Telephone Program, kuaidail can display the location information under the number or contact, or the call time according to the settings,
You can use the setframe method of the hook-related view to display the position. You can obtain information about all views recursively.
(19:14:16 supplement)
7. Dialing keyboard interface of the system phone Program # symbol change and I icon added in the upper right corner
This mainly requires obtaining the viewcontroller and view corresponding to this interface. You can obtain the header file from the classdump library of mobilephone, which is easier to find;
You can also hook the following method to obtain the string of the viewcontroller: viewwillappear, viewdidappear, and viewdidload events of the uiviewcontroller.
Name and the names of all views in the interface, and then add the icon above. # The symbol can be changed by long-clicking. You can use the universal uilongpressgestrurerecognizer.
Click the help icon to generate a small view of several help information. You can use uicalloutview or uimenucontroller.
8. Multiple numbers are displayed on the upper part of the dial-up keyboard interface of the system phone program, which can be displayed cyclically.
You can use uiscrollview. To achieve circular scrolling, you can create the same uiscrollview on the left and right of uiscrollview.
You can also display the previous and next views on the left and right sides of the sliding event to save memory.
(10:55:46 supplement)
9. intercepting system SMS events
The class smsctserver that is not publicly available in the system includes the SMS processing method. The _ ingestincomingctmessage method is the method for Receiving text messages and can be hooked for processing.
10. System phone Interception
There are many ways to handle system phone events, but it is not easy to avoid system-related handling after interception. After ios4.0, Apple opened an event for obtaining incoming phone messages;
However, this event is a good requirement. When this number is called, the system does not display any interface, which is the best effect. Hook ctcallcenter class
The handlenotificationfromconnection method of does not solve this problem well. Using the cttelephonycenteraddobserver method seems to be better, but it fails
Achieve kuaidail implementation.