-
Notifications
You must be signed in to change notification settings - Fork 1
Fix printer Wi-Fi config flow to match working v1.0 behavior #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8780854
e5dfeef
4afa705
fdff056
dc07361
e0180d1
0c1deda
e551035
310a152
b492a56
a2f1b23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| # Built application files | ||
| *.apk | ||
| *.aar | ||
| !app/libs/BluetoothBinding.aar | ||
| *.ap_ | ||
| *.aab | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,11 +13,14 @@ | |||||||||
|
|
||||||||||
| <!-- Needed for Bluetooth discovery on Android 6-11 --> | ||||||||||
| <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" /> | ||||||||||
| <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" /> | ||||||||||
| <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, locate and examine the AndroidManifest.xml file
find . -name "AndroidManifest.xml" -type fRepository: Arieboomsma/connectprinter Length of output: 104 🏁 Script executed: # Check the content of the file around lines 16-23
if [ -f "app/src/main/AndroidManifest.xml" ]; then
echo "=== Current AndroidManifest.xml (lines 1-35) ==="
head -35 "app/src/main/AndroidManifest.xml" | cat -n
fiRepository: Arieboomsma/connectprinter Length of output: 2023 🏁 Script executed: # Check git history for this file to see what changed
cd . && git log --oneline -10 -- "app/src/main/AndroidManifest.xml" 2>/dev/null || echo "Git history not available"Repository: Arieboomsma/connectprinter Length of output: 142 🏁 Script executed: # Try to see the diff for the most recent change to this file
git diff HEAD~1 HEAD -- "app/src/main/AndroidManifest.xml" 2>/dev/null || echo "Cannot get git diff"Repository: Arieboomsma/connectprinter Length of output: 89 🏁 Script executed: # Try to get the full git log with patch to see if maxSdkVersion was removed
git log -p --all -- "app/src/main/AndroidManifest.xml" 2>/dev/null | grep -A5 -B5 "ACCESS_FINE_LOCATION" | head -50 || echo "Cannot retrieve full history"Repository: Arieboomsma/connectprinter Length of output: 52 🏁 Script executed: # Check if there are any recent commits that mention this change
git log --all --oneline -20 2>/dev/null || echo "Git not available"Repository: Arieboomsma/connectprinter Length of output: 599 🏁 Script executed: # Search for any issues or comments in the code about location permissions
rg "ACCESS_FINE_LOCATION|maxSdkVersion.*30" --type xml -B2 -A2Repository: Arieboomsma/connectprinter Length of output: 1077 Scope Line 16 declares precise location permission without API level constraints, but the comment on line 14 explicitly states this is needed only for "Bluetooth discovery on Android 6-11." The parallel permission on line 15 ( 🔧 Suggested fix- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+ <uses-permission
+ android:name="android.permission.ACCESS_FINE_LOCATION"
+ android:maxSdkVersion="30" />📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| <!-- Wi-Fi permissions --> | ||||||||||
| <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> | ||||||||||
| <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> | ||||||||||
| <uses-permission | ||||||||||
| android:name="android.permission.NEARBY_WIFI_DEVICES" | ||||||||||
| android:usesPermissionFlags="neverForLocation" /> | ||||||||||
|
|
||||||||||
| <!-- Internet permission --> | ||||||||||
| <uses-permission android:name="android.permission.INTERNET" /> | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| package com.sunmi.printerconfig; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| public final class DiscoveredPrinter { | ||
| private final String address; | ||
| private final String name; | ||
|
|
||
| public DiscoveredPrinter(String address, String name) { | ||
| this.address = address == null ? "" : address.trim(); | ||
| this.name = name == null ? "" : name.trim(); | ||
| } | ||
|
|
||
| public String getAddress() { | ||
| return address; | ||
| } | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object other) { | ||
| if (this == other) { | ||
| return true; | ||
| } | ||
| if (!(other instanceof DiscoveredPrinter)) { | ||
| return false; | ||
| } | ||
| DiscoveredPrinter that = (DiscoveredPrinter) other; | ||
| return Objects.equals(address, that.address); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(address); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Arieboomsma/connectprinter
Length of output: 181
🏁 Script executed:
Repository: Arieboomsma/connectprinter
Length of output: 153
🏁 Script executed:
Repository: Arieboomsma/connectprinter
Length of output: 2415
🏁 Script executed:
Repository: Arieboomsma/connectprinter
Length of output: 268
🏁 Script executed:
Repository: Arieboomsma/connectprinter
Length of output: 336
🏁 Script executed:
Repository: Arieboomsma/connectprinter
Length of output: 10807
🏁 Script executed:
Repository: Arieboomsma/connectprinter
Length of output: 2008
Pin the BluetoothBinding.aar artifact hash in CI to verify supply-chain integrity.
The local
BluetoothBinding.aardependency bypasses Maven metadata and weakens supply-chain visibility. Add a SHA-256 verification step in your CI/CD pipeline to ensure the artifact hasn't been tampered with. If this is a vendor-supplied library, document its origin and source in the repository (CONTRIBUTING.md or build README).No existing verification mechanisms (gradle verification-metadata.xml, CI checks) were found.
🤖 Prompt for AI Agents