@@ -0,0 +1,2880 @@
+/*%0A * Copyright (C) 2017 Oasis Feng. All rights reserved.%0A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0A/**%0A * %3Ch1%3EProject Condom%3C/h1%3E%0A *%0A * %3Cp%3EProject Condom is a thin library to wrap the naked Context in your Android project before passing it to the 3rd-party SDK.%0A * It is designed to prevent the 3rd-party SDK from common unwanted behaviors which may harm the user experience of your app.%0A *%0A * %3Cul%3E%0A * %3Cli%3E Massive launch of processes in other apps (common in 3rd-party push SDKs), causing slow app starting and notable lagging%0A * on low to middle-end devices. This behavior has %22chain reaction%22 effects among apps with similar SDKs, greatly aggravating%0A * the overall device performance.%0A * %3C/ul%3E%0A *%0A * %3Ch2%3EQuick Start%3C/h2%3E%0A *%0A * %3Col%3E%0A * %3Cli%3EAdd dependency to this library in build.gradle of your project module.%0A *%0A * %3Cpre%3E compile 'com.oasisfeng.condom:library:1.+' %3C/pre%3E%0A *%0A * %3Cli%3EMigration the initialization code of 3rd-party SDK.%0A *%0A * %3Cp%3EMost 3rd-party SDKs require explicit initialization with a %3Ccode%3EContext%3C/code%3E instance, something like:%0A *%0A * %3Cpre%3EXxxClient.init(context, ...);%3C/pre%3E%0A *%0A * Just change the context parameter to %7B@link com.oasisfeng.condom.CondomContext#wrap(android.content.Context, java.lang.String)%7D, like this:%0A *%0A * %3Cpre%3EXxxClient.init(CondomContext.wrap(context, %22XxxSDK%22), ...);%3C/pre%3E%0A *%0A * %3Cli%3EIf the 3rd-party SDK contains its own components (&lt;activity&gt;, &lt;service&gt;, &lt;receiver&gt; or &lt;provider&gt;),%0A * they will not be running with %3Ccode%3ECondomContext%3C/code%3E. To also prevent them from unwanted behaviors,%0A * %7B@link com.oasisfeng.condom.CondomProcess%7D is introduced to apply the process-level condom protection, assuming that%0A * those components are already isolated from your application process (with separate %3Ccode%3Eandroid:process%3C/code%3E specified).%0A *%0A * %3Cp%3EAdd the following initialization code in the very beginning of your Application.onCreate().%0A *%0A * %3Cpre%3E%0A * public class MyApplication extends Application %7B%0A *   public void onCreate() %7B%0A *     CondomProcess.installExceptDefaultProcess(this);%0A *     ...%0A *   %7D%0A * %7D%3C/pre%3E%0A * %3C/ol%3E%0A *%0A * That's all! Enjoy the pleasure with the confidence of protection.%0A */%0A@ParametersAreNonnullByDefault%0Apackage com.oasisfeng.condom;%0A%0Aimport javax.annotation.ParametersAreNonnullByDefault;

Add package summary in Javadoc.