A Rust backend that discovers Android projects under configured roots, builds one on request, and serves the APK over pinned TLS on a WireGuard interface; an Android client that lists what is buildable, watches a build, and installs the result. Enrolment carries the token and the CA, so the phone trusts exactly the machine that issued it and nothing else. `AGENTS.md` is the working guide and `README.md` the configuration reference. The shared tunnel-and-TLS code lives in `vendor/wg-app-link`, which ai-app uses too. History before this point was squashed away, and a stale `config.json` went with it: nothing had read that file since the config moved to RON outside the checkout, and what it still held was one machine's absolute paths and the names of projects on it.
64 lines
2.4 KiB
Java
64 lines
2.4 KiB
Java
package com.example.dutest.stub;
|
|
|
|
import android.app.Activity;
|
|
import android.content.pm.PackageInfo;
|
|
import android.os.Bundle;
|
|
import android.view.Gravity;
|
|
import android.widget.TextView;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Locale;
|
|
|
|
/**
|
|
* The whole of every test app: one screen naming which app this is and when
|
|
* the installed copy landed.
|
|
*
|
|
* One class shared by all of them rather than one per project, because what
|
|
* differs between the test projects is what Dev Updater has to *do* with
|
|
* them -- how many variants they build, whether the build fails, whether
|
|
* they declare a service -- and none of that is a difference in the app.
|
|
* The manifest names this class fully qualified, so each APK can carry its
|
|
* own application id while the code keeps one package.
|
|
*
|
|
* It shows lastUpdateTime deliberately: that is the exact value Dev
|
|
* Updater's freshness check compares an APK's mtime against, so the screen
|
|
* shows what the card is reasoning about rather than a separate version
|
|
* string that could agree with it by luck.
|
|
*/
|
|
public class StubActivity extends Activity {
|
|
@Override
|
|
protected void onCreate(Bundle state) {
|
|
super.onCreate(state);
|
|
TextView view = new TextView(this);
|
|
view.setGravity(Gravity.CENTER);
|
|
view.setTextSize(20f);
|
|
view.setLineSpacing(0f, 1.3f);
|
|
view.setPadding(64, 64, 64, 64);
|
|
// Catppuccin Mocha Base and Text, matching the updater's own theme
|
|
// so a screenshot of one does not look like a different machine.
|
|
view.setBackgroundColor(0xFF1E1E2E);
|
|
view.setTextColor(0xFFCDD6F4);
|
|
view.setText(describe());
|
|
setContentView(view);
|
|
}
|
|
|
|
private String describe() {
|
|
CharSequence label = getApplicationInfo().loadLabel(getPackageManager());
|
|
return label + "\n\n" + getPackageName() + "\n\ninstalled " + installedAt();
|
|
}
|
|
|
|
/**
|
|
* When the package manager says this copy was installed, or why that
|
|
* could not be read -- never a stand-in that reads like an answer.
|
|
*/
|
|
private String installedAt() {
|
|
try {
|
|
PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), 0);
|
|
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US)
|
|
.format(new Date(info.lastUpdateTime));
|
|
} catch (Exception failure) {
|
|
return "unknown (" + failure.getClass().getSimpleName() + ")";
|
|
}
|
|
}
|
|
}
|