Skip to content

Commit

Permalink
Merge pull request #181 from amosproj/dev
Browse files Browse the repository at this point in the history
merge sprint 09
  • Loading branch information
fhilgers authored Dec 18, 2024
2 parents 232e04c + 01dc51c commit f93682a
Show file tree
Hide file tree
Showing 50 changed files with 962 additions and 336 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Cargo test
run: |
cd rust
nix develop --command cargo test --workspace --all-targets --all-features --exclude backend-daemon
nix develop --command cargo test --workspace --all-targets --all-features --exclude client
rust-build:
name: Rust Build
Expand Down
Binary file added Deliverables/sprint-09/feature-board.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions Deliverables/sprint-09/feature-board.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Title URL Assignees Status Estimated size Real size
Integration Testing https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/165 Mr-Kanister In Progress 3
Uprobe Analysis: Finding Symbols from shared libraries https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/116 Mr-Kanister Awaiting Review 2 2
Ebpf: SIGQUIT https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/173 Awaiting Review 2
In memory testing https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/163 Sprint Backlog 2
Integration Testing 2 https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/166 Sprint Backlog 5
Mocking IO in userspace daemon https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/162 Sprint Backlog 3
Aggregate Data Points in Background for Efficient Processing https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/158 BenediktZinn, Mr-Kanister In Progress 2
UI: Search bar to filter out App/Process https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/141 Awaiting Review 2
Refactor: Collection of events in Daemon https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/123 fhilgers Feature Archive 2 5
Refactor: Configuration API https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/124 ffranzgitHub Feature Archive 2 2
Uprobe Analysis: Frontend Show Symbols https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/121 luca-dot-sh Feature Archive 2 3
Refactoring pIDs to uint32 https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/149 Mr-Kanister Feature Archive 2 1
Uprobe Analysis: Collect Uprobe events https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/119 BenediktZinn, Mr-Kanister Feature Archive 1 3
Uprobe Analysis: Finding Symbols from Dex/Oat https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/117 BenediktZinn, Mr-Kanister Feature Archive 5 8
Uprobe Analysis: Setup ebpf uprobes https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/118 der-whity Feature Archive 3 2
Uprobe Analysis: Config https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/120 der-whity, Mr-Kanister Feature Archive 2 2
Refactoring ebpf Programs https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/151 der-whity Feature Archive 1 1
EPIC: uprobe https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/19 In Progress 8
Uprobe Analysis: Frontend Show Uprobe Events https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/122 luca-dot-sh In Progress 2
Testing Ebpf Programs https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/161 In Progress 3
EPIC: Create a Databank in the Backend https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/155 fhilgers In Progress
Gradle refactoring https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/140 fhilgers Feature Archive 5
CI Rework https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/139 fhilgers Feature Archive 1
Uprobe Analysis: Setup https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/115 fhilgers Feature Archive 2 5
Define metric for the visualisation screen https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/46 luca-dot-sh Feature Archive 3 3
Refactoring: Frontend https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/130 luca-dot-sh Feature Archive 2 2
Unix Domain Socket: Ebpf https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/111 der-whity Feature Archive 2 2
Unix Domain Socket: Frontend https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/114 luca-dot-sh Feature Archive 3 3
Unix Domain Socket: Configuration https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/112 ffranzgitHub, Mr-Kanister Feature Archive 2 2
Unix Domain Socket: Daemon Collector https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/113 BenediktZinn, ffranzgitHub, fhilgers Feature Archive 2 2
Identify Running State https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/75 luca-dot-sh Feature Archive 3 2
Plaintext architecture document https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/34 fhilgers, Mr-Kanister Feature Archive 3 3
EPIC: analyze unix domain sockets https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/80 BenediktZinn, der-whity, ffranzgitHub, fhilgers, luca-dot-sh, Mr-Kanister Feature Archive 5 -1
internal: implement client library and export to kotlin for load and list programs https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/60 BenediktZinn, fhilgers Feature Archive 2 1
Display running processes in UI https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/73 luca-dot-sh Feature Archive 2 2
User eBPF programm Selection https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/41 ffranzgitHub, fhilgers, Mr-Kanister Feature Archive 5 -1
internal: define kotlin interface for frontend loading and listing programs https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/58 fhilgers Feature Archive 1 1
internal: implement loading/unloading of ebpf functions in daemon https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/77 der-whity, ffranzgitHub, Mr-Kanister Feature Archive 2 3
Retrieve running processes List https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/72 Mr-Kanister Feature Archive 3 3
Home Screen and Navigation Drawer https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/43 luca-dot-sh Feature Archive 2 3
EBPF Program extension https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/54 der-whity Feature Archive 3 3
Bugfix: Manage Sbom generation through nix https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/55 Mr-Kanister Feature Archive 1 1
Communcation between Android side and Rust side https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/42 fhilgers Feature Archive 5 5
scope(ebpf) unix domain socket traffic analysis (research) https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/22 fhilgers Feature Archive 5 3
Create a prototype for the visualisation screen https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/47 luca-dot-sh Feature Archive 3 3
internal: implement frontend load and list programs https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/62 luca-dot-sh Feature Archive 2 2
internal: implement test cli client load and list programs https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/59 BenediktZinn, ffranzgitHub, Mr-Kanister Feature Archive 3 2
Preparation of CI https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/6 fhilgers Feature Archive 3 3
scope(ui) find timeseries visualization library (research) https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/21 clabrous, luca-dot-sh Feature Archive 2 2
Generation of sboms doesn't include kotlin https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/39 Feature Archive 1 1
Manage Sbom generation through nix https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/30 Mr-Kanister Feature Archive 2 1
scope(daemon) get information about android processes to list/find/search them (research) https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/20 der-whity, ffranzgitHub Feature Archive 3 1
License and Copyright Agreement https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/18 fhilgers Feature Archive 2 2
Preperation of Kotlin https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/7 clabrous, luca-dot-sh Feature Archive 3 3
Docker Container https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/11 fhilgers Feature Archive 3 3
scope(build) aarch64 als target https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/23 fhilgers Feature Archive 1 1
scope(build) android 13 instead of 15 https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/24 fhilgers Feature Archive 1 1
Team Decision https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/8 BenediktZinn, clabrous, der-whity, ffranzgitHub, fhilgers, luca-dot-sh, Mr-Kanister Feature Archive 1 1
architecture document https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/10 fhilgers Feature Archive 3 5
bill of materials https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/9 BenediktZinn, der-whity, Mr-Kanister Feature Archive 3 3
Brain Storming Architecture https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/3 Feature Archive 3 1
Visualize JNI Reference Metrics https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/156 Product Backlog 3
Actor Refactor https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/164 Product Backlog 1
Daemon: SIGQUIT https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/174 Product Backlog
Frontend: SIGQUIT https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/176 Product Backlog
Collect information resulting from SIGQUIT calls https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/175 Product Backlog
Prototype for overlay mode https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/178 Product Backlog
Distinguish between System vs. User Applications https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/74 Product Backlog 3
UI Filter for System and User Applications https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/76 Product Backlog 2
Display Installed Applications in UI https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/25 Product Backlog -1
Brain Storming eBPF Use Cases https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/1 Product Backlog 2
Create kprobe to Track Blocking vfs_write Call https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/88 der-whity Feature Archive 3 3
Binary file added Deliverables/sprint-09/imp-squared-backlog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions Deliverables/sprint-09/imp-squared-backlog.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Title Assignees Status
Note: All of the Items have a more detailed description pls. click them to see. (this is not an item) Todo
Team: Assist in creating team processes (Sinatra Doctrine, this is ongoing) In Progress
Team: Completing Task Quicker (earlier PR) In Progress
Tech/Team: Deliverables In Progress
Team: Rotating the deliverable creation In Progress
Tech: Streamline testing proces In Progress
Tech: Establish more testing In Progress
Tech: Add a percentage of refactoring items to each sprint In Progress
Tech: Split Backlog Items (PR and Creation) Done
Team: Fixing a PO Dev meeting Done
Agile: Completing all items we set out Done
Team: IP contact Done
Tech: Repository coordination Done
Team: Load balancing inside the dev team Done
Team: Making sure all tasks in a sprint are being finished Done
Team collaboration (between dev and po) Done
Gain Independence from the IP Done
Lifting the collective mood Done
Creating a Template for backlog item suggestions by the IP Done
Solving dissatisfaction among the team Done
Focus on IP (and PO relations) Done
Ensuring that everyone has work to do Done
Backlog Item creation procedure Done
Helping Coordinate the team meeting Done
Helping to set up the first IP meeting Done
Supporting team in understanding the amos workflow (e.g importance of the team meeting) Done
Creating Sub-Teams to streamline development Done
Establishing a continuouse release cycle with the team Done
Improving time management in the Team meeting Done
Ensuring a continuous backlog items flow Done
Binary file added Deliverables/sprint-09/planning-documents.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@

