master
fengyuecanzhu 3 years ago
parent 4fe8c6281c
commit dadf1853ba
  1. 7
      app/build.gradle
  2. BIN
      app/libs/ddsdk_4.1.6_custom_2021-04-09_0948.aar
  3. BIN
      app/libs/mintegral_appwall.aar
  4. BIN
      app/libs/mintegral_appwallext.aar
  5. BIN
      app/libs/mintegral_chinacommon.aar
  6. BIN
      app/libs/mintegral_interactiveads.aar
  7. BIN
      app/libs/mintegral_interstitial.aar
  8. BIN
      app/libs/mintegral_interstitialvideo.aar
  9. BIN
      app/libs/mintegral_mtgbanner.aar
  10. BIN
      app/libs/mintegral_mtgbid.aar
  11. BIN
      app/libs/mintegral_mtgdownloads.aar
  12. BIN
      app/libs/mintegral_mtgjscommon.aar
  13. BIN
      app/libs/mintegral_mtgnative.aar
  14. BIN
      app/libs/mintegral_mtgnativeadvanced.aar
  15. BIN
      app/libs/mintegral_mtgsplash.aar
  16. BIN
      app/libs/mintegral_nativeex.aar
  17. BIN
      app/libs/mintegral_playercommon.aar
  18. BIN
      app/libs/mintegral_reward.aar
  19. BIN
      app/libs/mintegral_videocommon.aar
  20. BIN
      app/libs/mintegral_videojs.aar
  21. BIN
      app/libs/windAd-2.25.2.aar
  22. 68
      app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java
  23. 97
      app/src/main/java/xyz/fycz/myreader/ui/activity/DonateActivity.java
  24. 21
      app/src/main/java/xyz/fycz/myreader/ui/activity/SplashActivity.java
  25. 9
      app/src/main/java/xyz/fycz/myreader/util/utils/AdUtils.java
  26. 1
      app/src/main/res/layout/fragment_mine.xml

