Skip to content

Commit a5db2ac

Browse files
committed
bug fixes
1 parent 12a4856 commit a5db2ac

38 files changed

+906
-1422
lines changed

.github/pull_request_template.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,6 @@ Related to #
146146

147147

148148

149-
## For Maintainers
150-
151-
<!-- Maintainers: Check these before merging -->
152-
153-
- [ ] Code review completed
154-
- [ ] Risk levels verified
155-
- [ ] Testing evidence provided and adequate
156-
- [ ] Documentation updated
157-
- [ ] No conflicts with existing data
158-
- [ ] JSON structure validated
159-
- [ ] Ready to merge
160-
161149
---
162150

163151
**Note for contributors:** Please fill out all relevant sections. Incomplete PRs may be delayed or closed. If you're using the contribution tool (`python contribute.py`), it automatically formats everything correctly!
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Auto-Generate Brand Files
2+
3+
on:
4+
push:
5+
paths:
6+
- 'packages_registry.json'
7+
branches:
8+
- main
9+
pull_request:
10+
paths:
11+
- 'packages_registry.json'
12+
13+
jobs:
14+
generate:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: '3.11'
27+
28+
- name: Generate brand files
29+
run: |
30+
python scripts/generate_brand_files.py --all
31+
32+
- name: Check for changes
33+
id: git-check
34+
run: |
35+
git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT
36+
37+
- name: Commit and push changes
38+
if: steps.git-check.outputs.changes == 'true' && github.event_name == 'push'
39+
run: |
40+
git config user.name "github-actions[bot]"
41+
git config user.email "github-actions[bot]@users.noreply.github.com"
42+
git add .
43+
git commit -m "Auto-generate brand files from registry [skip ci]"
44+
git push
45+
46+
- name: Commit changes to PR
47+
if: steps.git-check.outputs.changes == 'true' && github.event_name == 'pull_request'
48+
run: |
49+
git config user.name "github-actions[bot]"
50+
git config user.email "github-actions[bot]@users.noreply.github.com"
51+
git add .
52+
git commit -m "Auto-generate brand files from registry"
53+
git push origin HEAD:${{ github.head_ref }}

Asus/asus_remover.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77

88

99
class AsusRemover(BloatwareRemover):
10-
"""Asus-specific bloatware remover"""
11-
12-
def __init__(self, test_mode: bool = False):
13-
super().__init__('Asus', 'Asus/asus_config.json', test_mode)
10+
def __init__(self, test_mode: bool = False, use_registry: bool = True):
11+
super().__init__('Asus', 'Asus/asus_config.json', test_mode, use_registry=use_registry)
1412

