| | |
| | | package com.weikou.beibeivideo.ui; |
| | | |
| | | import android.Manifest; |
| | | import android.app.Activity; |
| | | import android.app.AlertDialog; |
| | | import android.app.Dialog; |
| | | import android.content.Context; |
| | |
| | | |
| | | import androidx.core.app.ActivityCompat; |
| | | import androidx.core.content.ContextCompat; |
| | | import androidx.fragment.app.FragmentActivity; |
| | | |
| | | import android.telephony.TelephonyManager; |
| | | import android.view.KeyEvent; |
| | |
| | | import static android.content.pm.PackageManager.PERMISSION_DENIED; |
| | | import static android.content.pm.PackageManager.PERMISSION_GRANTED; |
| | | |
| | | public class SplashActivity extends BaseActivity { |
| | | public class SplashActivity extends FragmentActivity { |
| | | |
| | | boolean isInput = false; |
| | | |
| | |
| | | @Override |
| | | public void onClick(DialogInterface dialogInterface, int i) { |
| | | dialogInterface.dismiss(); |
| | | try { |
| | | TelephonyManager manager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); |
| | | Build bd = new Build(); |
| | | String model = bd.MODEL; |
| | | BeibeiVideoApplication.deviceName = model; |
| | | BeibeiVideoApplication.deviceNumber = manager.getDeviceId(); |
| | | } catch (Exception e) { |
| | | } |
| | | //初始化 |
| | | BeibeiVideoApplication.init(BeibeiVideoApplication.application); |
| | | myRequetPermission(); |
| | | } |
| | | }).create().show(); |
| | |
| | | } |
| | | |
| | | } else { |
| | | try { |
| | | TelephonyManager manager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); |
| | | Build bd = new Build(); |
| | | String model = bd.MODEL; |
| | | BeibeiVideoApplication.deviceName = model; |
| | | BeibeiVideoApplication.deviceNumber = manager.getDeviceId(); |
| | | } catch (Exception e) { |
| | | } |
| | | //请求权限 |
| | | vg_ad.post(new Runnable() { |
| | | @Override |
| | |
| | | |
| | | |
| | | BeibeiVideoAPI.getUid(this, channel, BeibeiVideoAPI.getDeviceId(this), preferences.getString("imei", ""), |
| | | preferences.getString("mac", ""), "", "", |
| | | "", "", |
| | | new BasicTextHttpResponseHandler() { |
| | | |
| | | @Override |
| | |
| | | //是否需要再次请求权限 |
| | | if (sharedPreferences.getBoolean("show", true)) |
| | | ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_CODE); |
| | | else |
| | | else { |
| | | next(); |
| | | } |
| | | } else { |
| | | next(); |
| | | } |
| | |
| | | private void next() { |
| | | //百度内容联盟 |
| | | // MobadsPermissionSettings.setPermissionReadDeviceID(true); |
| | | if (!BeibeiVideoApplication.IsInited()) { |
| | | BeibeiVideoApplication.init(BeibeiVideoApplication.application); |
| | | } |
| | | getUid(); |
| | | vg_ad.postDelayed(new Runnable() { |
| | | |