check_nested_jar.ps1 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. $ErrorActionPreference = "SilentlyContinue"
  2. # Check if his controllers are in nested fs-admin-saas jar inside fs-company.jar
  3. Add-Type -AssemblyName System.IO.Compression.FileSystem
  4. $jarPath = "d:\ylrz\ylrz_saas_his_scrm\fs-company\target\fs-company.jar"
  5. $zip = [System.IO.Compression.ZipFile]::OpenRead($jarPath)
  6. # Find fs-admin-saas jar entry
  7. $saasEntry = $zip.Entries | Where-Object { $_.FullName -match "fs-admin-saas.*\.jar$" }
  8. Write-Output "=== fs-admin-saas JAR in fs-company.jar ==="
  9. foreach ($e in $saasEntry) {
  10. Write-Output "$($e.FullName) ($($e.Length) bytes)"
  11. }
  12. # Extract fs-admin-saas jar
  13. $tempDir = "$env:TEMP\saas_check"
  14. if (Test-Path $tempDir) { Remove-Item $tempDir -Recurse -Force }
  15. New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
  16. foreach ($e in $saasEntry) {
  17. $destPath = Join-Path $tempDir "fs-admin-saas.jar"
  18. [System.IO.Compression.ZipFileExtensions]::ExtractToFile($e, $destPath, $true)
  19. Write-Output "Extracted to $destPath"
  20. # Now check what controllers are inside this nested jar
  21. $nestedZip = [System.IO.Compression.ZipFile]::OpenRead($destPath)
  22. Write-Output ""
  23. Write-Output "=== HIS Controller classes in fs-admin-saas.jar ==="
  24. $hisEntries = $nestedZip.Entries | Where-Object { $_.FullName -match "his/controller/.*Controller\.class" }
  25. Write-Output "Total: $($hisEntries.Count)"
  26. foreach ($h in $hisEntries) {
  27. Write-Output $h.FullName
  28. }
  29. Write-Output ""
  30. Write-Output "=== COURSE Controller classes in fs-admin-saas.jar ==="
  31. $courseEntries = $nestedZip.Entries | Where-Object { $_.FullName -match "course/controller/.*Controller\.class" }
  32. Write-Output "Total: $($courseEntries.Count)"
  33. foreach ($h in $courseEntries) {
  34. Write-Output $h.FullName
  35. }
  36. Write-Output ""
  37. Write-Output "=== QW Controller classes in fs-admin-saas.jar ==="
  38. $qwEntries = $nestedZip.Entries | Where-Object { $_.FullName -match "qw/controller/.*Controller\.class" }
  39. Write-Output "Total: $($qwEntries.Count)"
  40. foreach ($h in $qwEntries) {
  41. Write-Output $h.FullName
  42. }
  43. Write-Output ""
  44. Write-Output "=== CRM Controller classes in fs-admin-saas.jar ==="
  45. $crmEntries = $nestedZip.Entries | Where-Object { $_.FullName -match "crm/controller/.*Controller\.class" }
  46. Write-Output "Total: $($crmEntries.Count)"
  47. foreach ($h in $crmEntries) {
  48. Write-Output $h.FullName
  49. }
  50. Write-Output ""
  51. Write-Output "=== LIVE Controller classes in fs-admin-saas.jar ==="
  52. $liveEntries = $nestedZip.Entries | Where-Object { $_.FullName -match "live/controller/.*Controller\.class" }
  53. Write-Output "Total: $($liveEntries.Count)"
  54. foreach ($h in $liveEntries) {
  55. Write-Output $h.FullName
  56. }
  57. $nestedZip.Dispose()
  58. }
  59. $zip.Dispose()
  60. Write-Output "Done"