| | |
| | | import android.content.SharedPreferences; |
| | | import android.content.pm.ActivityInfo; |
| | | import android.os.Bundle; |
| | | import android.os.PersistableBundle; |
| | | import android.view.ViewGroup; |
| | | |
| | | import com.yeshi.makemoney.video.app.MyApplication; |
| | | import com.yeshi.makemoney.video.app.R; |
| | | import com.yeshi.makemoney.video.R; |
| | | import com.yeshi.makemoney.video.app.ui.dialog.PermissionAuthNotifyDialog; |
| | | import com.yeshi.makemoney.video.app.ui.dialog.UserProtocolDialog; |
| | | import com.yeshi.makemoney.video.app.utils.AppConfigUtil; |
| | | import com.yeshi.makemoney.video.app.utils.Constant; |
| | | import com.yeshi.makemoney.video.app.utils.SettingUtil; |
| | | import com.yeshi.makemoney.video.app.utils.UserUtil; |
| | | import com.demo.library_ad.AdUtil; |
| | | import com.demo.library_ad.SplashAdUtil; |
| | |
| | | import org.json.JSONObject; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.appcompat.app.AppCompatActivity; |
| | | import androidx.core.app.ActivityCompat; |
| | | import androidx.core.content.ContextCompat; |
| | | |
| | | import com.yeshi.makemoney.video.app.utils.api.HttpApiUtil; |
| | | import com.yeshi.makemoney.video.app.utils.api.BasicTextHttpResponseHandler; |
| | | import com.yeshi.makemoney.video.app.utils.videos.DrawVideoHBManager; |
| | | |
| | | import java.util.Iterator; |
| | | |
| | | import static android.content.pm.PackageManager.PERMISSION_DENIED; |
| | | import static android.content.pm.PackageManager.PERMISSION_GRANTED; |
| | |
| | | "1、我们对您的个人信息(包括但不限于<font color='#FF0000'>设备MAC地址、IMEI/Android ID</font>等信息)的收集/保存/使用/对外提供/保护等规则条款,以及您的用户权利等条款;<br>" + |
| | | "2、约定我们的限制责任、免责条款;<br>" + |
| | | "3、其他以加粗或斜体字进行标识的重要条款。</b><br>" + |
| | | "如您对协议有任何疑虑,可通过电子邮箱: xcwapp@qq.com 向我们询问,我们将为您竭诚解答。您点击“同意”的行为代表您已阅读完毕并接受以上协议全部条款。如您同意以上协议内容,请您点击“同意”,开始使用您的产品。"; |
| | | "如您对协议有任何疑虑,可通过电子邮箱: yes_vip_draw_video@163.com 向我们询问,我们将为您竭诚解答。您点击“同意”的行为代表您已阅读完毕并接受以上协议全部条款。如您同意以上协议内容,请您点击“同意”,开始使用您的产品。"; |
| | | |
| | | if (!UserUtil.isAgreeUserProtocol(getApplicationContext()) && !Constant.DEBUG) { |
| | | new UserProtocolDialog.Builder(SplashActivity.this).setNegativeButton("不同意", new DialogInterface.OnClickListener() { |
| | |
| | | MyApplication.init(MyApplication.application, new MyApplication.InitListener() { |
| | | @Override |
| | | public void onFinish() { |
| | | toMainActivity(); |
| | | } |
| | | }); |
| | | |
| | | // if (1 > 0) { |
| | | // vg_ad.postDelayed(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | | // toMainActivity(); |
| | | // } |
| | | // },3000); |
| | | // |
| | | // return; |
| | | // } |
| | | |
| | | |
| | | int delayMs = 1; |
| | | vg_ad.postDelayed(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | HttpApiUtil.getConfig(getApplicationContext(), new BasicTextHttpResponseHandler() { |
| | | |
| | | SettingUtil.initSettings(getApplicationContext()); |
| | | int delayMs = 1; |
| | | vg_ad.postDelayed(new Runnable() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject != null) { |
| | | if (jsonObject.getBoolean("IsPost")) { |
| | | JSONObject data = jsonObject.getJSONObject("Data"); |
| | | JSONObject ad = data.optJSONObject("adNew"); |
| | | //浏览器外跳协议 |
| | | AppConfigUtil.saveBrowserJumpOutProtocolPrefix(getApplicationContext(), data.optString("jumpAppProtocolPrefix")); |
| | | //保存联系客服,注销链接 |
| | | AppConfigUtil.saveConcatUsLink(getApplicationContext(), data.optString("contactUsLink")); |
| | | AppConfigUtil.saveUnRegisterLink(getApplicationContext(), data.optString("unRegisterLink")); |
| | | AdUtil.saveAdConfig(getApplicationContext(), ad); |
| | | MyApplication.initAd(MyApplication.application, new MyApplication.InitListener() { |
| | | @Override |
| | | public void onFinish() { |
| | | runOnUiThread(new Runnable() { |
| | | public void run() { |
| | | HttpApiUtil.getConfig(getApplicationContext(), new BasicTextHttpResponseHandler() { |
| | | |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject != null) { |
| | | if (jsonObject.getInt("code") == 0) { |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | JSONObject ad = data.optJSONObject("ad"); |
| | | for (Iterator<String> its = data.keys(); its.hasNext(); ) { |
| | | String key = its.next(); |
| | | AppConfigUtil.ConfigKey configKey = null; |
| | | try { |
| | | configKey = AppConfigUtil.ConfigKey.valueOf(key); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | if (configKey != null) { |
| | | //保存配置文件 |
| | | AppConfigUtil.saveConfig(configKey, data.optString(configKey.name()), getApplicationContext()); |
| | | } |
| | | } |
| | | //保存广告配置 |
| | | AdUtil.saveAdConfig(getApplicationContext(), ad); |
| | | MyApplication.initAd(MyApplication.application, new MyApplication.InitListener() { |
| | | @Override |
| | | public void run() { |
| | | loadSplashAd(); |
| | | public void onFinish() { |
| | | runOnUiThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | loadSplashAd(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | return; |
| | | } else { |
| | | loadSplashAd(); |
| | | } |
| | | }); |
| | | return; |
| | | } else { |
| | | loadSplashAd(); |
| | | } |
| | | } |
| | | } |
| | | loadSplashAd(); |
| | | |
| | | |
| | | @Override |
| | | public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) { |
| | | super.onFailure(statusCode, headers, responseString, throwable); |
| | | loadSplashAd(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) { |
| | | super.onFailure(statusCode, headers, responseString, throwable); |
| | | loadSplashAd(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | }, delayMs); |
| | | } |
| | | }, delayMs); |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | private void loadSplashAd() { |
| | | |
| | | AdUtil.AD_TYPE splashType = AdUtil.getAdType(getApplicationContext(), ""); |
| | | AdUtil.AD_TYPE splashType = AdUtil.getAdType(getApplicationContext(), "splashAd"); |
| | | if (splashType == null) { |
| | | vg_ad.postDelayed(new Runnable() { |
| | | @Override |