Use the cracked version of Baidu advertising framework to Baidu Advertising

Source: Internet
Author: User

The anti-compilation apk file is typically used Apktool to decompile the APK and then remove the. smali file from the Com\baidu\mobads directory.

Then use notepad++ to search all the. Smali files (Find >> file lookup). The initial set for those classes called the Baidu Advertising API.

may not be found. If you find the

For the Dex file by line Dex2jar, use Jdgui to open the jar file, to see just how those classes that were targeted to call Baidu ads what API.

I decompile an apk, and there is no code for the API that invokes the advertisement in the jar. It appears to be used only in layout file lookup.

One of the layout files found such a piece of code

<com.baidu.mobads.adview android:id= "@id/ads" android:layout_width= "fill_parent" android:layout_height= "Wrap_ Content "android:layout_alignparentleft=" true "android:layout_alignparentbottom=" true "baiduadsdk:adsize=" 0 " Baiduadsdk:adid= "1003fbb5"/>

Okay, that's the code that makes the ad work.

So you just have to replace the com.baidu.mobads.AdView.class in the jar.

Next, open eclipse to create a new project with the project name arbitrarily.

Then create a Adview class with the package name Com.baidu.mobads.

The code is as follows

Package Com.baidu.mobads;import Android.content.context;import Android.util.attributeset;import Android.widget.relativelayout;public Final class AdView extends Relativelayout {public AdView (Context paramcontext) { This (Paramcontext, true, Adsize.banner, "");} Public AdView (Context paramcontext, AttributeSet paramattributeset) {This (Paramcontext, Paramattributeset, True, Adsize.banner, "");} Public AdView (Context paramcontext, AttributeSet paramattributeset,boolean Paramboolean, adsize paramadsize, String paramstring) {super (Paramcontext, paramattributeset);} Public AdView (Context paramcontext, Adsize paramadsize, String paramstring) {This (Paramcontext, true, Paramadsize, paramstring);} AdView (Context paramcontext, Boolean paramboolean, Adsize paramadsize,string paramstring) {This (Paramcontext, NULL, Paramboolean, Paramadsize, paramstring);}}


When you paste the code in, you find a lot of mistakes. Don't worry.

Context,attributeset, Relativelayout These errors, the key is not import it?

Do you want to copy a Android.jar to this project? No. Because the package name and class name are determined for a class.

Then create a context class with the package name Android.content. The code is as follows

Package Android.content;public class Context {}

Also create a attributeset, package name Android.util. The code is as follows

Package Android.util;public class AttributeSet {}

Also create a attributeset, package name Android.util. The code is as follows

Package Android.widget;import Android.content.context;import Android.util.attributeset;public class RelativeLayout { Public Relativelayout (Context paramcontext, AttributeSet paramattributeset) {//TODO auto-generated constructor stub}}

There's one more place to go. Adsize!!!

Under the Com.baidu.mobads package, create an enumeration

Package Com.baidu.mobads;public enum Adsize {Banner}

All right, all the mistakes are gone. Some people will ask, the above several classes do not write implementation?

First of all, there is no code call Adview method, then do not write Adview method Bai, if there is a call to write this method directly, but do not write the method inside the body. There is a return to return a necessary value, this is worth considering slowly.

In writing the use of the context class, Adview also did not call the method of the context. That doesn't write the method.

Then randomly create a class, adding an empty main method.

Click on the run,com.baidu.mobads.adview.class to come out.

Open the directory for the project and locate the bin directory. Find Adview.class

Locate the jar file that you just compiled, and open it with a tool like WinRAR.

Delete all files under Com/baidu/mobads

The Adview.class is placed in the Com/baidu/mobads directory of the jar compression package. Just drag it right in.

Then use Jar2dex to convert back to Dex, replacing the Dex file of the original apk. Re-sign. Ok.

Is it magical? In fact, Java is not only the code can be copied and pasted, even the compiled. class file can also be copied and pasted delete.

Just make sure the necessary framework is complete. It's hard not to be cracked.

Ads for other platforms also apply, such as Google ads.

If a bit more ruthless, the entire Baidu advertising API is to be repeated. Want to crack Baidu advertising words, Dex2jar.

Delete Baidu, the cottage frame to replace their own. Jar2dex again. Replace the original Dex and re-sign OK.

Don't ask me who I am, we are the allies of Lei Feng! We are only for the benefit of users!

Warning: Not for the benefit of the user, and the use of this law for their own own purposes of money, the consequences of self-esteem!

Use the cracked version of Baidu advertising framework to Baidu Advertising

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.