It is currently Sat Apr 29, 2017 10:33 am



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Compiler Output With Different SDK Version
Unread postPosted: Wed Mar 29, 2017 10:41 am 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 299
Hi Emile, Hi Nicolas

After decompiling I get this output from the AndroidManifest.xml files

Orginal BASIC!
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="18" />
package="com.rfo.basic"
platformBuildVersionCode="18"
platformBuildVersionName="4.3.1-1425645">
--> OK

Test Version
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" />
package="com.rfo.basicTest"
platformBuildVersionCode="19"
platformBuildVersionName="4.4.2-1456859">
--> OK, because upgraded

RSA
package="com.rfo.noname"
platformBuildVersionCode="22"
platformBuildVersionName="5.1.1-1">
--> ?

Nicolas
package="com.rfo.NetworkBroadcasts"
platformBuildVersionCode="23"
platformBuildVersionName="6.0-2438415">
--> ?


Do you think there is no issue with that?
Some user have trouble with APKs and newer Android versions.
Could it be, that large companies like Samsung or Sony optimise Android for benchmarking with SDK detection?
Or what is the reason behind?

/ Gregor


Report this post
Top
 Profile  
 
 Post subject: Re: Compiler Output With Different SDK Version
Unread postPosted: Wed Mar 29, 2017 11:35 am 
Offline
User avatar

Joined: Sat Oct 04, 2014 5:45 am
Posts: 628
Hi Gregor,

I have no clue on this and the consequences thereof.
What I suspect is that I might be using an older/another version of ApkTool to disassemble and reassemble Basic!
Might even be Aapt ? Nicolas is the expert here.

The 3 versions looks like : KitKat / Lolipop / Marshmellow
Gregor if you experience a hardware problem then I will make test versions with different ApkTool versions to experiment.

Regards
Emile

_________________
Download and tutorial for RFODESIGNER
https://sites.google.com/site/rfodesigner/


Report this post
Top
 Profile  
 
 Post subject: Re: Compiler Output With Different SDK Version
Unread postPosted: Wed Mar 29, 2017 12:29 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5487
Location: Paris, France
How do you get this info Gregor? I'm interested.
Specifically the platformBuildVersionName, I don't get why there's so much difference.
I'm building against Java platform 5, it's very surprising it says 6 and something for Android Compiler APKs.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Compiler Output With Different SDK Version
Unread postPosted: Thu Mar 30, 2017 2:19 am 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 299
Hi Nicolas

mougino wrote:
How do you get this info Gregor? I'm interested.
Specifically the platformBuildVersionName, I don't get why there's so much difference.
I'm building against Java platform 5, it's very surprising it says 6 and something for Android Compiler APKs.

Nicolas


I got the Information over "APK Easy Tool v1.2.exe" and also directly over 7zip.
It should not have to do with my own SDK installation, because i updated to version 7.1.1 (API 25).
What is the reason you build not against platform 4?

/ Gregor


Report this post
Top
 Profile  
 
 Post subject: Re: Compiler Output With Different SDK Version
Unread postPosted: Thu Mar 30, 2017 4:27 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5487
Location: Paris, France
aFox wrote:
What is the reason you build not against platform 4?

My bad, it's a typo, I wanted to say the Compiler builds against Java SDK 5 (JDK 1.5), and not 6 (JDK 1.6), for various reasons.
Java 5 is as old as 2004, I'm almost sure Java 4 is incompatible with Android build-tools (aapt mainly). As of today Google recommends using Java SDK 7 for Android development.

