(
+ themeResId = R.style.Sentinel_Theme_Dialog
+ )
+
+ onView(withId(R.id.applicationIconView)).check(matches(isDisplayed()))
+ onView(withId(R.id.fab)).check(matches(isDisplayed()))
+ onView(withId(R.id.bottomNavigation)).check(matches(isDisplayed()))
+ onView(withId(R.id.fragmentContainer)).check(matches(isDisplayed()))
onView(withId(R.id.toolbar)).check(matches(isDisplayed()))
+
onView(
allOf(
- withText(R.string.sentinel_permissions),
- withParent(instanceOf(MaterialToolbar::class.java))
+ withId(R.id.permissions),
+ isDescendantOfA(withId(R.id.bottomNavigation))
)
- ).check(matches(withParent(withId(R.id.toolbar))))
+ ).perform(click())
scenario.onFragment {
val childFragment = it.childFragmentManager.findFragmentByTag(PermissionsFragment.TAG)
assertNotNull(childFragment)
}
+ onView(withId(R.id.toolbar)).check(matches(isDisplayed()))
}
@Test
@@ -231,23 +218,16 @@ public class SentinelFragmentTests {
onView(
allOf(
withId(R.id.preferences),
- withParent(instanceOf(ActionMenuView::class.java))
+ isDescendantOfA(withId(R.id.bottomNavigation))
)
).perform(lenientClick())
- onView(withId(R.id.toolbar)).check(matches(isDisplayed()))
- onView(
- allOf(
- withText(R.string.sentinel_preferences),
- withParent(instanceOf(MaterialToolbar::class.java))
- )
- ).check(matches(withParent(withId(R.id.toolbar))))
-
scenario.onFragment {
val childFragment = it.childFragmentManager.findFragmentByTag(PreferencesFragment.TAG)
assertNotNull(childFragment)
}
+ onView(withId(R.id.toolbar)).check(matches(isDisplayed()))
}
@Test
@@ -268,19 +248,12 @@ public class SentinelFragmentTests {
)
).perform(click())
- onView(withId(R.id.toolbar)).check(matches(isDisplayed()))
- onView(
- allOf(
- withText(R.string.sentinel_tools),
- withParent(instanceOf(MaterialToolbar::class.java))
- )
- ).check(matches(withParent(withId(R.id.toolbar))))
-
scenario.onFragment {
val childFragment = it.childFragmentManager.findFragmentByTag(ToolsFragment.TAG)
assertNotNull(childFragment)
}
+ onView(withId(R.id.toolbar)).check(matches(isDisplayed()))
}
@Test
diff --git a/sentinel/src/androidTest/resources/expected_html.html b/sentinel/src/androidTest/resources/expected_html.html
index 70b421b2..ca6727e0 100644
--- a/sentinel/src/androidTest/resources/expected_html.html
+++ b/sentinel/src/androidTest/resources/expected_html.html
@@ -6,16 +6,23 @@ application
first_install: yyyy-MM-dd HH:mm:ss
last_update: yyyy-MM-dd HH:mm:ss
min_sdk: 21
-target_sdk: 29
+target_sdk: 34
package_name: com.infinum.sentinel.test
process_name: com.infinum.sentinel.test
task_affinity: com.infinum.sentinel.test
locale_language: en
locale_country: US
+installer:
permissions
+- android.permission.POST_NOTIFICATIONS: false
+- android.permission.WAKE_LOCK: true
+- android.permission.ACCESS_NETWORK_STATE: true
+- android.permission.RECEIVE_BOOT_COMPLETED: true
+- android.permission.FOREGROUND_SERVICE: true
- android.permission.REORDER_TASKS: true
+- com.infinum.sentinel.test.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION: true
device
@@ -31,6 +38,14 @@ device
sdk: 29
security_patch: 2019-09-05
emulator: true
+automatic_time: true
+automatic_timezone: true
+rooted: false
+screen_width:
+screen_height:
+screen_size:
+screen_density:
+font_scale:
preferences
com.infinum.sentinel.test_preferences
diff --git a/sentinel/src/androidTest/resources/expected_html_no_preferences.html b/sentinel/src/androidTest/resources/expected_html_no_preferences.html
index df34067c..e89ea163 100644
--- a/sentinel/src/androidTest/resources/expected_html_no_preferences.html
+++ b/sentinel/src/androidTest/resources/expected_html_no_preferences.html
@@ -6,16 +6,23 @@ application
first_install: yyyy-MM-dd HH:mm:ss
last_update: yyyy-MM-dd HH:mm:ss
min_sdk: 21
-target_sdk: 29
+target_sdk: 34
package_name: com.infinum.sentinel.test
process_name: com.infinum.sentinel.test
task_affinity: com.infinum.sentinel.test
locale_language: en
locale_country: US
+installer:
permissions
+- android.permission.POST_NOTIFICATIONS: false
+- android.permission.WAKE_LOCK: true
+- android.permission.ACCESS_NETWORK_STATE: true
+- android.permission.RECEIVE_BOOT_COMPLETED: true
+- android.permission.FOREGROUND_SERVICE: true
- android.permission.REORDER_TASKS: true
+- com.infinum.sentinel.test.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION: true
device
@@ -31,6 +38,14 @@ device
sdk: 29
security_patch: 2019-09-05
emulator: true
+automatic_time: true
+automatic_timezone: true
+rooted: false
+screen_width:
+screen_height:
+screen_size:
+screen_density:
+font_scale:
preferences
diff --git a/sentinel/src/androidTest/resources/expected_json.json b/sentinel/src/androidTest/resources/expected_json.json
index 54443eec..c7eb8f9f 100644
--- a/sentinel/src/androidTest/resources/expected_json.json
+++ b/sentinel/src/androidTest/resources/expected_json.json
@@ -5,17 +5,42 @@
"first_install": "yyyy-MM-dd HH:mm:ss",
"last_update": "yyyy-MM-dd HH:mm:ss",
"min_sdk": "21",
- "target_sdk": "29",
+ "target_sdk": "34",
"package_name": "com.infinum.sentinel.test",
"process_name": "com.infinum.sentinel.test",
"task_affinity": "com.infinum.sentinel.test",
"locale_language": "en",
- "locale_country": "US"
+ "locale_country": "US",
+ "installer": ""
},
"permissions": [
+ {
+ "name": "android.permission.POST_NOTIFICATIONS",
+ "status": "false"
+ },
+ {
+ "name": "android.permission.WAKE_LOCK",
+ "status": "true"
+ },
+ {
+ "name": "android.permission.ACCESS_NETWORK_STATE",
+ "status": "true"
+ },
+ {
+ "name": "android.permission.RECEIVE_BOOT_COMPLETED",
+ "status": "true"
+ },
+ {
+ "name": "android.permission.FOREGROUND_SERVICE",
+ "status": "true"
+ },
{
"name": "android.permission.REORDER_TASKS",
"status": "true"
+ },
+ {
+ "name": "com.infinum.sentinel.test.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION",
+ "status": "true"
}
],
"device": {
@@ -30,7 +55,15 @@
"release": "10",
"sdk": "29",
"security_patch": "2019-09-05",
- "emulator": true
+ "emulator": true,
+ "automatic_time": true,
+ "automatic_timezone": true,
+ "rooted": false,
+ "screen_width": "",
+ "screen_height": "",
+ "screen_size": "",
+ "screen_density": "",
+ "font_scale": ""
},
"preferences": [
{
diff --git a/sentinel/src/androidTest/resources/expected_json_no_preferences.json b/sentinel/src/androidTest/resources/expected_json_no_preferences.json
index 82b1fdb7..3e7c41b8 100644
--- a/sentinel/src/androidTest/resources/expected_json_no_preferences.json
+++ b/sentinel/src/androidTest/resources/expected_json_no_preferences.json
@@ -5,17 +5,42 @@
"first_install": "yyyy-MM-dd HH:mm:ss",
"last_update": "yyyy-MM-dd HH:mm:ss",
"min_sdk": "21",
- "target_sdk": "29",
+ "target_sdk": "34",
"package_name": "com.infinum.sentinel.test",
"process_name": "com.infinum.sentinel.test",
"task_affinity": "com.infinum.sentinel.test",
"locale_language": "en",
- "locale_country": "US"
+ "locale_country": "US",
+ "installer": ""
},
"permissions": [
+ {
+ "name": "android.permission.POST_NOTIFICATIONS",
+ "status": "false"
+ },
+ {
+ "name": "android.permission.WAKE_LOCK",
+ "status": "true"
+ },
+ {
+ "name": "android.permission.ACCESS_NETWORK_STATE",
+ "status": "true"
+ },
+ {
+ "name": "android.permission.RECEIVE_BOOT_COMPLETED",
+ "status": "true"
+ },
+ {
+ "name": "android.permission.FOREGROUND_SERVICE",
+ "status": "true"
+ },
{
"name": "android.permission.REORDER_TASKS",
"status": "true"
+ },
+ {
+ "name": "com.infinum.sentinel.test.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION",
+ "status": "true"
}
],
"device": {
@@ -30,7 +55,15 @@
"release": "10",
"sdk": "29",
"security_patch": "2019-09-05",
- "emulator": true
+ "emulator": true,
+ "automatic_time": true,
+ "automatic_timezone": true,
+ "rooted": false,
+ "screen_width": "",
+ "screen_height": "",
+ "screen_size": "",
+ "screen_density": "",
+ "font_scale": ""
},
"preferences": []
}
\ No newline at end of file
diff --git a/sentinel/src/androidTest/resources/expected_markdown.md b/sentinel/src/androidTest/resources/expected_markdown.md
index e607cfdb..d6879df0 100644
--- a/sentinel/src/androidTest/resources/expected_markdown.md
+++ b/sentinel/src/androidTest/resources/expected_markdown.md
@@ -4,15 +4,22 @@ _version_name_: 1.0.0
_first_install_: yyyy-MM-dd HH:mm:ss
_last_update_: yyyy-MM-dd HH:mm:ss
_min_sdk_: 21
-_target_sdk_: 29
+_target_sdk_: 34
_package_name_: com.infinum.sentinel.test
_process_name_: com.infinum.sentinel.test
_task_affinity_: com.infinum.sentinel.test
_locale_language_: en
_locale_country_: US
+_installer_:
# permissions
+- _android.permission.POST_NOTIFICATIONS_: false
+- _android.permission.WAKE_LOCK_: true
+- _android.permission.ACCESS_NETWORK_STATE_: true
+- _android.permission.RECEIVE_BOOT_COMPLETED_: true
+- _android.permission.FOREGROUND_SERVICE_: true
- _android.permission.REORDER_TASKS_: true
+- _com.infinum.sentinel.test.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION_: true
# device
_manufacturer_: Google
@@ -27,6 +34,14 @@ _release_: 10
_sdk_: 29
_security_patch_: 2019-09-05
_emulator_: true
+_automatic_time_: true
+_automatic_timezone_: true
+_rooted_: false
+_screen_width_:
+_screen_height_:
+_screen_size_:
+_screen_density_:
+_font_scale_:
# preferences
## com.infinum.sentinel.test_preferences
diff --git a/sentinel/src/androidTest/resources/expected_markdown_no_preferences.md b/sentinel/src/androidTest/resources/expected_markdown_no_preferences.md
index 69c6a729..2e086b8d 100644
--- a/sentinel/src/androidTest/resources/expected_markdown_no_preferences.md
+++ b/sentinel/src/androidTest/resources/expected_markdown_no_preferences.md
@@ -4,15 +4,22 @@ _version_name_: 1.0.0
_first_install_: yyyy-MM-dd HH:mm:ss
_last_update_: yyyy-MM-dd HH:mm:ss
_min_sdk_: 21
-_target_sdk_: 29
+_target_sdk_: 34
_package_name_: com.infinum.sentinel.test
_process_name_: com.infinum.sentinel.test
_task_affinity_: com.infinum.sentinel.test
_locale_language_: en
_locale_country_: US
+_installer_:
# permissions
+- _android.permission.POST_NOTIFICATIONS_: false
+- _android.permission.WAKE_LOCK_: true
+- _android.permission.ACCESS_NETWORK_STATE_: true
+- _android.permission.RECEIVE_BOOT_COMPLETED_: true
+- _android.permission.FOREGROUND_SERVICE_: true
- _android.permission.REORDER_TASKS_: true
+- _com.infinum.sentinel.test.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION_: true
# device
_manufacturer_: Google
@@ -27,6 +34,14 @@ _release_: 10
_sdk_: 29
_security_patch_: 2019-09-05
_emulator_: true
+_automatic_time_: true
+_automatic_timezone_: true
+_rooted_: false
+_screen_width_:
+_screen_height_:
+_screen_size_:
+_screen_density_:
+_font_scale_:
# preferences
diff --git a/sentinel/src/androidTest/resources/expected_plain.txt b/sentinel/src/androidTest/resources/expected_plain.txt
index 687d05f3..5b7455a9 100644
--- a/sentinel/src/androidTest/resources/expected_plain.txt
+++ b/sentinel/src/androidTest/resources/expected_plain.txt
@@ -5,17 +5,24 @@ version_name: 1.0.0
first_install: yyyy-MM-dd HH:mm:ss
last_update: yyyy-MM-dd HH:mm:ss
min_sdk: 21
-target_sdk: 29
+target_sdk: 34
package_name: com.infinum.sentinel.test
process_name: com.infinum.sentinel.test
task_affinity: com.infinum.sentinel.test
locale_language: en
locale_country: US
+installer:
PERMISSIONS
-----------
+android.permission.POST_NOTIFICATIONS: false
+android.permission.WAKE_LOCK: true
+android.permission.ACCESS_NETWORK_STATE: true
+android.permission.RECEIVE_BOOT_COMPLETED: true
+android.permission.FOREGROUND_SERVICE: true
android.permission.REORDER_TASKS: true
+com.infinum.sentinel.test.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION: true
DEVICE
@@ -32,6 +39,14 @@ release: 10
sdk: 29
security_patch: 2019-09-05
emulator: true
+automatic_time: true
+automatic_timezone: true
+rooted: false
+screen_width:
+screen_height:
+screen_size:
+screen_density:
+font_scale:
PREFERENCES
diff --git a/sentinel/src/androidTest/resources/expected_plain_no_preferences.txt b/sentinel/src/androidTest/resources/expected_plain_no_preferences.txt
index dbc2f382..251b8dff 100644
--- a/sentinel/src/androidTest/resources/expected_plain_no_preferences.txt
+++ b/sentinel/src/androidTest/resources/expected_plain_no_preferences.txt
@@ -5,17 +5,24 @@ version_name: 1.0.0
first_install: yyyy-MM-dd HH:mm:ss
last_update: yyyy-MM-dd HH:mm:ss
min_sdk: 21
-target_sdk: 29
+target_sdk: 34
package_name: com.infinum.sentinel.test
process_name: com.infinum.sentinel.test
task_affinity: com.infinum.sentinel.test
locale_language: en
locale_country: US
+installer:
PERMISSIONS
-----------
+android.permission.POST_NOTIFICATIONS: false
+android.permission.WAKE_LOCK: true
+android.permission.ACCESS_NETWORK_STATE: true
+android.permission.RECEIVE_BOOT_COMPLETED: true
+android.permission.FOREGROUND_SERVICE: true
android.permission.REORDER_TASKS: true
+com.infinum.sentinel.test.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION: true
DEVICE
@@ -32,6 +39,14 @@ release: 10
sdk: 29
security_patch: 2019-09-05
emulator: true
+automatic_time: true
+automatic_timezone: true
+rooted: false
+screen_width:
+screen_height:
+screen_size:
+screen_density:
+font_scale:
PREFERENCES
diff --git a/sentinel/src/androidTest/resources/expected_xml.xml b/sentinel/src/androidTest/resources/expected_xml.xml
index 74cb459f..1a87e9e5 100644
--- a/sentinel/src/androidTest/resources/expected_xml.xml
+++ b/sentinel/src/androidTest/resources/expected_xml.xml
@@ -1 +1,65 @@
-1000001.0.0yyyy-MM-dd HH:mm:ssyyyy-MM-dd HH:mm:ss2129com.infinum.sentinel.testcom.infinum.sentinel.testcom.infinum.sentinel.testenUSGoogleAndroid SDK built for x86QSR1.190920.001unknowngeneric_x86goldfish_x86x86REL10292019-09-05true
\ No newline at end of file
+
+
+
+ 100000
+
+ 1.0.0
+ yyyy-MM-dd
+ HH:mm:ss
+
+ yyyy-MM-dd HH:mm:ss
+ 21
+ 34
+
+ com.infinum.sentinel.test
+ com.infinum.sentinel
+ .test
+
+ com.infinum.sentinel.test
+ en
+
+ US
+
+
+
+
+
+
+
+
+
+
+
+
+ Google
+ Android SDK built for x86
+ QSR1.190920.001
+ unknown
+ generic_x86
+ goldfish_x86
+ x86
+ REL
+ 10
+ 29
+ 2019-09-05
+ true
+ true
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sentinel/src/androidTest/resources/expected_xml_no_preferences.xml b/sentinel/src/androidTest/resources/expected_xml_no_preferences.xml
index 2d0e8d63..08462ad1 100644
--- a/sentinel/src/androidTest/resources/expected_xml_no_preferences.xml
+++ b/sentinel/src/androidTest/resources/expected_xml_no_preferences.xml
@@ -1 +1,56 @@
-1000001.0.0yyyy-MM-dd HH:mm:ssyyyy-MM-dd HH:mm:ss2129com.infinum.sentinel.testcom.infinum.sentinel.testcom.infinum.sentinel.testenUSGoogleAndroid SDK built for x86QSR1.190920.001unknowngeneric_x86goldfish_x86x86REL10292019-09-05true
\ No newline at end of file
+
+
+
+ 100000
+
+ 1.0.0
+ yyyy-MM-dd
+ HH:mm:ss
+
+ yyyy-MM-dd HH:mm:ss
+ 21
+ 34
+
+ com.infinum.sentinel.test
+ com.infinum.sentinel
+ .test
+
+ com.infinum.sentinel.test
+ en
+
+ US
+
+
+
+
+
+
+
+
+
+
+
+
+ Google
+ Android SDK built for x86
+ QSR1.190920.001
+ unknown
+ generic_x86
+ goldfish_x86
+ x86
+ REL
+ 10
+ 29
+ 2019-09-05
+ true
+ true
+ true
+ false
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sentinel/src/main/AndroidManifest.xml b/sentinel/src/main/AndroidManifest.xml
index 61a51446..22738cc9 100644
--- a/sentinel/src/main/AndroidManifest.xml
+++ b/sentinel/src/main/AndroidManifest.xml
@@ -10,7 +10,7 @@
() {
diff --git a/tool-timber/src/main/kotlin/com/infinum/sentinel/ui/shared/LogFileResolver.kt b/tool-timber/src/main/kotlin/com/infinum/sentinel/ui/shared/LogFileResolver.kt
index 80144b5d..a8d84a5c 100644
--- a/tool-timber/src/main/kotlin/com/infinum/sentinel/ui/shared/LogFileResolver.kt
+++ b/tool-timber/src/main/kotlin/com/infinum/sentinel/ui/shared/LogFileResolver.kt
@@ -14,7 +14,7 @@ internal class LogFileResolver(
private const val LOG_EXTENSION = ".log"
}
- private val parent = File("${context.filesDir.absolutePath}${LOGS_DIRECTORY}")
+ private val parent = File("${context.filesDir.absolutePath}$LOGS_DIRECTORY")
fun logsDir() = parent