Hi Peter,

thank you for the suggestion. Yes we are using ant. We already use
some scripting like that to update a build java src. I'm not sure if
we'd add that to the build.xml (because it's autogenerated) but we
could update a static like you suggest.

Any ideas if we can compare the debug key vs. release?

Cheers,
Brady

On Sep 3, 10:24 pm, Pieter <[email protected]> wrote:
> Hello Brady,
>
> I don't know if this is what you are looking for, but if you use
> ant to build your release version you could use the following
> technique:
>
> Config.java:
> public class Config {
>         public static final String BUILD_NAME = "eclipse";
>
> }
>
> build.xml:
> <target name="prepare-full">
>   <property name="product" value="full" />
> </target>
>
> <target name="gather-sources">
> <copy todir="${sources}">
>   <fileset dir="${srcdir}">
>     <include name="com/spectrekking/Config.java" />
>   </fileset>
>   <filterset recurse="false" begintoken="BUILD_NAME = &quot;"
> endtoken="&quot;;">
>     <filter token="eclipse" value="BUILD_NAME = &quot;${product}
> &quot;;"/>
>   </filterset>
> </copy>
> </target>
>
> <target name="build-full" depends="prepare-full,gather-sources,..."/>
>
> This will replace 'BUILD_NAME="eclipse";' with 'BUILD_NAME="full";' in
> Config.java during
> a production build, allowing you to easily check the version. This
> technique can then also
> be used to differentiate between full and light builds (and in our
> case the adc2 version).
>
> Regards,
> Pieter.
>
> On Sep 3, 7:36 pm, Brady <[email protected]> wrote:
>
> > Hi everyone,
>
> > I'm trying to figure out a way to programmatically determine if my
> > build was built in debug mode vs. release mode. I'd like to hide some
> > items in my settings screen if it's release.
>
> > When I build my app in Eclipse I'm building by default in Debug mode.
> > However, when I build the app using the command line, I build it in
> > release mode and sign the app using the jarsigner tool.
>
> > I've tried using
> > PackageInfo appInfo = manager.getPackageInfo("com.adobe.psmobile",
> > PackageManager.GET_SIGNATURES);
> > to test if
> > appInfo.signatures[0].toCharsString()
> > matches my debug signature and that didn't seem to work.
>
> > I'm now trying to see if I can introspect the app's KeyStore, to match
> > the default debug alias described 
> > here:http://developer.android.com/guide/publishing/app-signing.html
> > of "androiddebugkey"
>
> > but I haven't figured out how to retrieve the app's KeyStore yet.
>
> > I'd greatly appreciate it if anyone had any suggestions on how to do
> > this.
> > Thanks in advance!
> > Brady
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to