Thank you for considering contributing to ShadowCheckMobile! This document provides guidelines and instructions for contributing.
- Android Studio Hedgehog (2023.1.1) or later
- JDK 17
- Android SDK 34
- Git
-
Fork and Clone
git clone https://github.com/yourusername/ShadowCheckMobile.git cd ShadowCheckMobile -
Configure Local Properties
cp local.properties.example local.properties # Edit local.properties and add your API keys -
Build the Project
./gradlew clean build
-
Run Tests
./gradlew test
feature/- New features (e.g.,feature/bluetooth-scanning)fix/- Bug fixes (e.g.,fix/wifi-crash)refactor/- Code refactoring (e.g.,refactor/viewmodel-cleanup)test/- Adding or updating tests (e.g.,test/wifi-repository)docs/- Documentation updates (e.g.,docs/api-guide)
Follow the conventional commits format:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixrefactor: Code refactoringtest: Adding or updating testsdocs: Documentation changesstyle: Code style changes (formatting, etc.)perf: Performance improvementschore: Build process or auxiliary tool changes
Example:
feat(wifi): Add WPA3 network detection
Implement WPA3 security detection for WiFi networks.
Updates the scanner service to properly identify WPA3
capabilities and display them in the network list.
Closes #42
- Follow Kotlin Coding Conventions
- Use 4 spaces for indentation
- Max line length: 120 characters
- Use meaningful variable names (avoid decompilation artifacts like
var1,var2)
Use Clean Architecture for new code:
domain/
├── model/ # Pure business objects
├── repository/ # Repository interfaces
└── usecase/ # Business logic
data/
├── database/ # Room entities and DAOs
├── repository/ # Repository implementations
└── remote/ # API services and DTOs
presentation/
└── viewmodel/ # Hilt ViewModels
ui/
├── screens/ # Composable screens
└── components/ # Reusable UI components
-
Package by feature, not layer
✅ Good: com.shadowcheck.mobile.wifi/ ├── data/ ├── domain/ └── presentation/ ❌ Avoid: com.shadowcheck.mobile.data/ com.shadowcheck.mobile.domain/ com.shadowcheck.mobile.presentation/ -
Use descriptive file names
- ViewModels:
WifiViewModel.kt - Use Cases:
GetAllWifiNetworksUseCase.kt - Repositories:
WifiNetworkRepository.kt(interface),WifiNetworkRepositoryImpl.kt(implementation)
- ViewModels:
Always use Hilt for dependency injection:
// ViewModel
@HiltViewModel
class WifiViewModel @Inject constructor(
private val getAllWifiNetworks: GetAllWifiNetworksUseCase
) : ViewModel()
// Repository
@Singleton
class WifiNetworkRepositoryImpl @Inject constructor(
private val dao: WifiNetworkDao,
@IoDispatcher private val dispatcher: CoroutineDispatcher
) : WifiNetworkRepositoryAll new code must include tests:
- Use Cases: 100% coverage required
- ViewModels: 90%+ coverage
- Repositories: 80%+ coverage
Example test:
@ExperimentalCoroutinesApi
class GetAllWifiNetworksUseCaseTest {
@get:Rule
val mockkRule = MockKRule(this)
@MockK
private lateinit var repository: WifiNetworkRepository
@InjectMockKs
private lateinit var useCase: GetAllWifiNetworksUseCase
@Test
fun `invoke should return filtered networks`() = runTest {
// Given
val networks = TestUtils.createTestWifiNetworks(5)
every { repository.getAllNetworks() } returns flowOf(networks)
// When
val result = useCase().first()
// Then
assertEquals(5, result.size)
}
}-
Run code quality checks
./gradlew detekt
-
Run all tests
./gradlew test -
Format code
- Use Android Studio's "Reformat Code" (Ctrl+Alt+L / Cmd+Option+L)
- Follow
.editorconfigsettings
-
Update documentation
- Update CLAUDE.md if architectural patterns change
- Add KDoc comments for public APIs
- Update README.md if user-facing features change
- Code follows style guidelines
- Tests added for new functionality
- All tests pass
- Documentation updated
- Commit messages follow convention
- No merge conflicts with main branch
- PR description explains changes clearly
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Refactoring
- [ ] Documentation update
## Testing
- [ ] Unit tests added/updated
- [ ] Manual testing performed on device
- [ ] Edge cases considered
## Screenshots (if UI changes)
Add screenshots here
## Related Issues
Closes #<issue_number>
## Additional Notes
Any additional context-
Code Quality
- Follows Clean Architecture
- Uses Hilt DI properly
- No code duplication
- Proper error handling
-
Testing
- Adequate test coverage
- Tests follow Given-When-Then pattern
- Edge cases covered
-
Performance
- No blocking calls on main thread
- Efficient database queries
- Proper use of coroutines and Flow
-
Security
- No hardcoded secrets or API keys
- Proper data encryption
- Input validation
- Respond to all comments
- Make requested changes in new commits (don't force push)
- Mark conversations as resolved after addressing
- Ask for clarification if feedback is unclear
- Use KSP for Room/Hilt (project uses KAPT)
- Create new files in
com.shadowcheck.mobile.rebuiltpackage - Add features without tests
- Commit API keys or secrets
- Use blocking calls in ViewModels
- Ignore detekt warnings
- Use KAPT for annotation processing
- Follow Clean Architecture for new code
- Write tests for all new functionality
- Use
SecureApiKeyManagerfor API keys - Use coroutines and Flow for async operations
- Fix detekt issues before submitting PR
- Questions about architecture: Check CLAUDE.md
- Build issues: See docs/BUILD_FIX_GUIDE.md
- Development workflow: See docs/DEVELOPMENT.md
- Feature questions: Open a GitHub Discussion
- Bug reports: Open a GitHub Issue
Contributors will be recognized in:
- README.md contributors section
- Release notes for significant contributions
- Git commit history
Thank you for contributing to ShadowCheckMobile!