Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into main_github
Browse files Browse the repository at this point in the history
  • Loading branch information
yulun committed Apr 22, 2022
2 parents c2edbbf + 2a24c20 commit ff5dabb
Show file tree
Hide file tree
Showing 5 changed files with 688 additions and 238 deletions.
33 changes: 33 additions & 0 deletions app/src/main/java/com/yl/lib/privacysentry/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,39 @@ class MainActivity : AppCompatActivity() {
startActivity(Intent(this, ContactActivity::class.java))
}


findViewById<Button>(R.id.btn_thread_cache).setOnClickListener {
for (index in 1..20) {
Thread(Thread.currentThread().threadGroup, object : Runnable {
override fun run() {
var result = PrivacyMethod.PrivacyMethod.getAndroidId(this@MainActivity)
PrivacyLog.e("btn_thread_cache result is $result")

PrivacyMethod.PrivacyMethod.getDeviceId(this@MainActivity)

PrivacyMethod.PrivacyMethod.getDeviceId1(this@MainActivity)

PrivacyMethod.PrivacyMethod.getICCID(this@MainActivity)

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
PrivacyMethod.PrivacyMethod.getIMEI(this@MainActivity)
}

PrivacyMethod.PrivacyMethod.getIMSI(this@MainActivity)

PrivacyMethod.PrivacyMethod.getMacRaw(this@MainActivity)

PrivacyMethod.PrivacyMethod.getMacV2()

PrivacyMethod.PrivacyMethod.getMeid(this@MainActivity)

PrivacyMethod.PrivacyMethod.getSerial()
}
}, "test_thread_$index", 0).start()
}
}


//Android Q开始,READ_PHONE_STATE 不再有用,不用全局弹框
var permissions = arrayOf(
Manifest.permission.READ_PHONE_STATE
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="结束当前检测-导出结果" />


<Button
android:id="@+id/btn_thread_cache"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="多线程缓存测试" />
</LinearLayout>

</ScrollView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ class PrivacyUtil {
val st = Thread.currentThread().stackTrace
val sbf = StringBuilder()
for (e in st) {
if (e.methodName.equals("getThreadStackTrace") || e.methodName.equals("getStackTrace")){
continue
}
if (e.className.contains("PrivacyProxy")){
continue
}
if (sbf.isNotEmpty()) {
sbf.append(" <- ")
sbf.append(System.getProperty("line.separator"))
Expand Down
Loading

0 comments on commit ff5dabb

Please sign in to comment.