Skip to content

Httpsurlconn imsinteg prod#5

Open
charlesoj6205 wants to merge 3 commits intomasterfrom
httpsurlconn-imsinteg-prod
Open

Httpsurlconn imsinteg prod#5
charlesoj6205 wants to merge 3 commits intomasterfrom
httpsurlconn-imsinteg-prod

Conversation

@charlesoj6205
Copy link
Copy Markdown

Quickstart is now prod ready with IMS integrated into the shapes app demo.

James Charleson and others added 3 commits April 16, 2026 14:02
…line with updates to HttpsURLConn service layer. V5 endpoint tested successfully. Instructional files within quickstart require further updates. Reverted quickstart to original V1 state with installation message signing changes commented out.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Android Java HttpsURLConnection quickstart and Shapes demo to use the newer Approov service integration pattern (returned/wrapped connection), adds guidance for installation message signing, and aligns documentation/configuration with the updated integration.

Changes:

  • Switch Shapes demo to treat ApproovService.addApproov(...) as returning an HttpsURLConnection to continue using.
  • Add documentation and sample setup hooks for installation message signing.
  • Update Android minSdk to 23 and adjust project wiring to reference an approov-service module.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
shapes-app/settings.gradle Adds :approov-service include and maps it to a local filesystem path.
shapes-app/app/src/main/java/io/approov/shapes/ShapesApp.java Adds commented wiring for installation message signing mutator.
shapes-app/app/src/main/java/io/approov/shapes/MainActivity.java Updates sample to use returned connection from addApproov and reformats handler block.
shapes-app/app/build.gradle Raises minSdk to 23 and adds dependency on :approov-service.
shapes-app/app/.project Eclipse resource filter tweak (regex escaping) and regenerated filter id.
shapes-app/app/.classpath Updates Eclipse JRE container from Java 11 to Java 17.
shapes-app/.settings/org.eclipse.buildship.core.prefs Updates Buildship args/java.home to machine-specific paths.
shapes-app/.project Eclipse resource filter tweak (regex escaping) and regenerated filter id.
SHAPES-EXAMPLE.md Updates guidance for returned connection usage; adds installation message signing section.
SECRETS-PROTECTION.md Updates sample imports to the httpsurlconn package.
REFERENCE.md Updates addApproov signature to return HttpsURLConnection and documents wrapper behavior.
README.md Updates minSdk note to 23 and documents assigning the returned connection from addApproov.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

dependencies {
// implementation 'androidx.annotation:annotation:1.8.2'
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a commented-out dependency left in the dependencies block. Since it has no effect and can be confusing when troubleshooting dependency resolution, consider removing it or adding a brief comment explaining when it is needed.

Suggested change
// implementation 'androidx.annotation:annotation:1.8.2'

Copilot uses AI. Check for mistakes.
Comment thread shapes-app/app/.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Eclipse classpath is being switched to JavaSE-17. This repo’s Gradle wrapper is gradle-7.2, which typically requires running on an older JDK (and AGP 7.1.x is commonly run on JDK 11). Unless the wrapper/AGP are also being upgraded, keeping the project JRE at 11 avoids IDE/Buildship build failures.

Suggested change
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>

Copilot uses AI. Check for mistakes.
//include ':approov-sdk'
include ':app'
include ':approov-service'
project(':approov-service').projectDir = new File('/Users/charlesoj/Developer/Quickstarts/approov-service-httpsurlconn/approov-service')
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

project(':approov-service').projectDir is set to an absolute path under /Users/..., which will break builds for anyone else (CI, other dev machines, different OS). Prefer a repository-relative path (e.g., based on settingsDir) or, better, consume the service via a published Maven dependency instead of a local project reference.

Suggested change
project(':approov-service').projectDir = new File('/Users/charlesoj/Developer/Quickstarts/approov-service-httpsurlconn/approov-service')
project(':approov-service').projectDir = new File(settingsDir, '../approov-service-httpsurlconn/approov-service')

Copilot uses AI. Check for mistakes.
// implementation 'androidx.annotation:annotation:1.8.2'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation project(':approov-service')
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation project(':approov-service') makes the app depend on a Gradle module that is not present in this repository (and is currently mapped via an absolute path in settings.gradle). This will fail for fresh checkouts and CI; switch back to the documented Maven dependency or vendor the module into the repo with a relative path.

Suggested change
implementation project(':approov-service')
implementation 'io.approov:service:+'

Copilot uses AI. Check for mistakes.
Comment on lines +1 to 9
arguments=--init-script /var/folders/d1/7dc4qrgd51v_5zzdcgsm3k0m0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/d1/7dc4qrgd51v_5zzdcgsm3k0m0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle --init-script /var/folders/d1/7dc4qrgd51v_5zzdcgsm3k0m0000gn/T/861a75667e10803d304a058d833cb7404195ca44013d0d61d3b653eb084379b8.gradle --init-script /var/folders/d1/7dc4qrgd51v_5zzdcgsm3k0m0000gn/T/68eb1b6516fe21c6fbba58e63c99c3207ccfc918360613709367eecde56fa77f.gradle --init-script /var/folders/d1/7dc4qrgd51v_5zzdcgsm3k0m0000gn/T/da64152279c70a8b4f3de4ca9ea66fd3b3405b7aca4e1f20f2d08e5593aa1ce1.gradle
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/usr/lib/jvm/java-11-openjdk-amd64
java.home=/Users/charlesoj/Library/Java/JavaVirtualMachines/jbr-17.0.14/Contents/Home
jvm.arguments=
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Buildship prefs file now embeds machine-specific temporary --init-script paths and a user-specific java.home. Committing these values makes the Eclipse/Buildship configuration non-portable and likely to break for other developers. Consider removing these entries (or the whole file) from version control and relying on workspace-local settings instead.

Copilot uses AI. Check for mistakes.
Comment thread SHAPES-EXAMPLE.md
Comment on lines +77 to 78
We pass the `HttpsUrlConnection` to the `ApproovService.addApproov` method and continue with the returned `HttpsURLConnection`. This automatically fetches an Approov token and adds it as a header to the request. It also pins the connection to the endpoint to ensure that no Man-in-the-Middle can eavesdrop on any communication being made.

Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation refers to HttpsUrlConnection, but the actual Java type is HttpsURLConnection (as linked). Using the correct class name here will avoid confusion for readers trying to follow the sample code.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants