This commit is contained in:
unknown
2021-01-05 19:18:12 +08:00
parent 50b7f00cdf
commit 8be440d6b2
17 changed files with 57 additions and 23 deletions

View File

@@ -2,7 +2,6 @@ package com.mogo.httpdns;
import androidx.annotation.Keep;
public
/**
* @author congtaowang
* @since 2020/11/18
@@ -10,7 +9,7 @@ public
* 描述
*/
@Keep
class HttpDnsConst {
public class HttpDnsConst {
@Keep
public static final String PATH = "/httpdns/api";

View File

@@ -3,7 +3,6 @@ package com.mogo.httpdns;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
public
/**
* @author congtaowang
* @since 2020/11/19
@@ -11,7 +10,7 @@ public
* dns 解析回调
*/
@Keep
interface IHttpDnsCallback {
public interface IHttpDnsCallback {
@Keep
void onParsed( @Nullable String ip );

View File

@@ -2,7 +2,6 @@ package com.mogo.httpdns;
import androidx.annotation.Keep;
public
/**
* @author congtaowang
* @since 2020/11/19
@@ -10,7 +9,7 @@ public
* dns ttl 通知
*/
@Keep
interface IHttpDnsTtlCallback {
public interface IHttpDnsTtlCallback {
@Keep
void onTtl();

View File

@@ -9,7 +9,6 @@ import com.mogo.utils.network.HttpDns;
import java.util.Collection;
import java.util.List;
public
/**
* @author congtaowang
* @since 2020/11/18
@@ -17,13 +16,14 @@ public
* http 请求做http dns转换
*/
@Keep
interface IMogoHttpDns extends IProvider {
public interface IMogoHttpDns extends IProvider {
/**
* 获取 dns 代理实例
*
* @return
*/
@Keep
@Nullable
HttpDns dns();

View File

@@ -18,8 +18,10 @@ class MogoHttpDnsHandler {
}
private static IMogoHttpDns sHttpDns;
@Keep
private static volatile IMogoHttpDns sHttpDns;
@Keep
public static IMogoHttpDns getHttpDnsApi() {
if ( sHttpDns == null ) {
synchronized ( MogoHttpDnsHandler.class ) {