-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6281808
commit d7dbf39
Showing
523 changed files
with
2,078,943 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
app/src/main/java/com/bytedance/tiktok/application/MyExceptionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package com.bytedance.tiktok.application; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* create by apple | ||
* create on 2021/5/28 | ||
* description | ||
*/ | ||
class MyExceptionHandler implements Thread.UncaughtExceptionHandler { | ||
|
||
@Override | ||
public void uncaughtException(@NonNull Thread t, @NonNull Throwable e) { | ||
File file = dealException(thread, throwable); | ||
//上传服务器 | ||
|
||
} | ||
|
||
/*** 导出异常信息到SD卡 ** @param e */ | ||
private File dealException(Thread thread, Throwable throwable) { | ||
String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); | ||
File crashFolder = new File(mContext.getExternalCacheDir().getAbsoluteFile(), CrashMonitor.DEFAULT_JAVA_CRASH_FOLDER_NAME); | ||
if (!crashFolder.exists()) { | ||
crashFolder.mkdirs(); | ||
} | ||
File crashFile = new File(crashFolder, time + FILE_NAME_SUFFIX); | ||
try { | ||
// 往文件中写入数据 | ||
PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(crashFile))); | ||
pw.println(time); | ||
pw.println(thread); | ||
pw.println(getPhoneInfo()); | ||
throwable.printStackTrace(pw); //将异常信息堆栈写入文件 | ||
// 写入crash堆栈 | ||
pw.close(); | ||
} catch (IOException ex) { | ||
ex.printStackTrace(); | ||
} | ||
return crashFile; | ||
} | ||
|
||
private String getPhoneInfo() { | ||
PackageManager pm = mContext.getPackageManager(); | ||
PackageInfo pi = null; | ||
StringBuilder sb = new StringBuilder(); | ||
|
||
try { | ||
pi = pm.getPackageInfo(mContext.getPackageName(), PackageManager.GET_ACTIVITIES); | ||
|
||
// App版本 | ||
sb.append("App Version: "); | ||
sb.append(pi.versionName); | ||
sb.append("_"); | ||
sb.append(pi.versionCode + "\n"); | ||
} catch (PackageManager.NameNotFoundException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
// Android版本号 | ||
sb.append("OS Version: "); | ||
sb.append(Build.VERSION.RELEASE); | ||
sb.append("_"); | ||
sb.append(Build.VERSION.SDK_INT + "\n"); | ||
|
||
// 手机制造商 | ||
sb.append("Vendor: "); | ||
sb.append(Build.MANUFACTURER + "\n"); | ||
|
||
// 手机型号 | ||
sb.append("Model: "); | ||
sb.append(Build.MODEL + "\n"); | ||
|
||
// CPU架构 | ||
sb.append("CPU: "); | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | ||
sb.append(Arrays.toString(Build.SUPPORTED_ABIS)); | ||
} else { | ||
sb.append(Build.CPU_ABI); | ||
} | ||
return sb.toString(); | ||
} | ||
} |
160 changes: 160 additions & 0 deletions
160
app/src/main/java/com/bytedance/tiktok/base/AppBlockCanaryContext.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
package com.bytedance.tiktok.base | ||
|
||
import android.content.Context | ||
import com.github.moduth.blockcanary.BlockCanaryContext | ||
import com.github.moduth.blockcanary.internal.BlockInfo | ||
import java.io.File | ||
import java.util.* | ||
|
||
/** | ||
* create by apple | ||
* create on 2021/5/28 | ||
* description BlockCanary监测卡顿方案 | ||
*/ | ||
class AppBlockCanaryContext : BlockCanaryContext() { | ||
|
||
/** | ||
* Implement in your project. | ||
* | ||
* @return Qualifier which can specify this installation, like version + flavor. | ||
*/ | ||
override fun provideQualifier(): String? { | ||
return "unknown" | ||
} | ||
|
||
/** | ||
* Implement in your project. | ||
* | ||
* @return user id | ||
*/ | ||
override fun provideUid(): String? { | ||
return "uid" | ||
} | ||
|
||
/** | ||
* Network type | ||
* | ||
* @return [String] like 2G, 3G, 4G, wifi, etc. | ||
*/ | ||
override fun provideNetworkType(): String? { | ||
return "unknown" | ||
} | ||
|
||
/** | ||
* Config monitor duration, after this time BlockCanary will stop, use | ||
* with `BlockCanary`'s isMonitorDurationEnd | ||
* | ||
* @return monitor last duration (in hour) | ||
*/ | ||
override fun provideMonitorDuration(): Int { | ||
return -1 | ||
} | ||
|
||
/** | ||
* config block threshold (in millis), dispatch over this duration is regarded as a block. you may set it | ||
* from performance of device. | ||
* | ||
* @return threshold in mills | ||
*/ | ||
override fun provideBlockThreshold(): Int { | ||
return 1000 | ||
} | ||
|
||
/** | ||
* Thread stack dump interval, use when block happens, BlockCanary will dump on main thread | ||
* stack according to current sample cycle. | ||
* | ||
* | ||
* Because the implementation mechanism of Looper, real dump interval would be longer than | ||
* the period specified here (especially when cpu is busier). | ||
* | ||
* | ||
* @return dump interval (in millis) | ||
*/ | ||
override fun provideDumpInterval(): Int { | ||
return provideBlockThreshold() | ||
} | ||
|
||
/** | ||
* Path to save log, like "/blockcanary/", will save to sdcard if can. | ||
* | ||
* @return path of log files | ||
*/ | ||
override fun providePath(): String? { | ||
return "/blockcanary/" | ||
} | ||
|
||
/** | ||
* If need notification to notice block. | ||
* | ||
* @return true if need, else if not need. | ||
*/ | ||
override fun displayNotification(): Boolean { | ||
return true | ||
} | ||
|
||
/** | ||
* Implement in your project, bundle files into a zip file. | ||
* | ||
* @param src files before compress | ||
* @param dest files compressed | ||
* @return true if compression is successful | ||
*/ | ||
override fun zip(src: Array<File?>?, dest: File?): Boolean { | ||
return false | ||
} | ||
|
||
/** | ||
* Implement in your project, bundled log files. | ||
* | ||
* @param zippedFile zipped file | ||
*/ | ||
override fun upload(zippedFile: File?) { | ||
throw UnsupportedOperationException() | ||
} | ||
|
||
|
||
/** | ||
* Packages that developer concern, by default it uses process name, | ||
* put high priority one in pre-order. | ||
* | ||
* @return null if simply concern only package with process name. | ||
*/ | ||
override fun concernPackages(): List<String?>? { | ||
return null | ||
} | ||
|
||
/** | ||
* Filter stack without any in concern package, used with @{code concernPackages}. | ||
* | ||
* @return true if filter, false it not. | ||
*/ | ||
override fun filterNonConcernStack(): Boolean { | ||
return false | ||
} | ||
|
||
/** | ||
* Provide white list, entry in white list will not be shown in ui list. | ||
* | ||
* @return return null if you don't need white-list filter. | ||
*/ | ||
override fun provideWhiteList(): List<String?>? { | ||
val whiteList: LinkedList<String?> = LinkedList() | ||
whiteList.add("org.chromium") | ||
return whiteList | ||
} | ||
|
||
/** | ||
* Whether to delete files whose stack is in white list, used with white-list. | ||
* | ||
* @return true if delete, false it not. | ||
*/ | ||
override fun deleteFilesInWhiteList(): Boolean { | ||
return true | ||
} | ||
|
||
/** | ||
* Block interceptor, developer may provide their own actions. | ||
*/ | ||
override fun onBlock(context: Context?, blockInfo: BlockInfo?) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/bytedance/tiktok/utils/AnrFileObserver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.bytedance.tiktok.utils; | ||
|
||
import android.os.FileObserver; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* create by apple | ||
* create on 2021/5/28 | ||
* description | ||
*/ | ||
class AnrFileObserver extends FileObserver { | ||
|
||
public AnrFileObserver(String path) { | ||
super(path); | ||
} | ||
|
||
public AnrFileObserver(@NonNull File file) { | ||
super(file); | ||
} | ||
|
||
@Override | ||
public void onEvent(int event, @Nullable String path) { | ||
switch (event) { | ||
case FileObserver.ACCESS: | ||
|
||
break; | ||
case FileObserver.CREATE: | ||
|
||
break; | ||
case FileObserver.MODIFY: | ||
|
||
break; | ||
} | ||
} | ||
} |
Binary file not shown.
1 change: 1 addition & 0 deletions
1
bugreport-PD1916-RP1A.200720.012-2021-05-28-12-02-08/FS/cache/recovery/last_EngTestList
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
btb_vibrate_test;btb_fall_test;motor;linear_motor;linear_motor_life_test;charge_test;light_sensor_angle;lcm_three_base_color;lcm_watermark_test;camera_front_main_test;camera_rear_main_test;camera_pdaf;camera_rear_rtb_test;camera_rear_wide_test;camera_rear_wide_micro_distance_test;camera_rear_wide_near_focus_test;cool_light;calibrations_test;sim1_btb_test;sim2_btb_test;dark_light_sensor;bright_light_sensor;gsensor;gyroscope;infrared;electronic_compass;bad_screen;hand_write;back_light_setting;wakeup;lcm_noise;music;simulate_call;hifi;sound_recoder;electric_sound;main_echo;sub_echo;video_recoder;film;back_camera_sub_leak;card_slot;siminout_test;otg_test;udfp_calibration;udfp_spi;udfp_snr;electric_torch_test;sidekey_self_check;sidekey_test_right;button;cool_light;nfc_uicc_check;nfc_cplc_check;nfc_test;AI_test;b_double_camera;go_back_home;debug_log_switch;Quick_sampling;diag_socket;diag_socket_5g;volt_current;ps_wave_test;als_wave_test;gravity_direction_test;lcm_verify_test;lcm_display_mode_test;otp_data;camera_material_code;items_analyze;items_after_sale;open_camera_eeprom_permission;close_camera_eeprom_permission; |
10 changes: 10 additions & 0 deletions
10
bugreport-PD1916-RP1A.200720.012-2021-05-28-12-02-08/FS/cache/recovery/last_at_socket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# | ||
#Tue Jul 02 08:10:02 GMT+08:00 2019 | ||
atcid_socket=0 | ||
connected_timeout=600 | ||
ssid_list="SoftAP" | ||
wifi_level="SoftAP,-35,0" | ||
light_value="SoftAP,0,30" | ||
infrared_value="SoftAP,0,8000" | ||
gsensor_value="SoftAP,-200,200,-200,200,-2000,2000" | ||
qrcode_enable=0 |
Oops, something went wrong.