@ -141,7 +141,7 @@ repositories {
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.aar']) implementation fileTree(dir: 'libs', include: ['*.aar'])
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(path: ':DialogX') implementation project(path: ':DialogX')
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.ext:junit:1.1.1'
@ -222,11 +222,6 @@ dependencies {
implementation 'com.liulishuo.filedownloader:library:1.7.7' implementation 'com.liulishuo.filedownloader:library:1.7.7'
// 使广
implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8'
//SwipeBackLayout //SwipeBackLayout
implementation 'me.imid.swipebacklayout.lib:library:1.1.0' implementation 'me.imid.swipebacklayout.lib:library:1.1.0'

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -2,18 +2,12 @@ package xyz.fycz.myreader.ui.activity;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.text.TextPaint;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
@ -24,23 +18,14 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder; import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.google.zxing.EncodeHintType;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import com.weaction.ddsdk.ad.DdSdkFlowAd;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import cn.bingoogolapple.qrcode.zxing.QRCodeEncoder;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.ObservableSource; import io.reactivex.ObservableSource;
import io.reactivex.Single;
import io.reactivex.SingleOnSubscribe;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Function; import io.reactivex.functions.Function;
import xyz.fycz.myreader.R; import xyz.fycz.myreader.R;
@ -49,11 +34,8 @@ import xyz.fycz.myreader.application.SysManager;
import xyz.fycz.myreader.base.BaseActivity; import xyz.fycz.myreader.base.BaseActivity;
import xyz.fycz.myreader.base.BitIntentDataManager; import xyz.fycz.myreader.base.BitIntentDataManager;
import xyz.fycz.myreader.base.observer.MyObserver; import xyz.fycz.myreader.base.observer.MyObserver;
import xyz.fycz.myreader.base.observer.MySingleObserver;
import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.common.URLCONST;
import xyz.fycz.myreader.databinding.ActivityBookDetailBinding; import xyz.fycz.myreader.databinding.ActivityBookDetailBinding;
import xyz.fycz.myreader.entity.SharedBook;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.greendao.entity.rule.BookSource; import xyz.fycz.myreader.greendao.entity.rule.BookSource;
@ -65,25 +47,16 @@ import xyz.fycz.myreader.ui.adapter.DetailCatalogAdapter;
import xyz.fycz.myreader.ui.dialog.BookGroupDialog; import xyz.fycz.myreader.ui.dialog.BookGroupDialog;
import xyz.fycz.myreader.ui.dialog.DialogCreator; import xyz.fycz.myreader.ui.dialog.DialogCreator;
import xyz.fycz.myreader.ui.dialog.SourceExchangeDialog; import xyz.fycz.myreader.ui.dialog.SourceExchangeDialog;
import xyz.fycz.myreader.util.IOUtils;
import xyz.fycz.myreader.util.ShareUtils;
import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.AdUtils; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.BitmapUtil;
import xyz.fycz.myreader.util.utils.BlurTransformation; import xyz.fycz.myreader.util.utils.BlurTransformation;
import xyz.fycz.myreader.util.utils.FileUtils;
import xyz.fycz.myreader.util.utils.GsonExtensionsKt;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.util.utils.RxUtils; import xyz.fycz.myreader.util.utils.RxUtils;
import xyz.fycz.myreader.util.utils.ShareBookUtil; import xyz.fycz.myreader.util.utils.ShareBookUtil;
import xyz.fycz.myreader.util.utils.StringUtils;
import xyz.fycz.myreader.webapi.BookApi; import xyz.fycz.myreader.webapi.BookApi;
import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil; import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import xyz.fycz.myreader.webapi.crawler.source.ThirdCrawler;
/** /**
* @author fengyue * @author fengyue
@ -254,45 +227,6 @@ public class BookDetailedActivity extends BaseActivity {
mSourceDialog.setABooks(aBooks); mSourceDialog.setABooks(aBooks);
mSourceDialog.setSourceIndex(sourceIndex); mSourceDialog.setSourceIndex(sourceIndex);
initAd();
}
/**
* type 信息流类型只能填 1463 (样式请看下表)
* count 请求返回的信息流广告条目数最小为 1最大为 5通常情况下建议一次返回一条
*/
private void initAd() {
if (SharedPreUtils.getInstance().getBoolean("bookDetailAd", false)) {
AdUtils.checkHasAd().subscribe(new MySingleObserver<Boolean>() {
@Override
public void onSuccess(@NonNull Boolean aBoolean) {
if (aBoolean) {
AdUtils.initAd();
new DdSdkFlowAd().getFlowViews(BookDetailedActivity.this, 6, 1, new DdSdkFlowAd.FlowCallback() {
// 信息流广告拉取完毕后返回的 views
@Override
public void getFlowViews(List<View> views) {
Log.i(TAG, "信息流广告拉取完毕后返回了" + views.size() + "个view");
binding.ic.getRoot().addView(views.get(0), 2);
}
// 信息流广告展示后调用
@Override
public void show() {
AdUtils.adRecord("flow", "adShow");
Log.i(TAG, "信息流广告展示成功");
}
// 广告拉取失败调用
@Override
public void error(String msg) {
Log.i(TAG, "广告拉取失败\n" + msg);
}
});
}
}
});
}
} }
@Override @Override

@ -2,18 +2,10 @@ package xyz.fycz.myreader.ui.activity;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.util.Log;
import android.view.View; import android.view.View;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import com.weaction.ddsdk.ad.DdSdkFlowAd;
import com.weaction.ddsdk.ad.DdSdkInterAd;
import com.weaction.ddsdk.ad.DdSdkInterVideoAd;
import com.weaction.ddsdk.ad.DdSdkRewardAd;
import java.util.List;
import io.reactivex.annotations.NonNull; import io.reactivex.annotations.NonNull;
import xyz.fycz.myreader.R; import xyz.fycz.myreader.R;
import xyz.fycz.myreader.application.App; import xyz.fycz.myreader.application.App;
@ -49,7 +41,7 @@ public class DonateActivity extends BaseActivity {
@Override @Override
protected void initWidget() { protected void initWidget() {
AdUtils.checkHasAd().subscribe(new MySingleObserver<Boolean>() { /*AdUtils.checkHasAd().subscribe(new MySingleObserver<Boolean>() {
@Override @Override
public void onSuccess(@NonNull Boolean aBoolean) { public void onSuccess(@NonNull Boolean aBoolean) {
if (aBoolean) { if (aBoolean) {
@ -57,37 +49,13 @@ public class DonateActivity extends BaseActivity {
initAd(); initAd();
} }
} }
}); });*/
} }
private void initAd() { private void initAd() {
binding.llAdSupport.setVisibility(View.VISIBLE); binding.llAdSupport.setVisibility(View.VISIBLE);
int flowAdCount = SharedPreUtils.getInstance().getInt("flowAdCount", 2); int flowAdCount = SharedPreUtils.getInstance().getInt("flowAdCount", 2);
int count = App.isDebug() ? flowAdCount : 1; int count = App.isDebug() ? flowAdCount : 1;
new DdSdkFlowAd().getFlowViews(DonateActivity.this, 6, count, new DdSdkFlowAd.FlowCallback() {
// 信息流广告拉取完毕后返回的 views
@Override
public void getFlowViews(List<View> views) {
Log.d(TAG, "信息流广告拉取完毕后返回了" + views.size() + "个view");
for (int i = 0; i < views.size(); i++) {
View view = views.get(i);
binding.llAdSupport.addView(view, i + 2);
}
}
// 信息流广告展示后调用
@Override
public void show() {
AdUtils.adRecord("flow","adShow");
Log.d(TAG, "信息流广告展示成功");
}
// 广告拉取失败调用
@Override
public void error(String msg) {
Log.d(TAG, "广告拉取失败\n" + msg);
}
});
} }
@Override @Override
@ -95,67 +63,6 @@ public class DonateActivity extends BaseActivity {
binding.llWxZsm.setOnClickListener(v -> goDonate(URLCONST.WX_ZSM)); binding.llWxZsm.setOnClickListener(v -> goDonate(URLCONST.WX_ZSM));
binding.llZfbSkm.setOnClickListener(v -> goDonate(URLCONST.ZFB_SKM)); binding.llZfbSkm.setOnClickListener(v -> goDonate(URLCONST.ZFB_SKM));
binding.llQqSkm.setOnClickListener(v -> goDonate(URLCONST.QQ_SKM)); binding.llQqSkm.setOnClickListener(v -> goDonate(URLCONST.QQ_SKM));
binding.llRewardedVideo.setOnClickListener(v -> {
DdSdkRewardAd.show(this, new DdSdkRewardAd.DdSdkRewardCallback() {
@Override
public void show() {
Log.d(TAG, "激励视频展示成功");
AdUtils.adRecord("rewardVideo","adShow");
}
@Override
public void click() {
Log.d(TAG, "激励视频被点击");
AdUtils.adRecord("rewardVideo","adClick");
}
@Override
public void error(String msg) {
}
@Override
public void skip() {
Log.d(TAG, "激励视频被跳过");
AdUtils.adRecord("rewardVideo","adSkip");
}
@Override
public void finishCountdown() {
Log.d(TAG, "激励视频计时完成");
AdUtils.adRecord("rewardVideo","adFinishCount");
}
});
});
binding.llInterAd.setOnClickListener(v -> {
/*
* 参数 1 activity
* 参数 2 marginDp (float)插屏默认 margin 全屏幕的 24dp此处允许开发者手动调节 margin 大小单位为 dp允许范围为 0dp (全屏) ~ 48dp请开发者按需填写
*/
DdSdkInterAd.show(this, 48f, new DdSdkInterAd.Callback() {
@Override
public void show() {
Log.i(TAG, "插屏广告展示成功");
AdUtils.adRecord("inter","adShow");
}
@Override
public void click() {
Log.i(TAG, "插屏广告");
AdUtils.adRecord("inter","adClick");
}
@Override
public void error(String msg) {
}
@Override
public void close() {
Log.i(TAG, "插屏广告被关闭");
AdUtils.adRecord("inter","adClose");
}
});
});
} }

@ -1,9 +1,6 @@
package xyz.fycz.myreader.ui.activity; package xyz.fycz.myreader.ui.activity;
import android.Manifest;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
@ -11,16 +8,11 @@ import android.view.View;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.signature.ObjectKey; import com.bumptech.glide.signature.ObjectKey;
import com.gyf.immersionbar.ImmersionBar; import com.gyf.immersionbar.ImmersionBar;
import com.hjq.permissions.OnPermissionCallback; import com.hjq.permissions.OnPermissionCallback;
import com.hjq.permissions.Permission;
import com.hjq.permissions.XXPermissions; import com.hjq.permissions.XXPermissions;
import com.weaction.ddsdk.ad.DdSdkSplashAd;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@ -30,16 +22,14 @@ import java.util.List;
import xyz.fycz.myreader.R; import xyz.fycz.myreader.R;
import xyz.fycz.myreader.application.App; import xyz.fycz.myreader.application.App;
import xyz.fycz.myreader.base.BaseActivity; import xyz.fycz.myreader.base.BaseActivity;
import xyz.fycz.myreader.base.observer.MySingleObserver;
import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.databinding.ActivitySplashBinding; import xyz.fycz.myreader.databinding.ActivitySplashBinding;
import xyz.fycz.myreader.greendao.service.BookGroupService; import xyz.fycz.myreader.greendao.service.BookGroupService;
import xyz.fycz.myreader.ui.dialog.MyAlertDialog; import xyz.fycz.myreader.ui.dialog.MyAlertDialog;
import xyz.fycz.myreader.util.help.DateHelper;
import xyz.fycz.myreader.util.IOUtils; import xyz.fycz.myreader.util.IOUtils;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.AdUtils; import xyz.fycz.myreader.util.help.DateHelper;
import xyz.fycz.myreader.util.utils.ImageLoader; import xyz.fycz.myreader.util.utils.ImageLoader;
import xyz.fycz.myreader.util.utils.MD5Utils; import xyz.fycz.myreader.util.utils.MD5Utils;
import xyz.fycz.myreader.util.utils.OkHttpUtils; import xyz.fycz.myreader.util.utils.OkHttpUtils;
@ -156,7 +146,8 @@ public class SplashActivity extends BaseActivity {
} }
private void start() { private void start() {
if (adTimes >= 0 && todayAdCount >= adTimes) { startNoAd();
/*if (adTimes >= 0 && todayAdCount >= adTimes) {
startNoAd(); startNoAd();
} else { } else {
App.getHandler().postDelayed(() -> { App.getHandler().postDelayed(() -> {
@ -182,7 +173,7 @@ public class SplashActivity extends BaseActivity {
startNoAd(); startNoAd();
} }
}); });
} }*/
} }
private void startNoAd() { private void startNoAd() {
@ -217,7 +208,7 @@ public class SplashActivity extends BaseActivity {
} }
private void startWithAd() { private void startWithAd() {
try { /*try {
new DdSdkSplashAd().show(binding.flAd, this, new DdSdkSplashAd.CountdownCallback() { new DdSdkSplashAd().show(binding.flAd, this, new DdSdkSplashAd.CountdownCallback() {
// 展示成功 // 展示成功
@Override @Override
@ -257,7 +248,7 @@ public class SplashActivity extends BaseActivity {
e.printStackTrace(); e.printStackTrace();
WAIT_INTERVAL = 1500; WAIT_INTERVAL = 1500;
startNormal(); startNormal();
} }*/
} }

@ -2,8 +2,6 @@ package xyz.fycz.myreader.util.utils;
import android.util.Log; import android.util.Log;
import com.weaction.ddsdk.base.DdSdkHelper;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
@ -13,12 +11,11 @@ import io.reactivex.SingleOnSubscribe;
import io.reactivex.annotations.NonNull; import io.reactivex.annotations.NonNull;
import okhttp3.MediaType; import okhttp3.MediaType;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import xyz.fycz.myreader.application.App;
import xyz.fycz.myreader.base.observer.MySingleObserver; import xyz.fycz.myreader.base.observer.MySingleObserver;
import xyz.fycz.myreader.common.URLCONST; import xyz.fycz.myreader.common.URLCONST;
import xyz.fycz.myreader.model.backup.UserService; import xyz.fycz.myreader.model.backup.UserService;
import xyz.fycz.myreader.util.help.DateHelper;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.help.DateHelper;
/** /**
* @author fengyue * @author fengyue
@ -123,10 +120,6 @@ public class AdUtils {
public static void initAd() { public static void initAd() {
if (!hasInitAd) { if (!hasInitAd) {
hasInitAd = true; hasInitAd = true;
DdSdkHelper.init("1234", "216", "51716a16fbdf50905704b6575b1b3b60",
"142364", "35ce0efe5f3cc960b116db227498e238",
"8167", "85bd159309c3da1b",
App.getApplication(), App.isDebug());
} }
} }
} }

@ -325,6 +325,7 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/mine_rl_ad_setting" android:id="@+id/mine_rl_ad_setting"
android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="60dp"
android:background="@drawable/selector_common_bg" android:background="@drawable/selector_common_bg"

Loading…
Cancel
Save