Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6589361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:09:51+00:00 2026-05-25T17:09:51+00:00

I have simple java project which refers to two (2) library jar files. Want

  • 0

I have simple java project which refers to two (2) library jar files. Want to integrate ProGuard.

Here’s my current build.xml:

<?xml version="1.0" ?>
<project name="Samples" default="dist" basedir=".">
    <!-- generate JAR START -->
    <description>Samples Library</description>
    <!-- Setting global properties for this build -->
    <property name="src" location="src" />
    <property name="bin" location="bin" />

    <target name="dist">
        <jar destfile="Samples.jar" basedir="bin/">
            <!-- Use ** to include the directory recursively -->
            <include name="com/samples/**" />
        </jar>
    </target>
</project>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:09:51+00:00Added an answer on May 25, 2026 at 5:09 pm

    I found several ways to integrate it but this is the simplest way to do it.

    <?xml version="1.0" ?>
    <project name="Samples" default="dist" basedir=".">
        <!-- generate JAR START -->
        <description>Samples Library</description>
        <!-- Setting global properties for this build -->
        <property name="src" location="src" />
        <property name="bin" location="bin" />
    
        <target name="dist">
            <jar destfile="Samples.jar" basedir="bin/">
                <!-- Use ** to include the directory recursively -->
                <include name="com/samples/**" />
            </jar>
        </target>
        <!-- generate JAR END -->
    
        <!-- The local.properties file is created and updated by the 'android'
             tool.
             It contains the path to the SDK. It should *NOT* be checked into
             Version Control Systems. -->
        <property file="local.properties" />
    
        <!-- The build.properties file can be created by you and is never touched
             by the 'android' tool. This is the place to change some of the
             default property values used by the Ant rules.
             Here are some properties you may want to change/update:
    
             source.dir
                 The name of the source directory. Default is 'src'.
             out.dir
                 The name of the output directory. Default is 'bin'.
    
             Properties related to the SDK location or the project target should
             be updated using the 'android' tool with the 'update' action.
    
             This file is an integral part of the build system for your
             application and should be checked into Version Control Systems.
    
             -->
        <property file="build.properties" />
    
        <!-- The default.properties file is created and updated by the 'android'
             tool, as well as ADT.
             This file is an integral part of the build system for your
             application and should be checked into Version Control Systems. -->
        <property file="default.properties" />
    
        <!-- Add Proguard Tasks -->
        <property name="proguard.jar" location="proguard/lib/proguard.jar" />
    
        <taskdef resource="proguard/ant/task.properties"
             classpath="${proguard.jar}" />
        <proguard configuration="proguard.cfg"/>
    
    </project>
    

    Here’s the proguard.cfg:

    -injars       Samples.jar
    -outjars      Samples-out.jar
    -libraryjars  libs/android.jar
    -printmapping out.map
    
    -renamesourcefileattribute SourceFile
    -keepattributes Exceptions,InnerClasses,Signature,Deprecated,
                    SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
    
    -keep public class * {
        public protected *;
    }
    
    -keepclassmembernames class * {
        java.lang.Class class$(java.lang.String);
        java.lang.Class class$(java.lang.String, boolean);
    }
    
    -keepclasseswithmembernames class * {
        native <methods>;
    }
    
    -keepclassmembers enum * {
        public static **[] values();
        public static ** valueOf(java.lang.String);
    }
    
    -keepclassmembers class * implements java.io.Serializable {
        static final long serialVersionUID;
        private static final java.io.ObjectStreamField[] serialPersistentFields;
        private void writeObject(java.io.ObjectOutputStream);
        private void readObject(java.io.ObjectInputStream);
        java.lang.Object writeReplace();
        java.lang.Object readResolve();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written two simple Java classes (one of them containing main(), and the
In general, is it a best practice to have simple POJO Java classes implement
I have a very simple Java RMI Server that looks like the following: import
I have a really simple Java class that effectively decorates a Map with input
I have a simple question about Java's XML API and I hope there's a
I have a simple GUI component written in Java. The class draws an analog
Ok, i have simple scenario: have two pages: login and welcome pages. im using
I develop a project using .jar to reuse code. So I have on .jar
I have a simple WAR project managed by Maven. I have the servlet code
I have a mainActivity which is Customer.java with listview of 5 diff. activities. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.