Back to your original question, I did some search on platformBuildVersionCode and platformBuildVersionName (Google is my friend).
First thing first: they are the same information, one in term of number, the other in term of string (like VersionCode and VersionName if you're familiar with).

About their usage, it seems these properties are added by the compiler at time of building. So they reflect the exact Android SDK level the app has been compiled against.

An important info I found here is that the most known and used "targetSdkVersion" property can be different from those:
StackOverflow wrote:
The targetSdkVersion has nothing to do with how your app is compiled or what APIs you can utilize. The targetSdkVersion is supposed to indicate that you have tested your app on (presumably up to and including) the version you specify. This is more like a certification or sign off you are giving the Android OS as a hint to how it should handle your app in terms of OS features.


In almost all cases, "targetSdkVersion" should be higher than any of the other "SDK" properties such as "platformBuildVersionCode" or "compileSdkVersion" for example.

I used the "Stanley" app to dump the Manifest of some APKs installed on my phone and compiled with different tools:

  • Official BASIC! v01.91 (compiled by jMarc on Linux) shows same platformBuildVersionCode and targetSdkVersion at 18

  • The Android Compiler (compiled on WinXP) does not show any platformBuildVersionCode... but the targetSdkVersion is at 18 too (normal)
    Same for several APKs compiled with Quick APK and/or easyapk on my WinXP laptop: no platformBuildVersionCode appears in the Manifest

  • Any app built with the Android Compiler (on Android) should show the platformBuildVersionCode of your actual device.
    On your phone Gregor it shows API 23 (Marshmallow).
    But on my Honor 5X under Marshmallow it actually puts a platformBuildVersionCode of 19!! (KitKat).
    In all cases targetSdkVersion remains at 18, like official BASIC!

The different platformBuildVersionCode in APKs compiled with Android Compiler is most intriguing. I have no idea why my API 23 phone would report a compilation with API 19... I'll have to do some research on that.

Appart from this problem, I'd say that as long as BASIC! and all BASIC-based APKs are relevant in terms of targetSdkVersion, there should be no problem at all.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Compiler Output With Different SDK Version
Unread postPosted: Fri Mar 31, 2017 2:31 am 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 299
Hallo Nicolas,

Thank you for the link to the Stanley App.
Very interesting, I tested some of my Apps. I should uninstall the virus scanner. :evil:
So we can only hope that all the Android os system integrators use the targetSdkVersion and not the better readable platformBuildVersionName.

Maybe in future we should take also a look at the AndroisManifest features.

/ Gregor


Report this post
Top
 Profile  
 
 Post subject: Re: Compiler Output With Different SDK Version
Unread postPosted: Sun Apr 02, 2017 9:47 am 
Offline

Joined: Wed Oct 03, 2012 9:53 am
Posts: 2795
Location: Colorado, U.S.
The platformBuildVersionCode and recognizeplatformBuildVersionName values are in the file build.prop, found in each sdk/platforms/android_xx directory.

android_18/build.prop starts like this:
Code:
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=JB_MR2
ro.build.display.id=sdk-eng 4.3.1 JB_MR2 1425645 test-keys
ro.build.version.incremental=1425645
ro.build.version.sdk=18
That's the only place I've been able to find the components of the string "4.3.1-1425645" that Gregor found in the BASIC! apk.

This interesting file: https://verification.f-droid.org/build-metadata/current_available_platformBuildVersionName.txt has a list of these values. for Android-18:
Code:
android-18/build.prop      android-18:      4.3.1-1425645
android-18/source.properties   platform-18_r03.zip:   4.3.1

What Gregor has shown is that each of us is building to a different API level. That is to say, we're each using a different version of the android.jar file at compile time.

Last time I tried building BASIC! in Eclipse with API 19, I got compile errors. Unfortunately, my Eclipse quit working -- I think having Eclipse and Android Studio share a copy of the Android SDK is causing problems, at least on Ubuntu, where I build BASIC! -- so I can't tell you what breaks.

Yet you guys are all building to 19 and higher. So I tried it in Android Studio, and it builds without error through API 22.

Nicolas is building to API 23! This is interesting for three reasons:
  1. At API 23, Android Studio refuses to load the Apache Commons library and I get lots of errors.
  2. Notification.setLatestEventInfo() has been deprecated for years (API 11, I think), but in API 23 it was removed. You should get compile errors!
  3. API 23 introduced the new permissions management. As long as you target 22 or less, the Android runtime does not enforce the new permissions-handling rules.

What did you do, Nicolas? I know you put a checkPermissions() method in BASIC! on GitHub; is that so you can run with API 23?

All compilers are not created equal: we know that the compiler built into Nicolas's app cannot tolerate annotations in the Java that the compiler in Eclipse accepts. We also know that the compiler in Android Studio takes a lot of new annotations that Eclipse does not accept. Eclipse and Android Studio let you set a Java compatibility level in the compiler. Apps that run on Android probably don't have that flexibility -- you get whatever is built into the app. (Somewhere I wrote about changing the android.jar in AIDE, but I think they changed AIDE so you can't do that any more.)

I still can't answer Gregor's question. Certainly the Android runtime has optimizations based on SDK API level detection. The Google docs talk about "enabling compatibility behaviors", but I don't know much about them.

- Marc


Report this post
Top
 Profile  
 
 Post subject: Re: Compiler Output With Different SDK Version
Unread postPosted: Sun Apr 02, 2017 11:22 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5487
Location: Paris, France
jMarc wrote:
Nicolas is building to API 23! This is interesting for three reasons:
  1. At API 23, Android Studio refuses to load the Apache Commons library and I get lots of errors.
  2. Notification.setLatestEventInfo() has been deprecated for years (API 11, I think), but in API 23 it was removed. You should get compile errors!
  3. API 23 introduced the new permissions management. As long as you target 22 or less, the Android runtime does not enforce the new permissions-handling rules.

What did you do, Nicolas? I know you put a checkPermissions() method in BASIC! on GitHub; is that so you can run with API 23?

- Marc

I don't think I build at API 23. The only API 23 mentioned above is out of Gregor's compilation.
On my side the higher is API 19 from the Android Compiler.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Compiler Output With Different SDK Version
Unread postPosted: Sun Apr 02, 2017 11:27 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5487
Location: Paris, France
More specifically Gregor mentions that "com.rfo.NetworkBroadcasts" shows an API 23.
I do not know this package name, I suppose it is one of Gregor's apps?
I guess my name appears in Gregor's post next to this because he compiled it with the Android Compiler?

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Compiler Output With Different SDK Version
Unread postPosted: Mon Apr 03, 2017 2:39 am 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 299
Quote:
I like to think (hope? pretend?) that programmers are more logical than most Americans.


The Fact is, if we compile with Eclipse, Android Studio, Nicola's or Emile's compiler, we get the right "targetSdkVersion".
The alternative fact is, compiling with Nicola's or Emile's compiler, we get Platform 22 or 23 "platformBuildVersionCode".

The question is: "Who interprets the AntroidManifest.xml the Jornalist or the Administration in a maybe Samsung- or Sony modified OS?"

/Gregor


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred