Skip to content

Commit

Permalink
run
Browse files Browse the repository at this point in the history
  • Loading branch information
hss01248 committed May 26, 2024
1 parent 8c475e0 commit 254acda
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ buildscript {
apply from: 'https://raw.githubusercontent.com/hss01248/flipperUtil/gradle7_5/remote3.gradle?q=2'
apply from: 'https://raw.githubusercontent.com/hss01248/flipperUtil/gradle7_5/z_config/pack.gradle?q=3'
//apply from : 'https://raw.githubusercontent.com/hss01248/BaseAppAnalytics/master/remote.gradle'
apply from: 'https://raw.githubusercontent.com/hss01248/flipperUtil/dev/deps/depsLastestChecker.gradle'
//apply from: 'https://raw.githubusercontent.com/hss01248/flipperUtil/dev/deps/uploadAllTask.gradle'
apply from: 'https://raw.githubusercontent.com/hss01248/flipperUtil/gradle7_5/deps/depsLastestChecker.gradle'
apply from: 'https://raw.githubusercontent.com/hss01248/flipperUtil/gradle7_5/deps/uploadAllByMavenPublish.gradle?a=3'
apply from: 'https://raw.githubusercontent.com/hss01248/flipperUtil/gradle7_5/z_config/git_branch_info.gradle'

//apply from: 'pack.gradle'
Expand All @@ -14,7 +14,7 @@ buildscript {
// 快照版需要在版本号后面加-SNAPSHOT
//groupId='com.xxx.yyy.mylib'
groupId='com.github.hss01248.ImageLoader'
versionCode = '3.3.3.01'
versionCode = '3.7.2.00'
isPublisToLocal=true

}
Expand Down
3 changes: 2 additions & 1 deletion glidev4/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

apply plugin: 'com.android.library'

android {
Expand All @@ -9,7 +10,7 @@ android {
targetSdkVersion 28
versionCode 1
versionName "1.0"

consumerProguardFiles "consumer-rules.pro"
//testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}
Expand Down
3 changes: 3 additions & 0 deletions glidev4/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-keep class com.shizhefei.view.largeimage.factory.** { *; }
-keep class com.bumptech.glide.** { *; }
-keep class pl.droidsonroids.gif.InputSource.** { *; }
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.hss01248.glidev4.config;

import android.content.Context;
import android.graphics.Bitmap;
import android.util.Log;

import androidx.annotation.NonNull;
Expand All @@ -9,11 +10,14 @@
import com.bumptech.glide.Glide;
import com.bumptech.glide.Registry;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader;
import com.bumptech.glide.load.model.GlideUrl;
import com.bumptech.glide.module.LibraryGlideModule;
import com.hss01248.glide.aop.net.ModifyResponseBodyInterceptor;
import com.hss01248.image.config.GlobalConfig;

import java.io.InputStream;
import java.nio.ByteBuffer;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
Expand All @@ -26,6 +30,8 @@
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

import jp.co.link_u.library.glideavif.AvifDecoderFromByteBuffer;
import me.jessyan.progressmanager.ProgressManager;
import okhttp3.OkHttpClient;

/**
Expand All @@ -44,19 +50,20 @@ public void registerComponents(@NonNull Context context, @NonNull Glide glide,
LogUtils.w("in lib: registerComponents");
OkHttpClient.Builder builder = new OkHttpClient.Builder();
//.addInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY));
if(GlobalConfig.debug){
//if(GlobalConfig.debug){
setIgnoreAll(builder);
}
// }

builder
.addNetworkInterceptor(new ModifyResponseBodyInterceptor())
.connectTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS);
// registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(ProgressManager.getInstance()
// .with(builder).build()));
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(10, TimeUnit.SECONDS)
.writeTimeout(10, TimeUnit.SECONDS);
registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(ProgressManager.getInstance()
.with(builder).build()));
registry.prepend(ByteBuffer.class, Bitmap.class,new AvifDecoderFromByteBuffer());
//todo 不如直接用aop切,简单粗暴: com.bumptech.glide.load.model.FileLoader.buildLoadData, 将第一个参数File model替换掉
/* registry.prepend(ByteBuffer.class, Bitmap.class,new AvifDecoderFromByteBuffer());
/*
registry.replace(File.class, InputStream.class, new MyStreamFactory());
Expand Down

0 comments on commit 254acda

Please sign in to comment.