|
|
|
@ -1,12 +1,17 @@ |
|
|
|
package qianmu.container.util; |
|
|
|
|
|
|
|
import android.app.smdt.SmdtManagerNew; |
|
|
|
import android.content.ComponentName; |
|
|
|
import android.content.Context; |
|
|
|
import android.content.Intent; |
|
|
|
import android.graphics.Bitmap; |
|
|
|
import android.net.Uri; |
|
|
|
import android.os.Build; |
|
|
|
import android.os.RemoteException; |
|
|
|
import android.os.signwaymanager.SignwayManager; |
|
|
|
import android.util.Log; |
|
|
|
import android.os.Build.VERSION; |
|
|
|
import androidx.core.content.FileProvider; |
|
|
|
|
|
|
|
import com.sdkapi.api.SdkApi; |
|
|
|
import com.sdkapi.common.ResultCallback; |
|
|
|
@ -60,6 +65,9 @@ public class SignWayUtil { |
|
|
|
}else if(Constant.androidBoardType.equals("huidu")){ |
|
|
|
HuiduTech helper = new HuiduTech(MyApplication.getInstance()); |
|
|
|
helper.shutdown(); |
|
|
|
}else if(Constant.androidBoardType.equals("ctf")){ |
|
|
|
Intent intent = new Intent("android.intent.action.shutdown"); |
|
|
|
MyApplication.getInstance().sendBroadcast(intent); |
|
|
|
} |
|
|
|
} catch (Throwable t) { |
|
|
|
LoggerUtil.e("shutDown", StringUtil.getThrowableStr(t)); |
|
|
|
@ -97,6 +105,9 @@ public class SignWayUtil { |
|
|
|
}else if(Constant.androidBoardType.equals("huidu")){ |
|
|
|
HuiduTech helper = new HuiduTech(MyApplication.getInstance()); |
|
|
|
helper.reboot(); |
|
|
|
}else if(Constant.androidBoardType.equals("ctf")){ |
|
|
|
Intent intent = new Intent("android.intent.action.reboot"); |
|
|
|
MyApplication.getInstance().sendBroadcast(intent); |
|
|
|
} |
|
|
|
} catch (Throwable t) { |
|
|
|
LoggerUtil.e("reboot", StringUtil.getThrowableStr(t)); |
|
|
|
@ -150,6 +161,12 @@ public class SignWayUtil { |
|
|
|
HuiduTech helper = new HuiduTech(MyApplication.getInstance()); |
|
|
|
helper.install(path); |
|
|
|
//helper.installAndStart(path,"qianmu.container","qianmu.container.activity.H5.UpdateFileActivity");
|
|
|
|
}else if(Constant.androidBoardType.equals("ctf")){ |
|
|
|
Intent intent = new Intent("android.intent.action.apkinstall"); |
|
|
|
intent.putExtra("path", path); |
|
|
|
intent.putExtra("commit_start", true); |
|
|
|
intent.putExtra("auto_start", true); |
|
|
|
MyApplication.getInstance().sendBroadcast(intent); |
|
|
|
} |
|
|
|
} catch (Throwable t) { |
|
|
|
LoggerUtil.e("silentInstallApk", StringUtil.getThrowableStr(t)); |
|
|
|
@ -305,6 +322,10 @@ public class SignWayUtil { |
|
|
|
}catch(Exception exp){ |
|
|
|
LoggerUtil.e("screenShot",exp.getMessage()); |
|
|
|
} |
|
|
|
}else if(Constant.androidBoardType.equals("ctf")){ |
|
|
|
Intent intent = new Intent("android.intent.action.screenshoot"); |
|
|
|
intent.putExtra("path", path); |
|
|
|
MyApplication.getInstance().sendBroadcast(intent); |
|
|
|
} |
|
|
|
} catch (Throwable t) { |
|
|
|
LoggerUtil.e("takeScreenshot", StringUtil.getThrowableStr(t)); |
|
|
|
@ -368,6 +389,14 @@ public class SignWayUtil { |
|
|
|
HuiduTech helper = new HuiduTech(MyApplication.getInstance()); |
|
|
|
helper.showNavigationBar(type); |
|
|
|
helper.showStatusBar(type); |
|
|
|
}else if(Constant.androidBoardType.equals("ctf")){ |
|
|
|
Intent intent; |
|
|
|
if (!type) { |
|
|
|
intent = new Intent("rk.android.remove_navigationbar"); |
|
|
|
} else { |
|
|
|
intent = new Intent("rk.android.add_navigationbar"); |
|
|
|
} |
|
|
|
MyApplication.getInstance().sendBroadcast(intent); |
|
|
|
} |
|
|
|
|
|
|
|
} catch (Throwable t) { |
|
|
|
@ -496,6 +525,8 @@ public class SignWayUtil { |
|
|
|
return "视美泰-"+Build.MODEL+",Android"+getAndroidVersion(); |
|
|
|
}else if(Constant.androidBoardType.equals("huidu")){ |
|
|
|
return "灰度"+Build.MODEL+",Android"+getAndroidVersion(); |
|
|
|
}else if(Constant.androidBoardType.equals("ctf")){ |
|
|
|
return "创泰丰"+Build.MODEL+",Android"+getAndroidVersion(); |
|
|
|
}else { |
|
|
|
return Build.MODEL+",Android"+getAndroidVersion(); |
|
|
|
} |
|
|
|
@ -578,6 +609,12 @@ public class SignWayUtil { |
|
|
|
}else if(Constant.androidBoardType.equals("huidu")){ |
|
|
|
HuiduTech helper = new HuiduTech(MyApplication.getInstance()); |
|
|
|
helper.setSystemTime(date.getTime()); |
|
|
|
}else if(Constant.androidBoardType.equals("ctf")){ |
|
|
|
Intent intent = new Intent("android.intent.action.settime"); |
|
|
|
int[] timeArray = {Integer.parseInt(timesplit[0]),Integer.parseInt(timesplit[1]),Integer.parseInt(timesplit[2]),Integer.parseInt(timesplit[3]),Integer.parseInt(timesplit[4]),Integer.parseInt(timesplit[5])}; |
|
|
|
intent.putExtra("settime",timeArray); |
|
|
|
intent.putExtra("enable" ,true); |
|
|
|
MyApplication.getInstance().sendBroadcast(intent); |
|
|
|
} |
|
|
|
}catch (Exception e){ |
|
|
|
LoggerUtil.e("setDeviceTime:","无法设置系统时间"+e.getMessage()); |
|
|
|
|