diff options
author | Luke Street | 2019-12-01 01:26:40 -0500 |
---|---|---|
committer | Luke Street | 2019-12-01 01:26:40 -0500 |
commit | 3db949ea6838f236bb4b388257b7ff959d30e03a (patch) | |
tree | 213e2f739473bdec5ca45a8c5414abb4b8fcb13d | |
download | aur-3db949ea6838f236bb4b388257b7ff959d30e03a.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 42 | ||||
-rw-r--r-- | PKGBUILD | 98 | ||||
-rw-r--r-- | darcula.patch | 93 | ||||
-rw-r--r-- | ghidra.desktop | 9 |
4 files changed, 242 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..80db30fffecb --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,42 @@ +pkgbase = ghidra-darcula + pkgdesc = Software reverse engineering framework + pkgver = 9.1 + pkgrel = 1 + url = https://ghidra-sre.org/ + arch = x86_64 + license = Apache + makedepends = git + makedepends = gradle + makedepends = unzip + depends = java-environment>=11 + depends = bash + optdepends = python2: for the Python feature + optdepends = pam: for GhidraServer support + provides = ghidra + conflicts = ghidra + conflicts = ghidra-bin + conflicts = ghidra-git + noextract = AXMLPrinter2.jar + noextract = yajsw-stable-12.12.zip + noextract = hfsexplorer-0_21-bin.zip + source = git+https://github.com/NationalSecurityAgency/ghidra#tag=Ghidra_9.1_build + source = git+https://github.com/NationalSecurityAgency/ghidra-data#commit=60529abb6c1e28b689f539384a1ebd1fe13d6528 + source = https://github.com/pxb1988/dex2jar/releases/download/2.0/dex-tools-2.0.zip + source = https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android4me/AXMLPrinter2.jar + source = https://sourceforge.net/projects/yajsw/files/yajsw/yajsw-stable-12.12/yajsw-stable-12.12.zip + source = https://sourceforge.net/projects/catacombae/files/HFSExplorer/0.21/hfsexplorer-0_21-bin.zip + source = ghidra.desktop + source = darcula.patch + source = git+https://github.com/encounter/darcula-laf.git#commit=08c13c5f1a12624f4d8df8723b39061e11c93241 + sha512sums = SKIP + sha512sums = SKIP + sha512sums = c4a6c72ea09b58a44fcb8918cfada600467f10f99a02b53d2436ac68295e73c8daf9ba0a8bc7160ba1e28e87f032ee034435ebe40af35b6e2fe9fa4607581358 + sha512sums = c1168ec913f1fbb0675915d4fd865ec9a8e8573f6c8aedcb6e68166f61f11aeaececc7548d54d78134843c0102c57d6350973f6d3027d0ffdae52a5c57a7f601 + sha512sums = 0ff5a228ae1c5251c8ba59f9bcd9b4a199b0caaf688f6eccba42c3d227784d8f56f9164b2fad73fc173ec314340c036144123ce152fe911013df5598bd708944 + sha512sums = b85b4316115695acc78cc7c675c673058c05a238451562be0c6a48b2d11a28e5645a42cb62cdf063be015369df26201dfab6cf2e60f39e6468d1d53b23f94415 + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + +pkgname = ghidra-darcula + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..cb9116e9833b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,98 @@ +# Maintainer: Luke Street <luke@street.dev> +# Based on AUR ghidra, .desktop from ghidra-bin + +pkgname=ghidra-darcula +pkgver=9.1 +_ghidra_data=60529abb6c1e28b689f539384a1ebd1fe13d6528 +_darcula=08c13c5f1a12624f4d8df8723b39061e11c93241 +_darcula_version=2019.09 +_d2j=2.0 +_yajsw=12.12 +_hfsx=0.21 +pkgrel=1 +pkgdesc='Software reverse engineering framework (with dark theme)' +arch=('x86_64') +url='https://ghidra-sre.org/' +license=('Apache') +depends=('java-environment>=11' 'bash') +provides=('ghidra') +conflicts=('ghidra' 'ghidra-bin' 'ghidra-git') +makedepends=('git' 'gradle' 'unzip') +optdepends=('python2: for the Python feature' + 'pam: for GhidraServer support') +source=("git+https://github.com/NationalSecurityAgency/ghidra#tag=Ghidra_${pkgver}_build" + "git+https://github.com/NationalSecurityAgency/ghidra-data#commit=${_ghidra_data}" + https://github.com/pxb1988/dex2jar/releases/download/${_d2j}/dex-tools-${_d2j}.zip + https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android4me/AXMLPrinter2.jar + https://sourceforge.net/projects/yajsw/files/yajsw/yajsw-stable-${_yajsw}/yajsw-stable-${_yajsw}.zip + https://sourceforge.net/projects/catacombae/files/HFSExplorer/${_hfsx}/hfsexplorer-${_hfsx/./_}-bin.zip + ghidra.desktop + darcula.patch + "git+https://github.com/encounter/darcula-laf.git#commit=${_darcula}") +noextract=(AXMLPrinter2.jar + yajsw-stable-${_yajsw}.zip + hfsexplorer-${_hfsx/./_}-bin.zip) +sha512sums=('SKIP' + 'SKIP' + 'c4a6c72ea09b58a44fcb8918cfada600467f10f99a02b53d2436ac68295e73c8daf9ba0a8bc7160ba1e28e87f032ee034435ebe40af35b6e2fe9fa4607581358' + 'c1168ec913f1fbb0675915d4fd865ec9a8e8573f6c8aedcb6e68166f61f11aeaececc7548d54d78134843c0102c57d6350973f6d3027d0ffdae52a5c57a7f601' + '0ff5a228ae1c5251c8ba59f9bcd9b4a199b0caaf688f6eccba42c3d227784d8f56f9164b2fad73fc173ec314340c036144123ce152fe911013df5598bd708944' + 'b85b4316115695acc78cc7c675c673058c05a238451562be0c6a48b2d11a28e5645a42cb62cdf063be015369df26201dfab6cf2e60f39e6468d1d53b23f94415' + 'SKIP' + 'SKIP' + 'SKIP') + +prepare() { + install -d hfsx + unzip -u hfsexplorer-${_hfsx/./_}-bin.zip -d hfsx + + cd ghidra + + # Add libs + install -Dm 644 ../dex2jar-${_d2j}/lib/dex-*.jar \ + ../AXMLPrinter2.jar \ + ../hfsx/lib/{csframework,hfsx*,iharder-base64}.jar \ + -t flatRepo + + # YAJSW expects this symlink + ln -sf ghidra ../ghidra.bin + install -Dm 644 ../yajsw-stable-${_yajsw}.zip -t Ghidra/Features/GhidraServer + + # Add FID datasets + install -Dm 644 ../ghidra-data/FunctionID/*.fidb -t Ghidra/Features/FunctionID/src/main/fidb + + # Ignore lack of licensing for YAJSW zip, packed FID datasets, and the native binaries + sed -i '/FileTree tree/a\\t\texclude "yajsw-stable-**.zip"\n\t\texclude "src/main/fidb/**.fidb"\n\t\texclude "os/linux64/**"' gradle/support/ip.gradle + + # Apply darcula patch + patch -Np1 -i "$srcdir"/darcula.patch + sed -i "/dependencies {/a\\\\tcompile ':darcula-laf:${_darcula_version}'" Ghidra/Framework/Docking/build.gradle + echo "MODULE FILE LICENSE: lib/darcula-laf-${_darcula_version}.jar Apache License 2.0" >> Ghidra/Framework/Docking/Module.manifest +} + +build() { + cd "$srcdir"/darcula-laf + gradle jar + cp build/libs/darcula-laf-${_darcula_version}.jar -t "$srcdir"/ghidra/flatRepo + + cd "$srcdir"/ghidra + gradle yajswDevUnpack + gradle prebuildNatives_linux64 + gradle buildGhidra +} + +package() { + cd ghidra + install -d "${pkgdir}"/{opt,usr/bin} + _appver=$(grep -oP '(?<=^application.version=).*$' Ghidra/application.properties) + _relname=$(grep -oP '(?<=^application.release.name=).*$' Ghidra/application.properties) + unzip -u "build/dist/ghidra_${_appver}_${_relname}_$(date +"%Y%m%d")_linux64.zip" -d "${pkgdir}"/opt + mv "${pkgdir}"/opt/ghidra{"_${_appver}_DEV",} + ln -s /opt/ghidra/ghidraRun "${pkgdir}"/usr/bin/ghidra + ln -s /opt/ghidra/support/analyzeHeadless "${pkgdir}"/usr/bin/ghidra-analyzeHeadless + install -Dm 644 LICENSE -t "${pkgdir}"/usr/share/licenses/ghidra + install -Dm 644 "$srcdir"/ghidra.desktop -t "$pkgdir"/usr/share/applications + install -Dm 644 Ghidra/Framework/Generic/src/main/resources/images/GhidraIcon256.png "$pkgdir"/usr/share/pixmaps/ghidra.png +} + +# vim: ts=2 sw=2 et: diff --git a/darcula.patch b/darcula.patch new file mode 100644 index 000000000000..2f768a0d7d8f --- /dev/null +++ b/darcula.patch @@ -0,0 +1,93 @@ +diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/AbstractGCellRenderer.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/AbstractGCellRenderer.java +index cf5711f3..dc40ec85 100644 +--- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/AbstractGCellRenderer.java ++++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/AbstractGCellRenderer.java +@@ -4,9 +4,9 @@ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at +- * ++ * + * http://www.apache.org/licenses/LICENSE-2.0 +- * ++ * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@@ -32,7 +32,8 @@ import docking.widgets.label.GDHtmlLabel; + */ + public abstract class AbstractGCellRenderer extends GDHtmlLabel { + +- private static final Color ALTERNATE_BACKGROUND_COLOR = new Color(237, 243, 254); ++ private static final Color ALTERNATE_BACKGROUND_COLOR = new Color(0x32, 0x32, 0x32); ++ private static final Color REGULAR_BACKGROUND_COLOR = new Color(0x2b, 0x2b, 0x2b); + + /** Allows the user to disable alternating row colors on JLists & JTables */ + private static final String DISABLE_ALTERNATING_ROW_COLORS_PROPERTY = +@@ -156,7 +157,7 @@ public abstract class AbstractGCellRenderer extends GDHtmlLabel { + } + + protected Color getDefaultBackgroundColor() { +- return Color.WHITE; ++ return REGULAR_BACKGROUND_COLOR; + } + + protected Color getBackgroundColorForRow(int row) { +diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/FilterTextField.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/FilterTextField.java +index 1bcfba73..7f8ce8db 100644 +--- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/FilterTextField.java ++++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/FilterTextField.java +@@ -42,7 +42,7 @@ public class FilterTextField extends JPanel { + private static final int FLASH_FREQUENCY_MS = 250; + + private static Color FLASH_BACKGROUND_COLOR = Color.WHITE; +- private static Color FILTERED_BACKGROUND_COLOR = Color.YELLOW; ++ private static Color FILTERED_BACKGROUND_COLOR = new Color(0x11,0x11,0x11); + /*package*/ static Color UNEDITABLE_BACKGROUND_COLOR = Color.LIGHT_GRAY; + + private Color noFlashColor; +diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableHeaderRenderer.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableHeaderRenderer.java +index 778efa24..eea383b1 100644 +--- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableHeaderRenderer.java ++++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableHeaderRenderer.java +@@ -38,10 +38,10 @@ import resources.icons.TranslateIcon; + public class GTableHeaderRenderer extends JPanel implements TableCellRenderer { + private static final int PADDING_FOR_COLUMN_NUMBER = 10; + +- private static final Color PRIMARY_SORT_GRADIENT_START = new Color(205, 227, 244); +- private static final Color PRIMARY_SORT_GRADIENT_END = new Color(126, 186, 233); +- private static final Color DEFAULT_GRADIENT_START = Color.WHITE; +- private static final Color DEFAULT_GRADIENT_END = new Color(215, 215, 215); ++ private static final Color PRIMARY_SORT_GRADIENT_START = new Color(0x5B, 0x67, 0x74); ++ private static final Color PRIMARY_SORT_GRADIENT_END = new Color(0x52, 0x52, 0x52); ++ private static final Color DEFAULT_GRADIENT_START = new Color(0x3B, 0x47, 0x54); ++ private static final Color DEFAULT_GRADIENT_END = new Color(0x32, 0x32, 0x32); + + private static final Icon UP_ICON = + ResourceManager.getScaledIcon(Icons.SORT_ASCENDING_ICON, 14, 14); +diff --git a/Ghidra/Framework/Docking/src/main/java/ghidra/docking/util/DockingWindowsLookAndFeelUtils.java b/Ghidra/Framework/Docking/src/main/java/ghidra/docking/util/DockingWindowsLookAndFeelUtils.java +index 93420150..0f15e299 100644 +--- a/Ghidra/Framework/Docking/src/main/java/ghidra/docking/util/DockingWindowsLookAndFeelUtils.java ++++ b/Ghidra/Framework/Docking/src/main/java/ghidra/docking/util/DockingWindowsLookAndFeelUtils.java +@@ -30,6 +30,9 @@ import ghidra.framework.Platform; + import ghidra.framework.preferences.Preferences; + import ghidra.util.*; + ++import com.bulenkov.darcula.DarculaLaf; ++import javax.swing.plaf.basic.BasicLookAndFeel; ++ + /** + * A utility class to manage LookAndFeel (LaF) settings. + */ +@@ -157,9 +160,8 @@ public class DockingWindowsLookAndFeelUtils { + throws ClassNotFoundException, InstantiationException, IllegalAccessException, + UnsupportedLookAndFeelException { + +- String lookAndFeelClassName = findLookAndFeelClassName(lookAndFeelName); +- UIManager.setLookAndFeel(lookAndFeelClassName); +- fixupLookAndFeelIssues(); ++ BasicLookAndFeel darcula = new DarculaLaf(); ++ UIManager.setLookAndFeel(darcula); + } + + private static String findLookAndFeelClassName(String lookAndFeelName) { diff --git a/ghidra.desktop b/ghidra.desktop new file mode 100644 index 000000000000..2655da5265da --- /dev/null +++ b/ghidra.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=Ghidra +Comment=Software reverse engineering framework +Exec=ghidra +Icon=ghidra +Categories=Utility; +Terminal=false
\ No newline at end of file |