1513
def _get_default_packages(self):
1614
return {

CONTRIBUTING.md

Lines changed: 172 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,82 @@ python contribute.py
2424

2525
This interactive tool will guide you through adding new packages to the registry.
2626

27+
### What's New?
28+
29+
#### Before (Old System)
30+
To add a new package, you needed to:
31+
1. Edit the brand's Python file (`Samsung/samsung_remover.py`)
32+
2. Edit the brand's Shell script (`Samsung/samsung_remover.sh`)
33+
3. Edit the brand's Markdown file (`Samsung/samsung-bloatware-list.md`)
34+
4. Ensure consistency across all three files
35+
5. Know Python, Shell, and Markdown syntax
36+
37+
#### After (New System)
38+
Now you can:
39+
1. Run `python contribute.py` (interactive tool)
40+
2. OR edit `packages_registry.json` directly
41+
3. That's it! One source of truth for all packages
42+
43+
### Contributing Methods
44+
45+
#### Method 1: Interactive Tool (Recommended)
46+
47+
```bash
48+
# Run the contribution tool
49+
python contribute.py
50+
```
51+
52+
The tool will guide you through:
53+
- Selecting brand and category
54+
- Entering package information
55+
- Validating risk levels
56+
- Saving to the registry
57+
58+
#### Method 2: Command Line
59+
60+
```bash
61+
# Add a package directly
62+
python contribute.py add \
63+
--brand samsung \
64+
--category bixby \
65+
--package com.samsung.android.bixby.test \
66+
--description "Bixby Test Service" \
67+
--risk safe
68+
69+
# Search for packages
70+
python contribute.py search --query "bixby"
71+
72+
# Remove a package
73+
python contribute.py remove --brand samsung --package com.example.package
74+
```
75+
76+
#### Method 3: Manual JSON Editing
77+
78+
Edit `packages_registry.json` directly:
79+
80+
```json
81+
{
82+
"brands": {
83+
"samsung": {
84+
"name": "Samsung",
85+
"categories": {
86+
"bixby": {
87+
"name": "Bixby Services",
88+
"description": "Samsung's virtual assistant",
89+
"packages": [
90+
{
91+
"name": "com.samsung.android.bixby.agent",
92+
"description": "Bixby Voice Assistant",
93+
"risk": "safe"
94+
}
95+
]
96+
}
97+
}
98+
}
99+
}
100+
}
101+
```
102+
27103
## How to Identify Bloatware Packages
28104

29105
### Step 1: List All Packages on Your Device
@@ -265,6 +341,101 @@ Use the **"New Package Entry"** issue template
265341

266342
Use the **"Update Risk Level"** issue template if you have evidence that a package's risk level should change
267343

344+
## API for Developers
345+
346+
If you're integrating with the registry programmatically:
347+
348+
```python
349+
from core.package_registry import PackageRegistry
350+
351+
# Initialize registry
352+
registry = PackageRegistry()
353+
354+
# Get all brands
355+
brands = registry.get_brands()
356+
357+
# Get packages for a brand
358+
packages = registry.get_packages_for_brand('samsung')
359+
360+
# Get specific package info
361+
info = registry.get_package_info('samsung', 'com.samsung.android.bixby.agent')
362+
363+
# Add a package
364+
registry.add_package('samsung', 'bixby', {
365+
'name': 'com.test.app',
366+
'description': 'Test App',
367+
'risk': 'safe'
368+
})
369+
370+
# Save changes
371+
registry.save_registry()
372+
```
373+
374+
## Troubleshooting
375+
376+
### "Package already exists"
377+
```bash
378+
python contribute.py search --query "package-name"
379+
# Check if it's already in the registry
380+
```
381+
382+
### "Invalid JSON"
383+
```bash
384+
# Validate your JSON
385+
python -m json.tool packages_registry.json
386+
```
387+
388+
### "Permission denied"
389+
```bash
390+
# Make contribute.py executable
391+
chmod +x contribute.py
392+
```
393+
394+
## Best Practices
395+
396+
1. **Always test before adding**
397+
- Use real device or test mode
398+
- Verify functionality
399+
- Test recovery
400+
401+
2. **Use descriptive information**
402+
- Clear package descriptions
403+
- Accurate risk levels
404+
- Proper categorization
405+
406+
3. **Document your testing**
407+
- Device model and Android version
408+
- Features tested
409+
- Issues encountered
410+
411+
4. **Follow PR template**
412+
- Complete all sections
413+
- Provide evidence
414+
- Link related issues
415+
416+
## FAQ
417+
418+
**Q: Do I need to know Python?**
419+
A: No! Use the interactive tool or edit JSON directly.
420+
421+
**Q: Can I still edit the .py files?**
422+
A: Yes, but it's not recommended. Use the registry instead.
423+
424+
**Q: Will old .md files be updated?**
425+
A: They may be auto-generated from the registry in the future.
426+
427+
**Q: How do I add a new brand?**
428+
A: Use `python contribute.py` and select "Add a new brand"
429+
430+
**Q: What if I make a mistake?**
431+
A: Git version control keeps everything safe. Just submit a correction PR!
432+
433+
## Support
434+
435+
- Read this contribution guide thoroughly
436+
- Start a [Discussion](https://github.com/PixelCode01/UIBloatwareRegistry/discussions)
437+
- Report an [Issue](https://github.com/PixelCode01/UIBloatwareRegistry/issues)
438+
268439
## License
269440

270441
By contributing to the UIBloatwareRegistry repository, you agree that your contributions will be licensed under the [MIT License](https://opensource.org/licenses/MIT).
@@ -273,5 +444,5 @@ By contributing to the UIBloatwareRegistry repository, you agree that your contr
273444

274445
We appreciate your contributions and look forward to building a valuable resource for managing Android bloatware together!
275446

276-
For more detailed information, see [CONTRIBUTION_GUIDE.md](CONTRIBUTION_GUIDE.md).
447+
**Happy Contributing!**
277448

0 commit comments

Comments
 (0)