Skip to content

Commit

Permalink
Merge pull request #197 from amosproj/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
fhilgers authored Jan 8, 2025
2 parents f93682a + dcf9ffb commit 4efd9c7
Show file tree
Hide file tree
Showing 98 changed files with 1,829 additions and 916 deletions.
7 changes: 6 additions & 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 client
nix develop --command cargo test --workspace --all-targets --all-features --exclude client --exclude backend-ebpf-test
rust-build:
name: Rust Build
Expand Down Expand Up @@ -115,3 +115,8 @@ jobs:
--parallel \
--build-cache \
-Dorg.gradle.jvmargs=-Xmx4G
- name: Upload Detekt results to GitHub
uses: github/codeql-action/upload-sarif@v2
if: success() || failure()
with:
sarif_file: frontend/app/build/reports/detekt/detekt.sarif
Binary file added Deliverables/sprint-10/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.
76 changes: 76 additions & 0 deletions Deliverables/sprint-10/feature-board.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Title URL Assignees Status Estimated size Real size
Refactor: SIGQUIT https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/186 der-whity Awaiting Review 1
Daemon: config SIGQUIT https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/174 der-whity Awaiting Review 1
Collector: for information resulting from SIGQUIT calls https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/175 Mr-Kanister Awaiting Review 1
Frontend: SIGQUIT https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/176 luca-dot-sh Awaiting Review 2
Uprobe: Trace JNI symbols https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/182 Sprint Backlog 3
Uprobe: expand client library https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/183 Sprint Backlog 3
Prototype for overlay mode https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/178 luca-dot-sh In Progress 3
Visualize JNI Reference Metrics https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/156 luca-dot-sh Awaiting Review 3
Integration Testing 2 https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/166 fhilgers, Mr-Kanister Awaiting Review 5
In memory testing https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/163 ffranzgitHub, fhilgers Awaiting Review 2
Testing Ebpf Programs https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/161 fhilgers Awaiting Review 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
Integration Testing https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/165 Mr-Kanister Feature Archive 3 2
UI: Search bar to filter out App/Process https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/141 luca-dot-sh Feature Archive 2 2
Ebpf: SIGQUIT https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/173 der-whity Feature Archive 2 2
Uprobe Analysis: Finding Symbols from shared libraries https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/116 Mr-Kanister Feature Archive 2 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 Sprint Backlog 2
EPIC: Create a Databank in the Backend https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/155 fhilgers In Progress
Actor Refactor https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/164 In Progress 1
Mocking IO in userspace daemon https://github.com/amosproj/amos2024ws03-android-zero-instrumentation/issues/162 ffranzgitHub, fhilgers In Progress 3
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
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-10/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.
33 changes: 33 additions & 0 deletions Deliverables/sprint-10/imp-squared-backlog.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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: Get the team to get better with show and tell Todo
Team: increase resilance (hard to do) 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
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: Rotating the deliverable creation 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-10/planning-documents.pdf
Binary file not shown.
12 changes: 11 additions & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,14 @@ To automatically update all dependencies, run

### Format and check formatting
Format `./gradlew combinedFormat` <br/>
Check: `./gradlew ktfmtCheck`
Check: `./gradlew ktfmtCheck`

## Troubleshooting
### The frontend crashes
Make sure the backend is running or that you are running a mocked version.
If you are running a release, check for MethodNotFoundException etc., these errors are most likely
caused by R8/ProGuard removing used classes.
Quickfix: Use the debug build type.

### The backend and frontend crashes
Delete the local configuration to make sure it does not contain outdated entries.
23 changes: 22 additions & 1 deletion frontend/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
alias(libs.plugins.kotlin.android)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.org.cyclonedx.bom)
alias(libs.plugins.detekt)
}

