Skip to content

Commit

Permalink
[Android] update version to release release-10.6.11181
Browse files Browse the repository at this point in the history
  • Loading branch information
rulongzhang committed Sep 1, 2022
1 parent 504e8af commit 18ea6b1
Show file tree
Hide file tree
Showing 55 changed files with 532 additions and 370 deletions.
13 changes: 11 additions & 2 deletions Android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

*.iml
*.gradle/
/local.properties
Expand All @@ -9,4 +8,14 @@ build/
.externalNativeBuild
.cxx
*.codecc/
/build.yml
/build.yml
tuicore
tuiofflinepush
TUIComponent/TUICallKit/tuicallkit
TUIComponent/TUICallKit/tuicallengine
TUIComponent/TUIPusher/tuipusher
TUIComponent/TUIPlayer/tuiplayer
TUIWidget/TUIBeauty/tuibeauty
TUIWidget/TUIBarrage/tuibarrage
TUIWidget/TUIAudioEffect/tuiaudioeffect
TUIWidget/TUIGift/tuigift
52 changes: 0 additions & 52 deletions Android/README.md

This file was deleted.

2 changes: 2 additions & 0 deletions Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ android {
targetSdkVersion 26
multiDexEnabled true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

buildTypes {
release {
minifyEnabled false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.tencent.liteav.demo.app;

import static com.tencent.liteav.debug.GenerateGlobalConfig.LICENSEURL;
import static com.tencent.liteav.debug.GenerateGlobalConfig.LICENSEURLKEY;
import static com.tencent.liteav.debug.GenerateTestUserSig.LICENSEURL;
import static com.tencent.liteav.debug.GenerateTestUserSig.LICENSEURLKEY;

import android.content.Intent;
import android.graphics.Color;
Expand Down
5 changes: 2 additions & 3 deletions Android/basic/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
minSdkVersion 17
Expand All @@ -20,10 +19,10 @@ android {
dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')

api "com.blankj:utilcode:1.25.9"
api "com.blankj:utilcode:1.30.7"
api "com.google.code.gson:gson:2.3.1"
api "de.hdodenhof:circleimageview:3.1.0"
api "com.github.ctiao:DanmakuFlameMaster:0.5.3"
api "com.github.ctiao:DanmakuFlameMaster:0.3.8"
api "com.github.bumptech.glide:glide:4.12.0"
api "com.squareup.okhttp3:okhttp:3.11.0"
api "com.squareup.retrofit2:retrofit:2.2.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.tencent.liteav.basic;

public interface AvatarConstant {
String USER_AVATAR_ARRAY [] = {
String[] USER_AVATAR_ARRAY = {
"https://liteav.sdk.qcloud.com/app/res/picture/voiceroom/avatar/user_avatar1.png",
"https://liteav.sdk.qcloud.com/app/res/picture/voiceroom/avatar/user_avatar2.png",
"https://liteav.sdk.qcloud.com/app/res/picture/voiceroom/avatar/user_avatar3.png",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public static void loadImage(Context context, ImageView imageView, String url, @
loadImage(context, imageView, url, errorResId, radius);
}

public static void loadImage(Context context, ImageView imageView, String url, @DrawableRes int errorResId, int radius) {
public static void loadImage(Context context, ImageView imageView, String url,
@DrawableRes int errorResId, int radius) {
if (TextUtils.isEmpty(url)) {
if (imageView != null && errorResId != 0) {
imageView.setImageResource(errorResId);
Expand Down Expand Up @@ -75,7 +76,8 @@ public static Bitmap getImage(Context context, String url, int width, int height
return null;
}

public static void loadImageThumbnail(Context context, ImageView imageView, String url, @DrawableRes int resourceId, int radius) {
public static void loadImageThumbnail(Context context, ImageView imageView,
String url, @DrawableRes int resourceId, int radius) {
Glide.with(context).load(url)
.apply(new RequestOptions().placeholder(resourceId).error(resourceId).centerCrop()
.transform(new GlideRoundTransform(imageView.getContext(), radius)))
Expand Down Expand Up @@ -120,7 +122,9 @@ protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, in
}

private static Bitmap roundCrop(BitmapPool pool, Bitmap source) {
if (source == null) return null;
if (source == null) {
return null;
}

Bitmap result = pool.get(source.getWidth(), source.getHeight(), Bitmap.Config.ARGB_8888);
if (result == null) {
Expand Down
136 changes: 136 additions & 0 deletions Android/basic/src/main/java/com/tencent/liteav/basic/MD5Utils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
package com.tencent.liteav.basic;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MD5Utils {

private static final String[] hexDigits = {"0", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};

private static MessageDigest messageDigest = null;

static {
try {
messageDigest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}

public static String getFileMD5String(File file) {
String ret = "";
FileInputStream in = null;
FileChannel ch = null;
try {
in = new FileInputStream(file);
ch = in.getChannel();
ByteBuffer byteBuffer = ch.map(FileChannel.MapMode.READ_ONLY, 0,
file.length());
messageDigest.update(byteBuffer);
ret = bytesToHex(messageDigest.digest());
} catch (IOException e) {
e.printStackTrace();

} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (ch != null) {
try {
ch.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return ret;
}

public static String getFileMD5String(String fileName) {
return getFileMD5String(new File(fileName));
}

public static String getMD5String(String sourceStr) {
return getMD5String(sourceStr.getBytes());
}

public static String getMD5String(byte[] bytes) {
messageDigest.update(bytes);
return bytesToHex(messageDigest.digest());
}

public static boolean checkPassword(String pwd, String md5) {
return getMD5String(pwd).equalsIgnoreCase(md5);
}

public static boolean checkPassword(char[] pwd, String md5) {
return checkPassword(new String(pwd), md5);

}

public static boolean checkFileMD5(File file, String md5) {
return getFileMD5String(file).equalsIgnoreCase(md5);

}

public static boolean checkFileMD5(String fileName, String md5) {
return checkFileMD5(new File(fileName), md5);

}

public static String bytesToHex(byte[] bytes) {
return bytesToHex(bytes, 0, bytes.length);

}

public static String bytesToHex(byte[] bytes, int start, int end) {
StringBuilder sb = new StringBuilder();
for (int i = start; i < start + end; i++) {
sb.append(byteToHex(bytes[i]));
}
return sb.toString();

}

public static String byteToHex(byte bt) {
return hexDigits[(bt & 0xf0) >> 4] + "" + hexDigits[bt & 0xf];

}

public static String parseUrlToFileName(String urlStr)
throws UnsupportedEncodingException, NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] results = md.digest(urlStr.getBytes(StandardCharsets.UTF_8));
return byteArrayToHexString(results);
}

private static String byteArrayToHexString(byte[] b) {
StringBuffer resultSb = new StringBuffer();
for (int i = 0; i < b.length; i++) {
resultSb.append(byteToHexString(b[i]));
}
return resultSb.toString();
}

private static String byteToHexString(byte b) {
int n = b;
if (n < 0) {
n = 256 + n;
}
int d1 = n / 16;
int d2 = n % 16;
return hexDigits[d1] + hexDigits[d2];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ private void loadUserModel() {
String json = SPUtils.getInstance(PER_DATA).getString(PER_USER_MODEL);
mUserModel = GsonUtils.fromJson(json, UserModel.class);
} catch (Exception e) {
Log.d(TAG, "loadUserModel failed:" + e.getMessage());
}
}

Expand All @@ -77,6 +78,7 @@ private void setUserPublishVideoDate(String date) {
try {
SPUtils.getInstance(PER_DATA).put(PER_USER_DATE, mUserPubishVideoDate);
} catch (Exception e) {
Log.d(TAG, "setUserPublishVideoDate failed:" + e.getMessage());
}
}

Expand Down
12 changes: 7 additions & 5 deletions Android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
buildscript {

repositories {
jcenter()
google()
mavenCentral()
// TUIOfflinePush : configure HMS Core SDK Maven address, delete it without the Huawei offline push function.

}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// TUIOfflinePush: Huawei, delete it without Huawei offline push function
classpath 'com.huawei.agconnect:agcp:1.4.1.300'

// TUIOfflinePush : Google(FCM), delete it without Google offline push function
classpath 'com.google.gms:google-services:4.3.10'
}
}

Expand All @@ -23,9 +25,9 @@ allprojects {
dirs project(':app').file('libs')
dirs project(':tuibeauty').file('libs')
}
jcenter()
google()
mavenCentral()
// TUIOfflinePush : delete it without the Huawei offline push function.

}
}
Expand Down
Loading

0 comments on commit 18ea6b1

Please sign in to comment.