Windows PowerShell scripts: parity polish after #8
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by comparing decompile.ps1 with decompile.sh, especially Invoke-Jadx, Invoke-Fernflower, the both-engine summary, and Show-Structure; then review install-dep.ps1's Add-ToUserPath. The issue lists eight parity changes, but says substantial changes to the .sh scripts are underway and recommends waiting for them to merge. Done means the selected PowerShell behavior matches its bash counterpart and is tested on Windows.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Windows PowerShell scripts: parity polish after #8
Following the merge of #8 (huge thanks to @philjn for adding native Windows support — much appreciated, the structure is solid and the security review came back clean), I did a deeper side-by-side comparison of the four new PowerShell scripts against their bash counterparts on master.
That comparison surfaced a handful of items where the *.ps1 scripts could use a small follow-up to bring them to full feature parity — mostly behaviors that landed in *.sh via #10 (partial-success handling, fernflower timeout) and a couple of small refinements specific to the PowerShell implementation.
These are not blockers — the PS1 scripts work end-to-end on Windows — but bringing them to full parity will make the Windows experience match the Linux/macOS one.
Status
- ✅ 3 items already addressed in commit
f3fb1e9on master: alignedinstall-dep.ps1to theThexXTURBOXx/dex2jarfork (mirroring #12). - ⏳ 8 items remaining below, grouped by area.
Remaining items
decompile.ps1 — feature parity with decompile.sh post-#10
1. Surface jadx exit code in Invoke-Jadx (~line 178)
The function currently returns $true regardless of jadx's exit code. The bash equivalent returns 0 (success), 2 (partial success — exit non-zero but Java files produced), or 1 (hard failure). Aligning the PS1 to the same trichotomy would let Invoke-DecompileSingle route the "both" engine flow correctly when jadx warnings occur.
2. Surface fernflower exit code in Invoke-Fernflower (~line 241)
Same pattern as #1 — capture $LASTEXITCODE and return 0/1/2 so the caller knows whether to continue or to fall back to the other engine.
3. Warning grep in the both engine summary (~line 302)
Select-String -Pattern '...|...' -SimpleMatch treats the | characters literally, so the "files with warnings/errors" count currently always reports 0. Removing -SimpleMatch (the pattern is already a valid regex) restores the intended behavior.
4. Show-Structure ordering (~lines 250-253)
The pipeline currently does Select-Object -First 20 | Sort-Object, which sorts only whichever 20 results came first from the filesystem enumeration. Swapping the order to Sort-Object | Select-Object -First 20 makes the top-level package list deterministic and aligned with the bash version. Also -Depth 2 could become -Depth 3 to match the bash -maxdepth 3.
5. Optional fernflower timeout (FERNFLOWER_TIMEOUT_SECONDS)
The bash version added a default 900s timeout in #10 to prevent indefinite hangs on Compose-heavy APKs. PowerShell doesn't have a native timeout(1); one option is Start-Job + Wait-Job -Timeout, another is System.Diagnostics.Process + WaitForExit($ms). Either approach would be welcome.
6. Intermediate dex2jar artifact directory
The bash version writes the converted jar into an intermediate/ subdirectory and only cleans it up on success (preserved on failure for debugging). Currently the PS1 writes it directly into the output dir alongside the sources.
7. Fallback for "Vineflower writes sources directly"
When Vineflower (rather than classic Fernflower) is the engine, output may land directly in the destination folder rather than as a result jar. The bash version handles both cases at lines ~296-312; the PS1 only handles the result-jar case.
install-dep.ps1 — minor refinement
8. Add-ToUserPath substring match is too permissive (line 76)
$currentPath -notlike "*$Dir*" returns false if PATH already contains a directory whose name is a superstring of $Dir (e.g. asking to add C:\foo when PATH already contains C:\foo\bar). Splitting on ; and doing an exact -notcontains check would be more correct.
How to take this forward
No pressure either way, @philjn — if any of these look interesting and you'd like to take a stab at one or more, you'd be very welcome. Otherwise I'm happy to get to them whenever I have a Windows VM available for proper testing, no rush at all.
Items 1-4 are the most user-visible (warning detection, exit code propagation, deterministic listing); 5-7 are nice-to-have parity with the recent bash improvements; 8 is a tiny edge case.
Feel free to drop a comment here, open a PR, or just leave it for me — whatever fits your schedule.
IMPORTANT
Since there is a large change I've been working on then the original .sh scripts will see some substantial changes. Before working on this issue it makes sense to wait after I merge the big changes.
- Lingua principale
- Shell
- Stelle
- 8k
- Fork
- 902
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SimoneAvogadro/android-reverse-engineering-skill
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
SimoneAvogadro/android-reverse-engineering-skill#26 · 1 commento ·
-
BujjiAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
Tutte le issue di SimoneAvogadro/android-reverse-engineering-skill
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Graphify-Labs/graphify#4977 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
lesson-submission pending-review
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Ikalus1988/MisakaNet#4393 ·
I maintainer di solito rispondono entro 1 giorno