123197896: The last-released API file is the wrong one

Fix the sorting of signature files.

Bug: 123197896
Test: Manual: Verified that the contents of
out/soong/.intermediates/prebuilts/sdk/last-released-public-api/gen/last-released-api.txt
is the same as 28/public/api/android.txt (after deleting 29/*, done
separately)

Change-Id: I08b90bffe423c484dda11421d69b7c669124dbca
diff --git a/Android.bp b/Android.bp
index 607e8c1..aa82d70 100644
--- a/Android.bp
+++ b/Android.bp
@@ -32,7 +32,7 @@
     srcs: [
         "*/public/api/android.txt",
     ],
-    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -n | tail -1) $(genDir)/last-released-api.txt",
+    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -t/ -k3 -n | tail -1) $(genDir)/last-released-api.txt",
     out: [
         "last-released-api.txt",
     ],
@@ -43,7 +43,7 @@
     srcs: [
         "*/system/api/android.txt",
     ],
-    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -n | tail -1) $(genDir)/last-released-api.txt",
+    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -t/ -k3 -n | tail -1) $(genDir)/last-released-api.txt",
     out: [
         "last-released-api.txt",
     ],
@@ -54,7 +54,7 @@
     srcs: [
         "*/public/api/android.txt",
     ],
-    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -n | tail -2 | head -1) $(genDir)/last-released-api.txt",
+    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -t/ -k3 -n | tail -2 | head -1) $(genDir)/last-released-api.txt",
     out: [
         "last-released-api.txt",
     ],