android {
Expand Down Expand Up @@ -44,7 +45,7 @@ android {

buildTypes {
release {
isMinifyEnabled = false
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down Expand Up @@ -92,6 +93,11 @@ dependencies {
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
implementation(libs.accompanist.drawablepainter)
implementation(libs.flowredux.jvm)
implementation(libs.flowredux.compose)

implementation(libs.arrow.core)
implementation(libs.arrow.fx.coroutines)

implementation(project(":client"))

Expand All @@ -105,6 +111,9 @@ dependencies {
implementation(libs.vico.compose.m2)
implementation(libs.vico.compose.m3)
implementation(libs.vico.core)
implementation(libs.arrow.core)
implementation(libs.arrow.fx.coroutines)
detektPlugins(libs.detekt.compose.rules)
}

tasks.cyclonedxBom {
Expand All @@ -118,3 +127,15 @@ tasks.cyclonedxBom {
setIncludeLicenseText(true)
setIncludeMetadataResolution(true)
}

detekt {
config = files("detekt.yml")
buildUponDefaultConfig = true
parallel = true
ignoreFailures = true
}

tasks.detekt {
reports.xml.required.set(true)
reports.html.required.set(true)
}
55 changes: 55 additions & 0 deletions frontend/app/detekt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SPDX-FileCopyrightText: 2024 Luca Bretting <[email protected]>
#
# SPDX-License-Identifier: MIT

naming:
FunctionNaming:
active: true
ignoreAnnotated:
- Composable

TwitterCompose:
CompositionLocalAllowlist:
active: true
# You can optionally define a list of CompositionLocals that are allowed here
# allowedCompositionLocals: LocalSomething,LocalSomethingElse
CompositionLocalNaming:
active: true
ContentEmitterReturningValues:
active: true
# You can optionally add your own composables here
# contentEmitters: MyComposable,MyOtherComposable
ModifierComposable:
active: true
ModifierMissing:
active: true
ModifierReused:
active: true
ModifierWithoutDefault:
active: true
MultipleEmitters:
active: true
# You can optionally add your own composables here
# contentEmitters: MyComposable,MyOtherComposable
MutableParams:
active: true
ComposableNaming:
active: true
# You can optionally disable the checks in this rule for regex matches against the composable name (e.g. molecule presenters)
# allowedComposableFunctionNames: .*Presenter,.*MoleculePresenter
ComposableParamOrder:
active: true
PreviewNaming:
active: true
PreviewPublic:
active: true
# You can optionally disable that only previews with @PreviewParameter are flagged
# previewPublicOnlyIfParams: false
RememberMissing:
active: true
UnstableCollections:
active: true
ViewModelForwarding:
active: true
ViewModelInjection:
active: true
5 changes: 4 additions & 1 deletion frontend/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
-keep class com.sun.jna.** { *; }
-dontwarn java.awt.**
-keep class uniffi.** { *; }
17 changes: 5 additions & 12 deletions frontend/app/src/main/java/de/amosproj3/ziofa/ZiofaApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ package de.amosproj3.ziofa
import android.app.Application
import android.content.Context
import android.content.pm.PackageManager
import de.amosproj3.ziofa.api.configuration.BackendConfigurationAccess
import de.amosproj3.ziofa.api.configuration.LocalConfigurationAccess
import de.amosproj3.ziofa.api.configuration.ConfigurationAccess
import de.amosproj3.ziofa.api.configuration.SymbolsAccess
import de.amosproj3.ziofa.api.events.DataStreamProvider
import de.amosproj3.ziofa.api.processes.RunningComponentsAccess
Expand All @@ -31,7 +30,6 @@ import org.koin.core.context.startKoin
import org.koin.core.module.Module
import org.koin.core.module.dsl.viewModel
import org.koin.core.parameter.parametersOf
import org.koin.dsl.binds
import org.koin.dsl.module
import timber.log.Timber

Expand Down Expand Up @@ -64,27 +62,22 @@ class ZiofaApplication : Application() {
single<RunningComponentsAccess> {
RunningComponentsProvider(clientFactory = get(), packageInformationProvider = get())
}
single { ConfigurationManager(clientFactory = get()) } binds
arrayOf(BackendConfigurationAccess::class, LocalConfigurationAccess::class)
single<ConfigurationAccess> { ConfigurationManager(clientFactory = get()) }
factory<DataStreamProvider> { (scope: CoroutineScope) -> DataStreamManager(get(), scope) }
single<SymbolsAccess> { UProbeManager(get()) }
}

private fun Module.createViewModelFactories() {
viewModel { (pids: List<UInt>) ->
ConfigurationViewModel(
backendConfigurationAccess = get(),
localConfigurationAccess = get(),
pids = pids,
)
ConfigurationViewModel(configurationAccess = get(), pids = pids)
}
viewModel { ResetViewModel(get()) }
viewModel { ProcessesViewModel(runningComponentsProvider = get()) }
viewModel {
VisualizationViewModel(
backendConfigurationAccess = get(),
dataStreamProviderFactory = { get { parametersOf(it) } },
configurationAccess = get(),
runningComponentsAccess = get(),
dataStreamProviderFactory = { get { parametersOf(it) } },
)
}

Expand Down
Loading

0 comments on commit 4efd9c7

Please sign in to comment.