package de.amosproj3.ziofa

import androidx.compose.ui.test.ExperimentalTestApi
import androidx.compose.ui.test.hasClickAction
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.compose.ui.test.onLast
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

Expand All @@ -17,11 +23,25 @@ import org.junit.runner.RunWith
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
class SmokeTestUI {

@get:Rule val composeTestRule = createAndroidComposeRule<MainActivity>()

@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("de.amosproj3.ziofa", appContext.packageName)
fun configurationSmokeTest() {
waitForAndClick("configuration")
waitForAndClick("per process")
clickAnyProcess()
}

private fun waitForAndClick(text: String) {
composeTestRule.onNodeWithText(text, ignoreCase = true).assertExists()
composeTestRule.onNodeWithText(text, ignoreCase = true).performClick()
}

@OptIn(ExperimentalTestApi::class)
private fun clickAnyProcess() {
composeTestRule.waitUntilAtLeastOneExists(hasClickAction(), 5000)
composeTestRule.onAllNodes(hasClickAction()).onLast().performClick()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface LocalConfigurationAccess {
* changed.
* @param sendMessageFeature A [SysSendmsgConfig] update to apply or null if this should not be
* changed.
* @param uprobesFeature TODO
* @param uprobesFeature The Uprobe config to apply or null if this should not be changed.
*/
fun changeFeatureConfiguration(
enable: Boolean,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// SPDX-FileCopyrightText: 2024 Luca Bretting <[email protected]>
//
// SPDX-License-Identifier: MIT

package de.amosproj3.ziofa.bl.configuration

import de.amosproj3.ziofa.client.JniReferencesConfig
import de.amosproj3.ziofa.client.SysSendmsgConfig
import de.amosproj3.ziofa.client.UprobeConfig
import de.amosproj3.ziofa.client.VfsWriteConfig

fun VfsWriteConfig?.updatePIDs(
pidsToAdd: Set<Map.Entry<UInt, ULong>> = setOf(),
pidsToRemove: Set<Map.Entry<UInt, ULong>> = setOf(),
): VfsWriteConfig {
val config = this ?: VfsWriteConfig(mapOf())
return config.copy(
entries =
config.entries.entries.plus(pidsToAdd).minus(pidsToRemove).associate {
it.key to it.value
}
)
}

fun SysSendmsgConfig?.updatePIDs(
pidsToAdd: Set<Map.Entry<UInt, ULong>> = setOf(),
pidsToRemove: Set<Map.Entry<UInt, ULong>> = setOf(),
): SysSendmsgConfig {
val config = this ?: SysSendmsgConfig(mapOf())
return config.copy(
entries =
config.entries.entries.plus(pidsToAdd).minus(pidsToRemove).associate {
it.key to it.value
}
)
}

fun List<UprobeConfig>?.updateUProbes(
pidsToAdd: List<UprobeConfig> = listOf(),
pidsToRemove: List<UprobeConfig> = listOf(),
): List<UprobeConfig> {
val config = this ?: listOf()
return config.minus(pidsToRemove.toSet()).plus(pidsToAdd).toSet().toList()
}

fun JniReferencesConfig?.updatePIDs(
pidsToAdd: List<UInt> = listOf(),
pidsToRemove: List<UInt> = listOf(),
): JniReferencesConfig {
val config = this ?: JniReferencesConfig(listOf())
return config.copy(pids = config.pids.plus(pidsToAdd).minus(pidsToRemove.toSet()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import de.amosproj3.ziofa.client.JniReferencesConfig
import de.amosproj3.ziofa.client.SysSendmsgConfig
import de.amosproj3.ziofa.client.UprobeConfig
import de.amosproj3.ziofa.client.VfsWriteConfig
import de.amosproj3.ziofa.ui.shared.updatePIDs
import de.amosproj3.ziofa.ui.shared.updateUProbes
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class UProbeManager(private val clientFactory: ClientFactory) : SymbolsAccess {
.onEach { Timber.i("Requesting symbols for odex file $it") }
.flatMapMerge { odexFile ->
client
.getSymbols(odexFilePath = odexFile)
.getSymbols(filePath = odexFile)
.filter {
it.method
.lowercase()
Expand Down
Loading

0 comments on commit f93682a

Please sign in to comment.