init
This commit is contained in:
commit
18f15741a7
5 changed files with 81 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
build
|
||||||
21
AndroidManifest.xml
Normal file
21
AndroidManifest.xml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:compileSdkVersion="34"
|
||||||
|
package="com.example.shadowing">
|
||||||
|
<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="34"/>
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:supportsRtl="true"
|
||||||
|
android:label="Shadowing">
|
||||||
|
<activity android:name=".MainActivity"
|
||||||
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
|
|
||||||
12
build.sh
Normal file
12
build.sh
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
javac -classpath ~/Android/Sdk/platforms/android-34/android.jar java/classes/com/example/shadowing/MainActivity.java -d build/
|
||||||
|
d8 --classpath ~/Android/Sdk/platforms/android-34/android.jar build/com/example/shadowing/MainActivity.class --output build/
|
||||||
|
mkdir -p build/apk_files/
|
||||||
|
cp build/classes.dex build/apk_files/
|
||||||
|
~/Android/Sdk/build-tools/34.0.0/aapt package -v -f -M AndroidManifest.xml -I ~/Android/Sdk/platforms/android-34/android.jar -F build/app.apk build/apk_files/
|
||||||
|
keytool -genkeypair -validity 1000 -dname "CN=SomeKey,O=SomeOne,C=FR" -keystore build/ToyKey.keystore -storepass 'P@ssw0rd!' -keypass 'P@ssw0rd!' -alias SignKey -keyalg RSA -v
|
||||||
|
~/Android/Sdk/build-tools/34.0.0/zipalign -f 4 build/app.apk build/app.aligned.apk
|
||||||
|
~/Android/Sdk/build-tools/34.0.0/apksigner sign -ks ToyKey.keystore --v2-signing-enabled true --in app.aligned.apk --out app.signed.apk --ks-pass 'pass:P@ssw0rd!'
|
||||||
|
|
||||||
|
~/Android/Sdk/platform-tools/adb install app.signed.apk
|
||||||
|
~/Android/Sdk/platform-tools/adb shell am start -n com.example.shadowing/.MainActivity
|
||||||
|
~/Android/Sdk/platform-tools/adb uninstall com.example.shadowing
|
||||||
20
flake.nix
Normal file
20
flake.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
description = "APKs demonstrating class shadowing.";
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
|
||||||
|
flake-utils.url = github:numtide/flake-utils;
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
|
let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in rec {
|
||||||
|
|
||||||
|
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
packages = [ pkgs.hello ];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
;
|
||||||
|
}
|
||||||
27
java/classes/com/example/shadowing/MainActivity.java
Normal file
27
java/classes/com/example/shadowing/MainActivity.java
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.example.shadowing;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
//import android.widget.RelativeLayout;
|
||||||
|
//import android.view.ViewGroup;
|
||||||
|
//import android.view.View;
|
||||||
|
|
||||||
|
public class MainActivity extends Activity {
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
LinearLayout ll = new LinearLayout(this);
|
||||||
|
ll.setOrientation(LinearLayout.VERTICAL);
|
||||||
|
ll.generateViewId();
|
||||||
|
setContentView(ll);
|
||||||
|
TextView tw = new TextView(this);
|
||||||
|
tw.setText("Hello Void!");
|
||||||
|
tw.generateViewId();
|
||||||
|
ll.addView(tw);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue