Skip to content

Commit 54207dd

Browse files
committed
build:调整hash算法
1 parent d57945a commit 54207dd

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro
1414
# org.gradle.parallel=true
1515
android.useAndroidX=true
1616
android.enableJetifier=true
17-
VERSION_NAME=1.0.2
17+
VERSION_NAME=1.0.3
1818
GROUP_ID=com.meituan.android.walle
1919
DESCRIPTION=??walle???
2020
POM_URL=../repo

plugin/src/main/groovy/com/meituan/android/walle/ChannelMaker.groovy

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,14 @@ import com.android.build.FilterData
77
import com.android.build.gradle.api.BaseVariant
88
import com.google.gson.Gson
99
import groovy.text.SimpleTemplateEngine
10+
import org.apache.commons.codec.digest.DigestUtils
1011
import org.apache.commons.io.FileUtils
1112
import org.apache.commons.io.IOUtils
1213
import org.gradle.api.DefaultTask
1314
import org.gradle.api.GradleException
1415
import org.gradle.api.Project
1516
import org.gradle.api.tasks.Input
1617
import org.gradle.api.tasks.TaskAction
17-
import org.gradle.internal.impldep.com.google.common.base.Charsets
18-
import org.gradle.internal.impldep.com.google.common.hash.HashCode
19-
import org.gradle.internal.impldep.com.google.common.hash.HashFunction
20-
import org.gradle.internal.impldep.com.google.common.hash.Hashing
21-
import org.gradle.internal.impldep.com.google.common.io.Files
22-
import org.gradle.internal.impldep.org.apache.commons.codec.digest.DigestUtils
2318

2419
import java.nio.ByteBuffer
2520
import java.nio.channels.FileChannel
@@ -306,15 +301,15 @@ class ChannelMaker extends DefaultTask {
306301
}
307302

308303
private static String getFileHash(File file) throws IOException {
309-
DigestUtils.md5Hex(new FileInputStream(file))
304+
DigestUtils.md5(new FileInputStream(file))
310305
// HashCode hashCode;
311306
// HashFunction hashFunction = Hashing.sha1();
312307
// if (file.isDirectory()) {
313308
// hashCode = hashFunction.hashString(file.getPath(), Charsets.UTF_16LE);
314309
// } else {
315310
// hashCode = Files.hash(file, hashFunction);
316311
// }
317-
return DigestUtils.md5Hex(new FileInputStream(file));
312+
return DigestUtils.md5(new FileInputStream(file));
318313
}
319314

320315
}

0 commit comments

Comments
 (0)