添加混淆规则
This commit is contained in:
parent
8d3921de0d
commit
6666abcf17
@ -43,6 +43,13 @@ android {
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
debug {
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
kotlinOptions{
|
||||
jvmTarget = "1.8"
|
||||
@ -106,21 +113,20 @@ dependencies {
|
||||
|
||||
//-----------------------applovin
|
||||
implementation("com.applovin:applovin-sdk:+")
|
||||
implementation("com.applovin.mediation:bigoads-adapter:+")
|
||||
implementation("com.applovin.mediation:chartboost-adapter:+")
|
||||
implementation("com.google.android.gms:play-services-base:16.1.0")
|
||||
implementation("com.applovin.mediation:fyber-adapter:+")
|
||||
// implementation("com.applovin.mediation:google-ad-manager-adapter:+")
|
||||
// implementation("com.applovin.mediation:google-adapter:+")
|
||||
implementation("com.applovin.mediation:inmobi-adapter:+")
|
||||
implementation("com.squareup.picasso:picasso:2.71828")
|
||||
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||
implementation("com.applovin.mediation:ironsource-adapter:+")
|
||||
implementation("com.applovin.mediation:vungle-adapter:+")
|
||||
implementation("com.applovin.mediation:facebook-adapter:+")
|
||||
implementation("com.applovin.mediation:moloco-adapter:+")
|
||||
implementation("com.applovin.mediation:bytedance-adapter:+")
|
||||
implementation("com.applovin.mediation:unityads-adapter:+")
|
||||
// implementation("com.applovin.mediation:bigoads-adapter:+")
|
||||
// implementation("com.applovin.mediation:chartboost-adapter:+")
|
||||
// implementation("com.google.android.gms:play-services-base:16.1.0")
|
||||
// implementation("com.applovin.mediation:fyber-adapter:+")
|
||||
//
|
||||
// implementation("com.applovin.mediation:inmobi-adapter:+")
|
||||
// implementation("com.squareup.picasso:picasso:2.71828")
|
||||
// implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||
// implementation("com.applovin.mediation:ironsource-adapter:+")
|
||||
// implementation("com.applovin.mediation:vungle-adapter:+")
|
||||
// implementation("com.applovin.mediation:facebook-adapter:+")
|
||||
// implementation("com.applovin.mediation:moloco-adapter:+")
|
||||
// implementation("com.applovin.mediation:bytedance-adapter:+")
|
||||
// implementation("com.applovin.mediation:unityads-adapter:+")
|
||||
|
||||
|
||||
//applovin The SDK collects the Google Advertising ID. This requires the Android Advertising ID (AAID) module (com.google.android.gms:play-services-ads-identifier).
|
||||
|
||||
57
app/proguard-rules.pro
vendored
57
app/proguard-rules.pro
vendored
@ -43,3 +43,60 @@
|
||||
-keep class * extends com.google.gson.reflect.TypeToken
|
||||
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations
|
||||
|
||||
|
||||
|
||||
|
||||
# 使用R8全模式,对未保留的类剥离通用签名。挂起函数被包装在使用类型参数的continuation中。
|
||||
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
|
||||
|
||||
# 如果不保留,R8完整模式将从返回类型中剥离通用签名。
|
||||
-if interface * { @retrofit2.http.* public *** *(...); }
|
||||
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
|
||||
|
||||
# 在R8全模式下,对未保留的类剥离通用签名。
|
||||
-keep,allowobfuscation,allowshrinking class retrofit2.Response
|
||||
|
||||
|
||||
|
||||
## ---------Retrofit混淆方法---------------
|
||||
-dontwarn javax.annotation.**
|
||||
-dontwarn javax.inject.**
|
||||
# OkHttp3
|
||||
-dontwarn okhttp3.logging.**
|
||||
-keep class okhttp3.internal.**{*;}
|
||||
-dontwarn okio.**
|
||||
# Retrofit
|
||||
-dontwarn retrofit2.**
|
||||
-keep class retrofit2.** { *; }
|
||||
-keepattributes Signature
|
||||
-keepattributes Exceptions
|
||||
# RxJava RxAndroid
|
||||
-dontwarn sun.misc.**
|
||||
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
|
||||
long producerIndex;
|
||||
long consumerIndex;
|
||||
}
|
||||
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
|
||||
rx.internal.util.atomic.LinkedQueueNode producerNode;
|
||||
}
|
||||
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
|
||||
rx.internal.util.atomic.LinkedQueueNode consumerNode;
|
||||
}
|
||||
|
||||
# Gson
|
||||
-keep class com.google.gson.stream.** { *; }
|
||||
-keepattributes EnclosingMethod
|
||||
|
||||
-keep class com.offline.music.playermp3.javabean.**{*;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-keep class org.chromium.** { *; }
|
||||
-keep class androidx.media3.datasource.cronet.** { *; }
|
||||
-keep class androidx.media3.exoplayer.scheduler.PlatformScheduler$PlatformSchedulerService { *; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -31,6 +31,7 @@ public class AdapterHome extends BaseAdapter<ResponseHomeChild, ItemHomeBinding>
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
int itemViewType = getItemViewType(position);
|
||||
CommonUtils.LogMsg("-----------pos="+position+"---itemViewType="+itemViewType);
|
||||
if (itemViewType == TYPE_ITEM) {
|
||||
VHolder<ItemHomeBinding> itemHolder = (VHolder<ItemHomeBinding>) holder;
|
||||
ItemHomeBinding vb = itemHolder.getVb();
|
||||
|
||||
@ -10,6 +10,7 @@ import androidx.viewbinding.ViewBinding;
|
||||
|
||||
import com.offline.music.playermp3.api.HomeItemClickListener;
|
||||
import com.offline.music.playermp3.databinding.ItemFooterLoadingBinding;
|
||||
import com.offline.music.playermp3.helper.CommonUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -57,14 +58,16 @@ abstract public class BaseAdapter<K, T extends ViewBinding> extends RecyclerView
|
||||
public void addLoadingFooter() {
|
||||
isLoadingAdded = true;
|
||||
notifyItemInserted(data.size());
|
||||
CommonUtils.LogMsg("--------addLoadingFooter---position="+data.size());
|
||||
}
|
||||
|
||||
// Hide loading footer
|
||||
public void removeLoadingFooter() {
|
||||
isLoadingAdded = false;
|
||||
int position = data.size();
|
||||
if (position > 0)
|
||||
int position = getItemCount();
|
||||
if (position >= 0)
|
||||
notifyItemRemoved(position);
|
||||
isLoadingAdded = false;
|
||||
CommonUtils.LogMsg("---------removeLoadingFooter--position="+position);
|
||||
}
|
||||
|
||||
|
||||
@ -90,6 +93,7 @@ abstract public class BaseAdapter<K, T extends ViewBinding> extends RecyclerView
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
CommonUtils.LogMsg("---------getItemCount=");
|
||||
return data.size() + (isLoadingAdded ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ public class HomeFragment extends BaseFragment<FragmentHomeBinding> implements H
|
||||
|
||||
private int requestCount = 1;
|
||||
|
||||
private int totalPage = 3;
|
||||
private int totalPage = 4;
|
||||
|
||||
|
||||
private List<ResponseHomeChild> childList = new ArrayList<>();
|
||||
@ -61,7 +61,10 @@ public class HomeFragment extends BaseFragment<FragmentHomeBinding> implements H
|
||||
Vb.tvRetry.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Vb.layoutError.setVisibility(View.GONE);
|
||||
adapterHome.addLoadingFooter();
|
||||
|
||||
CommonUtils.LogMsg("-----------onClick");
|
||||
vmHome.getHome();
|
||||
}
|
||||
});
|
||||
@ -70,16 +73,17 @@ public class HomeFragment extends BaseFragment<FragmentHomeBinding> implements H
|
||||
@Override
|
||||
public void onChanged(ResponseHome responseHome) {
|
||||
if (responseHome == null) {
|
||||
CommonUtils.LogMsg("-----------requestCount="+requestCount);
|
||||
adapterHome.removeLoadingFooter();
|
||||
requestCount--;
|
||||
if(requestCount == 0){
|
||||
if(requestCount>1){
|
||||
requestCount--;
|
||||
}
|
||||
if (requestCount == 1) {
|
||||
Vb.layoutError.setVisibility(View.VISIBLE);
|
||||
Vb.recyclerSongOfTheDay.setVisibility(View.GONE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
Vb.layoutError.setVisibility(View.GONE);
|
||||
Vb.recyclerSongOfTheDay.setVisibility(View.VISIBLE);
|
||||
|
||||
List<ResponseHomeChild> childList1 = responseHome.getChildList();
|
||||
if (childList1 == null) return;
|
||||
@ -104,7 +108,7 @@ public class HomeFragment extends BaseFragment<FragmentHomeBinding> implements H
|
||||
LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
|
||||
if (layoutManager != null && layoutManager.findLastVisibleItemPosition() == childList.size() - 1) {
|
||||
if (requestCount < totalPage && !adapterHome.isLoadingAdded()) {
|
||||
CommonUtils.LogMsg("------loadmore--");
|
||||
CommonUtils.LogMsg("------loadmore--requestCount="+requestCount);
|
||||
adapterHome.addLoadingFooter();
|
||||
vmHome.getHomeMore();
|
||||
requestCount++;
|
||||
@ -134,13 +138,12 @@ public class HomeFragment extends BaseFragment<FragmentHomeBinding> implements H
|
||||
String pageType = data.getPageType();
|
||||
String browseId = data.getBrowseId();
|
||||
String twoSubtitle = data.getTwoSubtitle();
|
||||
if (pageType.equals(MyValue.PAGE_TYPE_MV)||pageType.equals(MyValue.PAGE_TYPE_MV_LIST)) {
|
||||
if (pageType.equals(MyValue.PAGE_TYPE_MV) || pageType.equals(MyValue.PAGE_TYPE_MV_LIST)) {
|
||||
Intent intent = new Intent(activity, PlayActivity.class);
|
||||
intent.putExtra(MyValue.KEY_PLAY_ACTIVITY_MV, data);
|
||||
intent.putExtra(MyValue.KEY_ENTER_SOURCE, MyValue.TYPE_ENTER_SOURCE_MV);
|
||||
startActivity(intent);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Intent intent = new Intent(activity, CategoryListActivity.class);
|
||||
intent.putExtra(MyValue.KEY_CATEGORY_LIST_TYPE, pageType);
|
||||
intent.putExtra(MyValue.KEY_CATEGORY_LIST_SINGER_NAME, twoSubtitle);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/linearLayout"
|
||||
@ -22,21 +22,24 @@
|
||||
android:id="@+id/recycler_song_of_the_day"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:paddingStart="6dp" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_error"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_error"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="200dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:gravity="center"
|
||||
@ -63,4 +66,4 @@
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user