We take helloword.apk as an example, anti-compilation implanted with rice ads.
First, we use the apk To change the rationale, decompile helloworld.apk.
Then follow the development document with the rice to advertise the placement. Http://static.youmi.net/files/sdk/YoumiSdk_v4.04_2013-07-12.zip
Steps:
1. Apply for AppID (Ignore )
2. Importing the SDK
Anti-compilation, with the meter SDK ,thedemo directory under the apidemo.apk.
3. Configure Androidmanifest
3.1 Configuring User Rights ( important )
Press the document to copy the permissions into the helloword androidmanifest.xml .
3.2 Add Required Components ( Important)
Copy the components into Helloword's androidmanifest.xml according to the documentation
Complete the above steps and our SDK has been implanted successfully.
Take an example of a rice ad strip call. Let's start by adding ad code.
According to the documentation, we add the code to the layout file of the Activity to display the ad , and put it in the appropriate location .
Open Layout/activity_main.xml and add layout code.
A new ID"adlayout"is added here and We need to write this ID manually to com the/example/helloworld/r$id.smali. Note that the value of the values in this position is incremented .
After the layout file has been modified, we call the ad interface in mainactivity 's OnCreate method to display the ad.
We write the following code into Android project.
Then decompile the corresponding smali code.
Add the Initad () corresponding smali code to the mainactivity , and the onCreate () Method calls Initad () to display the advertisement. (invoke-direct {p0}, Lcom/example/helloworld/mainactivity;->initad () V
Finally, compile the code to generate the apk. (Top navigation , compile-to- build apk), install the generated apk (Top navigation ->adb-> Install the generated apk ).
Before and after code implantation.
More content, look forward to your exploration, please pay attention to love encryption, so you wonderful constantly!
Love encryption official Address:http://www.ijiami.cn/
Android apk Two-pack placement AD