Is my APK running in ChromeOS (ARC)? How to tell. - Chromebooks

[Update: See the bottom of this post for what's apparently Google's own solution.]
Back in the days of the first incarnation of the Apt Runtime on Chrome (I guess that was the first ARC), it was suggested you could tell an android app if it was running in the chromeOS:
If you need to check if your app is running on Chrome OS, look for chromium as the android.os.Build.BRAND and android.os.Build.MANUFACTURER.
Click to expand...
Click to collapse
This seems to have been S-canned. as these evaluate to "google" and "google" respectively. "google"/"google" doesn't seem to be a consistent, unique name for only Android-on-Chrome on all device, especially as the Pixel C (a phone) uses "google/Google" (capital "G") which isn't exactly the same, but is close enough.
For fun, I dumped Build.BRAND, Build.MANUFACTURER, Build.DEVICE, Build.PRODUCT, Build.MODEL, and Build.BOARD for my Chromebook Pro, as outputted by a Log.e():
07-02 00:25:08.735 8407 8407 E : Brand google
07-02 00:25:08.735 8407 8407 E : Manufacturer google
07-02 00:25:08.735 8407 8407 E : Device caroline_cheets
07-02 00:25:08.735 8407 8407 E : Product caroline
07-02 00:25:08.735 8407 8407 E : Model Samsung Chromebook Pro
07-02 00:25:08.735 8407 8407 E : Board caroline
"Caroline_cheets"? That's a weird name for the board... wonder who caroline is... well I've also learned a few more device names:
kevin_cheets -- the Samsung Chromebook Plus
minnie_cheets -- Asus Chromebook Flip C 100PA
samus_cheets - Chromebook Pixel (2015)
tiger_cheets - AOpen RK3288 10" Chromebase
fievel_cheets -- AOpen RK3288 Mini Chromebox Mini
cyan_cheets -- Acer Chromebook R11 (C738T)
Some of these seem to be the same devices that are announced to have Android. Anyone have any idea what the device names refer to? Tiger and Feivel are characters from An American Tail. But anyway...
Does the _cheets in the device name mean that it has android support? Probably not a long-term solution, but it might work for current devices (?)
Update: Looks like I'm not so far off. Google themselves are checking for this! Here's their ArcCheck:
Code:
public static boolean isInArc() {
return Build.DEVICE != null && Build.DEVICE.matches(ARC_DEVICE_PATTERN);
}
where:
Code:
private final static String ARC_DEVICE_PATTERN = ".+_cheets";
Another proposed solution in stackoverflow is to check if
Code:
context.getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
Haven't tried it yet to see if it works.

Update to my update... Google has updated their code, and there is a more comprehensive check described here.

Related

FolioTNTmod 0.4 - Issues and bugs

This thread should be used for bugreporting and troubleshooting.
FolioTNTmod 0.4 ONLY.
Please make sure to post a detailed description of the issue, under what curcumstances it occures, and which processes are running.
Use the search function to make sure your issue hasn't already been solved before you post.
I've found a way to access Accounts Sync and Keyboard installation.
first, Accounts Sync :
- you must install LauncherPro even if you do not use it.
- On the desktop, add a new shortcut, select "Activities".
- Under "Account Settings and Sync" select "com.android.settings.ManageAccountsSettings.
Well, now you have a shortcut on the desktop to access the sync settings.
Keyboard installation :
After installing your alternative keyboard, copy the APK from /data/app/ to /system/app/
I create a simple script (in Gscript) that mount the file system as read/write , copy the APK, and enable the "SmartKeyboardPro" keyboard (after reboot).
code :
Code:
su
mount -o remount,rw /dev/block/mmcblk0p1 /system
cp /data/app/net.cdeguet.smartkeyboardpro-1.apk /system/app/
**optional**
reboot
**optional**
I was playing with Angry birds and after a reboot the application was corrupted in some way, the icon dissapeared and I had to reinstall, but the configuration was saved.
In anycase I used Angry Birds backup to backup it and after Andexplorer to copy the backup from the internal SD to the external one, to my surprise, the internal one was not present on Andexplorer (but I was able to go trought /mnt/sdcard).
Now I can see it again but there are a lot of files DiskCacheIndexxxxx.tmp, any clues?
julio77 said:
Keyboard installation :
After installing your alternative keyboard, copy the APK from /data/app/ to /system/app/
I create a simple script (in Gscript) that mount the file system as read/write , copy the APK, and enable the "SmartKeyboardPro" keyboard (after reboot).
Click to expand...
Click to collapse
Yeah, thank you for this tweak
Orientation has some problems..
getWindowManager().getDefaultDisplay().getRotation()
should return 0, when Orientation is setted to Landscape...
but it returns Surface.ROTATION_90.
(I'm using 0.4a version)
Davide
This is intended behaviour. It fixes the sensor issues for many applications, as developers didn't prepare their apps for devices with natural orientation set to landscape.
Is this causing any problems for you?
Thank you for your reply.
I'm developing an android game that uses accelerometer to evaluate gravity force's vector. I would like to write portable code (to work on both phones and tablets), so the right code to evaluate gravity (ignoring other forces) should be:
screenRotation = getWindowManager().getDefaultDisplay().getRotation();
[...]
float x;
float y;
float z;
if (screenRotation == Surface.ROTATION_0) // Default portrait
{
x = event.values[0];
y = event.values[1];
} else if (screenRotation == Surface.ROTATION_90) // Default landscape
{
x = -event.values[1];
y = event.values[0];
} else if (screenRotation == Surface.ROTATION_180)
{
x = -event.values[0];
y = -event.values[1];
} else// (screenRotation == Surface.ROTATION_270)
{
x = event.values[1];
y = -event.values[0];
}
z = event.values[2];
gravity.x = -x;
gravity.y = -y;
gravity.z = -z;
This should be the right way to ensure portability.. (it's similar to the Nvidia 'Android Accelerometer Whitepaper''s way),
but it's not working with this patch on Folio (y results in reverse, and rotation sensibility is weird)..
So, to ensure compatibility to games coded only for portrait-native oriented (and, in the same time, ensure correctness to the right written codes), it is not enough to return Surface.ROTATION_90 on landscape orientation, but it should emulate it reversing the values returned by onSensorChanged(SensorEvent event).
In other words,
(EMULATED)event.values[0] = (ORIGINAL)event.values[1]
(EMULATED)event.values[1] = -(ORIGINAL)event.values[0]
The patch should do that. Could you verify that on FolioMod? Maybe something got broken when this was ported to tnt.
Also the Nvidia whitepaper states the following for rotating the values:
90°
x = -v[1]
y = -v[0]
180°
x = -v[0]
y = v[1]
270°
x = v[1]
y = v[0]
Also, please check if you are using the newer API for listning to events (the one that uses SensorEventListener) The legacy Api handles rotations by itself, so you should not handle this in your code.
Yes, I'm using SensorEventListener.
weeds2000 said:
Also the Nvidia whitepaper states the following for rotating the values:
90°
x = -v[1]
y = -v[0]
180°
x = -v[0]
y = v[1]
270°
x = v[1]
y = v[0]
Click to expand...
Click to collapse
This is the canonicalToScreen transform for rotating values,
for screen coordinates, increasing y is down (so I'm using world transform).
Sure that the returned value are (for every rotation angle) these:
(EMULATED)event.values[0] = (ORIGINAL)event.values[1]
(EMULATED)event.values[1] = -(ORIGINAL)event.values[0]
?
To understand if it's a my mistake, I've downloaded a free app from the market, JumpyBall 3D Lite, and I noticed that also in this game tilt behaviour is reversed in one direction (could someone test it on the FolioMod?)..
I've checked the code, and yes in the last version for the fix the accelerometer values are rotated in the correct way:
Code:
switch ( sensor.getType() ) {
// ...
case Sensor.TYPE_ACCELEROMETER: {
if ( legacy == false ) {
valuesOut[0] = valuesIn[1];
valuesOut[1] = -valuesIn[0];
}
break;
}
}
However there was an issue with the first release of the fix, as my portrait testgame was using legacy API, and therefore values were somewhat broken.
Maybe only the first version of the patch is in TNT?
By the way, the code that was modified for the fix has been posted in the kernel and tweaks thread. You should be able to verify that TNT has the correct version of the fix or be able to create a patch for TNT. (Do not try to flash the update, it will most certainly break your framework.jar)
Edit:
JumpyBall 3D is working as expected on FolioMod, therefore i think TNT only has the first revision of the patch included.
Ok, thank you!!
Problems
Thanks for a great ROM...
I have a few problems.. Hope someone can help:
Some applications like NFS:Shift and Grooveshark can't access the internet..
Contacts gives a FC..
I can't seem to sync contacts and calendar from my exchange sync.. I can choose to do so, by entering the sync & accounts through pro launcher, but I can't enable sync, so only email works..
I think that was it for now...
Hope someone can help
***Update***
I got contact and calendar sync to work by installing the contacts application from FolioMod and the Calendar app from The TnT Lite mod from Viewsonic...

[Q] Modem with oFono/oFono-ril?

Hi Guys,
what do you think, is it possible (would be possible) to use oFono/ofono-ril for the modem for our Wave? In theory oFono could be used with any modem that supports standard AT commands...
More info here: http://ofono.org/ and here http://gitorious.org/android-n900/ofono-ril/trees/gingerbread
Sadly Wave's CP doesn't support most of standard AT commands. :[
Rebellos said:
Sadly Wave's CP doesn't support most of standard AT commands. :[
Click to expand...
Click to collapse
heja Rebellos, dzieje się coś ciekawego w tej materii czy raczej możemy zapomnieć o andku na W 2 ?
pozdro z mazowsza
AT+CALC
Code:
Polecenie (tryb AT):
AT+CLAC
Odpowiedź:
AT+CLAC
&C
&D
&E
&F
&S
&V
&W
E
I
L
M
Q
V
X
Z
T
P
\Q
\S
\V
%V
D
A
H
O
S0
S2
S3
S4
S5
S6
S7
S8
S9
S10
S11
S30
S103
S104
+ICF
+IFC
+IPR
+GMI
+GMM
+GMR
+GCAP
+GSN
+DR
+DS
+WS46
+SYNCML
+BATGETLEVEL
+BATUPDATE
+BATGETTABLE
+UPLOADUNSET
+CRLP
+CV120
+CSSN
+CREG
+CGREG
+CFUN
+GCAP
+CSCS
+CSTA
+CR
+CEER
+CRC
+CMEE
+CGDCONT
+CGDSCONT
+CGTFT
+CGEQREQ
+CGEQMIN
+CGQREQ
+CGQMIN
+CGEREP
+CGPADDR
+CGDATA
+CGCLASS
+CGSMS
+CSMS
+CMGF
+CSAS
+CRES
+CSCA
+CSMP
+CSDH
+CSCB
+FDD
+FAR
+FCL
+FIT
+ES
+ESA
+CMOD
+CVHU
+ACSENSOR
+RTCCTEST
+KEYSHORT
+PROXIMIT
+GEOMAGSS
+FIRMVERS
+APPINSTALL
+APPUNINSTALL
+APPLAUNCH
+TKSHELL
+CSQ
+CBC
+CPAS
+CPIN
+CMEC
+CKPD
+CIND
+CMER
+CGATT
+CGACT
+CGCMOD
+CPBS
+CPBR
+CPBF
+CPBW
+CPMS
+CNMI
+CMGL
+CMGR
+CMGS
+CMSS
+CMGW
+CMGD
+CMGC
+CNMA
+CMMS
+FTS
+FRS
+FTH
+FRH
+FTM
+FRM
+CHUP
+CCFC
+CCUG
+COPS
+CLCK
+CPWD
+CPWC
+CUSD
+CAOC
+CACM
+CAMM
+CPUC
+CCWA
+CHLD
+CIMI
+CGMI
+CGMM
+CGMR
+CGSN
+CNUM
+CCLK
+CLVL
+CMUT
+CLCC
+COPN
+CPOL
+CPLS
+CTZR
+CCWE
+CTZU
+CLAC
+CLIP
+COLP
+CSGT
+CRMP
+CDIP
+CTFR
+CLIR
$QCSIMSTAT
$QCCNMI
$QCCLR
$QCDMG
$QCDMR
$QCDNSP
$QCDNSS
$QCTER
$QCSLOT
$QCPINSTAT
$QCPDPP
$QCPDPLT
$QCPWRDN
$QCDGEN
$BREW
$QCSYSMODE
$QCCTM
$SUSBC
$NWMDCHNG
$SHPSLEEP
Is it helpful?
nie dajcie umrzec temu projektowi nie dajcie
That's bad news if the CP doesn't support most of the standard AT commands... So this doesn't help at all?
anghelyi said:
Hi Guys,
what do you think, is it possible (would be possible) to use oFono/ofono-ril for the modem for our Wave? In theory oFono could be used with any modem that supports standard AT commands...
More info here: http://ofono.org/ and here http://gitorious.org/android-n900/ofono-ril/trees/gingerbread
Click to expand...
Click to collapse
What you're saying just doesn't make sense. Why would you wanna use a oFono RIL on a Samsung device?
The RIL is just used to channel (and translate) android java phone/sim/modem related commands to the lower hardware layer on/for the radio processor. Thus the vendor RIL need to apply to the hardware of THAT vendor (i.e.Samsung). Why re-invent the wheel?
Now, there are some exceptions due to the fact that the RIL code is fairly closed source (although GPL'd AFAIK ==> should be released), that there are some project(s) that would like to make a "Free RIL"...
BTW. All GSM modems support the "standard AT set" (or your phone would probably not work!) The tricky part is how to access it from outside the AOS & RIL. But that's another topic.
E:V:A said:
What you're saying just doesn't make sense. Why would you wanna use a oFono RIL on a Samsung device?
Click to expand...
Click to collapse
I don't get your point... oFono is a platform agnostic library for mobile apps, with a lot of supported modems (even with standard AT command support) and oFono RIL is a RIL implementation based on it. Why not to use it?If it works with the N9 why not try to build it for Wave?
E:V:A said:
Now, there are some exceptions due to the fact that the RIL code is fairly closed source (although GPL'd AFAIK ==> should be released), that there are some project(s) that would like to make a "Free RIL"...
BTW. All GSM modems support the "standard AT set" (or your phone would probably not work!) The tricky part is how to access it from outside the AOS & RIL. But that's another topic.
Click to expand...
Click to collapse
RIL isn't GPL, it's Apache License, like most of Android platform, so doesn't have to be released.
Yea, there actually are handlers for AT cmds inside of AMSS, but modem initialization, nor any more advanced usage can't be done with these alone.
Rebellos said:
RIL isn't GPL, it's Apache License, like most of Android platform, so doesn't have to be released.
Yea, there actually are handlers for AT cmds inside of AMSS, but modem initialization, nor any more advanced usage can't be done with these alone.
Click to expand...
Click to collapse
Rebellos, how this works? like.. the modem access is through AT and then call for the other things?
anghelyi said:
I don't get your point... oFono is a platform agnostic library for mobile apps, with a lot of supported modems (even with standard AT command support) and oFono RIL is a RIL implementation based on it. Why not to use it?If it works with the N9 why not try to build it for Wave?
Click to expand...
Click to collapse
Dammit! You're absolutely right. I did the classical error of not "following the f%&ing links" before posting! So I have obviously confused the oFono project with a completely different one... Actually this seem to be a very cool project! We should try to get some of these guys involved over here or vice verse.
anonimo1w said:
Rebellos, how this works? like.. the modem access is through AT and then call for the other things?
Click to expand...
Click to collapse
Try to be a little more specific. On many platforms the phone application processor (UI/UX) does much of its normal communication (phone calls, sms, sim etc) to/from the baseband processor (modem) via an AT interface. However, in many cases this AT interface is "embedded" in other transport layers like IPC, I2C or what have you. In addition, the actual physical control mechanisms (like putting modem to sleep/wake up, power save, RF power, booting, test modes etc.) are usually done through GPIO or other forms of UART. Honestly, it's quite a mess to explain, because there are many variations on how this is handled. (That's why they needed the RIL in the first place.) Finally, since I don't have a Wave, I don't know how that is done. I just know they use a Qualcomm modem... and some of their manuals are available.
In modern SHP based phones hierarchy of transport layers is like:
1) oneDRAM
2) SHP IPC protocol with packet types listed below: (as per Samsung Jet S8000)
Code:
typedef enum
{
FIFO_PKT_NONE = 0, // 0
FIFO_PKT_KEY, // 1
FIFO_PKT_SIM, // 2
FIFO_PKT_PROTO, // 3
FIFO_PKT_TAPI, // 4
FIFO_PKT_PHONESTATUS, // 5
FIFO_PKT_FILE, // 6
FIFO_PKT_LCD, // 7
FIFO_PKT_LED, // 8
FIFO_PKT_SOUND, // 9 Sound means voice here
FIFO_PKT_SOUND_DATA, // 10
FIFO_PKT_H324M, // 11
FIFO_PKT_AMR_DATA, // 12
FIFO_PKT_AMR_CTRL, // 13
FIFO_PKT_CLOCK, // 14
FIFO_PKT_BOOT, // 15
FIFO_PKT_FLIP, // 16
FIFO_PKT_SYSTEM, // 17
FIFO_PKT_USBPROTO, // 18
FIFO_PKT_USBFILE, // 19
FIFO_PKT_USBDIAG, // 20
FIFO_PKT_IRDAPROTO, // 21
FIFO_PKT_IRDAFILE, // 22
FIFO_PKT_IRDADIAG, // 23
FIFO_PKT_TIMER, // 24
FIFO_PKT_DEBUG, // 25
FIFO_PKT_DIAGNOSE, // 26
FIFO_PKT_SPECIAL_BOOT, // 27
FIFO_PKT_CALL_TIME, // 28
FIFO_PKT_ALARM, // 29
FIFO_PKT_FIFO_INTERNAL,// 30
FIFO_PKT_USBCRCPROTO, // 31
FIFO_PKT_USBCRCFILE, // 32
FIFO_PKT_USBCRCDIAG, // 33
FIFO_PKT_VIBRATOR, // 34
FIFO_PKT_AMLED, // 35 AppMgr LED
FIFO_PKT_AMVIB, // 36 AppMgr Vibrator
FIFO_PKT_AMLCD, // 37 AppMgr LCD Backlight
FIFO_PKT_DATA_PCSYNC,
FIFO_PKT_CTRLCMD_PCSYNC,
FIFO_PKT_DATA_WSSSYNC,
FIFO_PKT_TIME, // 41 TimeMgr
FIFO_PKT_DVB_H_CAS_SIM, // 42 DVB-H CAS SIM
FIFO_PKT_DVB_H_CAS_TEST,// 43 DVB-H CAS Test module.
FIFO_PKT_DVB_H_CAS, // 44 DVB-H CAS Common usage.
FIFO_PKT_DVB_H_CAS_IPS, // 45 DVB-H CAS IPS usage.
FIFO_PKT_DVB_H_DebugLevel, //46 receive debug level from MSM
FIFO_PKT_Forced_Assert, // 47
FIFO_PKT_MEMORY, // 48
FIFO_PKT_NV, // 49 // NvMgrLite
FIFO_PKT_LBS, // 50 LBS
FIFO_PKT_SIM_JSR177, // 51 S8000_JSR177_kjseo
FIFO_PKT_USER = 0x80,
FIFO_PKT_DVBH = FIFO_PKT_USER + 0x06,
FIFO_PKT_DVBH_SVC,
FIFO_PKT_DVB_H_LAYER1,
FIFO_PKT_DVB_PLAYER,
FIFO_PKT_AV_PLAYER,
FIFO_PKT_PH, // BB -> MM : Protocol Handler FIFO Type
FIFO_PKT_PH_LITE, // MM -> BB : Protocol Handler Lite FIFO Type
FIFO_PKT_FX = 0x90,
FIFO_PKT_BLUETOOTH ,
FIFO_PKT_TESTMODE, // Testmode
FIFO_PKT_DRV, // driver
FIFO_PKT_AGENT,
FIFO_PKT_DEVMGR,
FIFO_PKT_SECUREBOOT,
FIFO_PKT_MAX
} FifoType;
In Wave there are also few "service" packets added. Not sure for what are these.
Actually while in intialization of modem there are used SECUREBOOT, FM (direct access to Bada file system by CP), IPC_PACKET (not listed here or named differently) BOOT, SIM (managing sim contacts and logging) and some others. Packets that are managing telephony are PROTO and TAPI (telephony API)
TAPI packets does split into few subtypes
TAPI_TYPE_CALL = 0 //53 subtypes
TAPI_TYPE_NETTEXT = 1 //around 10 subtypes
TAPI_TYPE_NETWORK = 2 //23 subtypes
TAPI_TYPE_SS = 3 //48 subtypes
TAPI_TYPE_AT = 4 //34 subtypes
TAPI_TYPE_DMH = 5 //n subtypes, called API_IDs (must be nonzero)
TAPI_TYPE_CONFIG = 6 //n subtypes, called API_IDs (must be nonzero)
Click to expand...
Click to collapse
TAPI layer splits into contexts, which might be called "channels" for managing telephony functions
CALL (3 max)
NETTEXT (SMS/MMS, few allowed)
NETWORK (up to one)
SS (security related AFAIR)
AT (this is probably route of AT commands)
Click to expand...
Click to collapse
modem
i dont know this part but i want to know wave s8500 modem work or not ics 4.0.4?
yasotharan13 said:
i dont know this part but i want to know wave s8500 modem work or not ics 4.0.4?
Click to expand...
Click to collapse
stop annoying everyone!! it's not working yet!!

Invalid Android ID (aid:0)

Hi guys...
Since few weeks now, i'm facing to an unsolvable trouble that prevent me to access to google play (with the famous error "No Connexion"). I spent hard time to search why, tried some fixes found on the web... Nothing works.
This morning, i found with the Android Device-ID application that my "GSF Device-ID" is set to "null" ! Said differently, i'm pretty sure that my device (Samsung Galaxy S2) can't be recognized and identified on Play store because of this, giving me the "No Connexion" error.
Does anybody here know how i could fix this invalid ID (which is confirmed with the *#*#8255#*#* trick : aid:0 (INVALID AID!!!)
Thanks in advance for your help.
cheers
UP.
Nobody can help ? i can't believe it according to the number of gurus here
I am more and more convinced that the secret of this famous GSF ID is jealously guarded by its creators, and finally how to handle it are not or little known ... And for good reason, since this is for Google one of the only way to identify and thus tracking devices safely and reliably. Make it easily editable would be a disaster for them I guess ...
I still dare to hope that some geniuses who frequent this forum have already faced this problem and had pierced the mystery and how to handle this identifier.
I found the beginning of an answer with the sources code of an app "Android ID" :
Code:
private static final Uri URI = Uri.parse("content://com.google.android.gsf.gservices");
private static final String ID_KEY = "android_id";
String getAndroidId(Context ctx) {
String[] params = { ID_KEY };
Cursor c = ctx.getContentResolver()
.query(URI, null, null, params, null);
if (!c.moveToFirst() || c.getColumnCount() < 2)
return null;
try {
return Long.toHexString(Long.parseLong(c.getString(1)));
} catch (NumberFormatException e) {
return null;
}
}
In my case, i get a "null" for GSFID. That means no columns are found in reply to the query.
I have verified this by installing aSQLiteManager on my SGS2, and opening the gservices.db database.
My problem now is to find what are the key fields
that are supposed to be filled in order to have a GSF value returned.
Maybe some of you could provide me this information by having a look to your own configuration.
Thanks in advance.
I've got same problem
My phone is LG Optimus L5 and after I rooted my phone,I've got same problem and I couldn't connect to Google products and my AID's been null!

[LineageOS][OTA][PHP] Open Source REST Server for you

Hi guys,
today I would like to present to you a simple project that was born on this thread to accomplish a very simple task: since there are thousand of Custom ROMs around here, so much of them are LineageOS based, and because of this their forced to build every time all the ROM and post updates here. Users are also forced to check if their preferred ROM was updated or not. That's why I decided to understand how LineageOS OTA Updater System App works. Because of this I've wrote a simple REST Server API emulation that fully works with your ROM (if integrated of course). How? Continue reading down here.
How does it work?
Of course is as simple as it should be. Clone the repo (is a simple PHP website that you can host on any shared hosting*/VPS that you like) and upload it into your preferred hosting. That's it. If you point your web browser to that address the App is already working.
After, you have to upload all your build to the _builds/ folder, and you're done.
The two already working calls /api and /api/v1/build/get_delta should answer correctly the updater app to make it work (remember that visiting it as a browser is not sufficent).
How to integrate it with my ROM?
You have two options:
- Declare cm.updater.uri on your own build.prop file with the value of you own server URL where you have deployed it (This can be done also by the user with any Android App from the Market)
- Replace the string conf_update_server_url_def value inside values.xml of the OTA App source code (COMPILE TIME ONLY!)
Which builds does it support?
Anything that will be borned by the official guide on how to build your custom LineageOS ROM! So, in poor words will be: stable, rcs, nightly and snapshots (likely called EXPERIMENTAL), from CM7 to CM14.
Delta updates SHOULD work too. Just try it and tell me if they works
How can I debug it?
You can use this simple UnitTest that I've already pushed into my GitHub. Feel free to use it everytime you need. It's based upon NodeJS and Unirest.
Is it free?
"Free software is a matter of liberty, not price. To understand the concept, you should think of free as in free speech, not as in free beer."
—Richard Stallman
Click to expand...
Click to collapse
Use it as you want, do anything you want with it as it's MIT licensed.
Is it free of bugs?
That's why I'm here Only you can help me to squash all the remaining bugs!
I hope this will be useful to anyone of you, helping the ROM community providing a simple OTA updater that already works on LineageOS official ROMs.
Greets.
---
Project Home: https://github.com/julianxhokaxhiu/LineageOTA
More about the study: http://blog.julianxhokaxhiu.com/how-the-cm-ota-server-works-and-how-to-implement-and-use-ours
Changelog Build Scripts ( thanks to @Deltadroid ): https://github.com/syphyr/cm_build_scripts/blob/master/make_changelog
* On a Shared Hosting you can ONLY provide a FULL ROM download, NOT DELTAs!
---
Donators:
- @BlueFlame4 x2
Hey, I'm having trouble using your docker image behind a Nginx https reverse proxy. The server is correctly answering the requests:
Code:
{
"id":null,
"response":[
{
"incremental":"",
"api_level":"",
"url":"http:\/\/MYDOMAIN\/\/builds\/full\/lineage-17.1-20200830-UNOFFICIAL-lavender.zip",
"timestamp":1598774045,
"md5sum":"718fb89f935b979edd57b2642234d1fa",
"changes":"",
"channel":"unofficial",
"filename":"lineage-17.1-20200830-UNOFFICIAL-lavender.zip",
"romtype":"unofficial",
"datetime":1598774045,
"version":"17.1",
"id":"50533a894b2ab0d9b2711444ca4f2b530a8ff2389723ea2bd7ada6e029599e2c",
"size":914450521
}
],
"error":null
}
But the returned `url` is http-only and the updater can't download it (throws error). WhenI try to curl it without `-L` I only get `301 Moved Permanently`. Only when I append `-L` I get the correct binary response over https. I'm pretty sure this is a redirecting issue.
Here's my Nginx config:
Code:
server{
server_name MYDOMAIN;
server_tokens off;
listen 80;
listen [::]:80 ipv6only=on;
# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
return 301 https://$host$request_uri;
}
server {
server_name MYDOMAIN;
server_tokens off;
listen 443 ssl http2;
listen [::]:443 ssl http2 ipv6only=on;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:24087;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
add_header Strict-Transport-Security "max-age=15768000; includeSubdomains; preload";
add_header Referrer-Policy same-origin;
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options DENY;
add_header X-Xss-Protection "1; mode=block";
[...]
Any idea what I'm doing wrong?
Basically I want to know how to force the `url` response in the JSON to be `https` instead of `http`. (At least that's what I think is the reason for the updater not being able to download the image.)
Code:
08-30 16:00:19.407 7025 7025 D UpdaterController: Starting 50533a894b2ab0d9b2711444ca4f2b530a8ff2389723ea2bd7ada6e029599e2c
08-30 16:00:19.409 7025 7921 E HttpURLConnectionClient: Error downloading file
08-30 16:00:19.409 7025 7921 E HttpURLConnectionClient: java.io.IOException: Cleartext HTTP traffic to MYDOMAIN not permitted
08-30 16:00:19.409 7025 7921 E HttpURLConnectionClient: at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:124)
08-30 16:00:19.409 7025 7921 E HttpURLConnectionClient: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
08-30 16:00:19.409 7025 7921 E HttpURLConnectionClient: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
08-30 16:00:19.409 7025 7921 E HttpURLConnectionClient: at org.lineageos.updater.download.HttpURLConnectionClient$DownloadThread.run(HttpURLConnectionClient.java:250)
08-30 16:00:19.409 7025 7921 E UpdaterController: Download failed
EDIT: Solved!
Code:
location / {
proxy_pass http://127.0.0.1:24087;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
#proxy_set_header Host $host;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-NginX-Proxy true;
}
Not sure if this project is still supported, but with build.prop change, it just checks for updates forever on phone. When I try debugging with the UnitTest script, I get "Not Found The requested URL /CyanogenModOTA/api was not found on this server." (definitely server-related) I've gotten this working before on another VPS, so I'm wondering why it's not on my build server.
Are there any specific packages I need to install to get this working?
Here is my php config: http://hongbuild.ddns.net:81/test.php
klvnhng said:
Not sure if this project is still supported, but with build.prop change, it just checks for updates forever on phone. When I try debugging with the UnitTest script, I get "Not Found The requested URL /CyanogenModOTA/api was not found on this server." (definitely server-related) I've gotten this working before on another VPS, so I'm wondering why it's not on my build server.
Are there any specific packages I need to install to get this working?
Here is my php config: http://hongbuild.ddns.net:81/test.php
Click to expand...
Click to collapse
Since build.prop is in the system.new.dat file in lollipop builds, I just started copying it over from my build server and modified the Build.php file to look for the file instead of inside the zip. I just got this working on my web server. Only issue I'm having is related to change logs but I'm going to try and figure that one out later.
Here are the changes I did to get this working with CyanogenMod 12 (all changes will be assumed from the CyanogenModOTA directory):
- mkdir -p builds/buildprop <-- this is where you copy your build.prop from each build (they go in a folder with the same name as the build zip e.x. cm-12-20150103-NIGHTLY)
- mkdir -p builds/changelog <-- this will have your change logs (name them the same as the build zip except with a .txt extension)
- update setConfig( 'basePath', 'CyanogenModOTA' ) to setConfig( 'basePath', 'http://wfhome.net/CyanogenModOTA' ) in index.php (that is my server)
- change the Build constructor function to this (I updated the preg_match_all line, added the buildPropFolder variable, updated the $this->buildProp line, and changed the changeLogUrl line):
Code:
private $buildPropFolder = '';
public function __construct($fileName, $physicalPath) {
/*
$tokens Schema:
array(
1 => [CM VERSION] (ex. 10.1.x, 10.2, 11, etc.)
2 => [DATE OF BUILD] (ex. 20140130)
3 => [CHANNEL OF THE BUILD] (ex. RC, RC2, NIGHTLY, etc.)
4 => [MODEL] (ex. i9100, i9300, etc.)
)
*/
preg_match_all( '/cm-([0-9\.]+-)(\d+-)?([a-zA-Z0-9]+-)?([a-zA-Z0-9]+).zip/', $fileName, $tokens );
$tokens = $this->removeTrailingDashes( $tokens );
$this->filePath = $physicalPath . '/' . $fileName;
$this->buildPropFolder = str_replace('/full', '/buildprop', $physicalPath) . '/' . preg_replace('/\\.[^.\\s]{3,4}$/', '', $fileName);
$this->buildProp = explode( "\n", file_get_contents($this->buildPropFolder . '/build.prop') );
$this->channel = $this->_getChannel( str_replace( range( 0 , 9 ), '', $tokens[3] ) );
$this->filename = $fileName;
$this->url = $this->_getUrl( '', Flight::cfg()->get('buildsPath') );
$this->changelogUrl = str_replace('/full', '/changelog', $this->_getChangelogUrl());
$this->timestamp = filemtime( $this->filePath );
$this->incremental = $this->getBuildPropValue( 'ro.build.version.incremental' );
$this->apiLevel = $this->getBuildPropValue( 'ro.build.version.sdk' );
$this->model = $this->getBuildPropValue( 'ro.cm.device' );
}
Also he has memcached setup in there, so you might make sure you have memcache installed and set to run on startup on your server. You also need xdelta3 to create delta builds although, I don't think it is working ( I compiled the latest version of xdelta3 and it doesn't appear to do anything as there are not any files being created in the delta folder).
Hope that helps.
Thanks for the help (I'll definitely need it when I actually want to start USING the server), but it seems you've misunderstood me. Right now, I can't even get the rest server running properly-that's why I'm getting a 404 error.
Notice you get an output when you go to http://wfhome.net/CyanogenModOTA/api, I don't get anything!
klvnhng said:
Thanks for the help (I'll definitely need it when I actually want to start USING the server), but it seems you've misunderstood me. Right now, I can't even get the rest server running properly-that's why I'm getting a 404 error.
Notice you get an output when you go to http://wfhome.net/CyanogenModOTA/api, I don't get anything!
Click to expand...
Click to collapse
Ah sorry. First thing I see is that you need mod_rewrite installed in apache.
Code:
sudo a2enmod rewrite
sudo service apache2 restart
Need help with development
First I would like to thank you for using this product and playing with it (which involves patching, testing, etc.).
Since the first post I've made here in XDA the project evolved a little since I rewrote entirely the project to make it composer friendly. Rather than that, the Delta build process is actually non working (I tried to create a ZIP but I don't have enough knowledge in ROM development to tell if it's enough or not) so it's just a WIP layer that should be addressed and fixed (I've already found a Python project which does this already but I'm of the idea that this should be somehow not be a bloated software that needs to install binaries here and there to make it working).
So, actually I'm not really working in this project but It's in my TODO list, meanwhile I'll be very happy to have pull requests with useful patches to make this KK, LL and more compatible So feel free to contribute and thanks again for using it!
JulianXhokaxhiu said:
First I would like to thank you for using this product and playing with it (which involves patching, testing, etc.).
Since the first post I've made here in XDA the project evolved a little since I rewrote entirely the project to make it composer friendly. Rather than that, the Delta build process is actually non working (I tried to create a ZIP but I don't have enough knowledge in ROM development to tell if it's enough or not) so it's just a WIP layer that should be addressed and fixed (I've already found a Python project which does this already but I'm of the idea that this should be somehow not be a bloated software that needs to install binaries here and there to make it working).
So, actually I'm not really working in this project but It's in my TODO list, meanwhile I'll be very happy to have pull requests with useful patches to make this KK, LL and more compatible So feel free to contribute and thanks again for using it!
Click to expand...
Click to collapse
Thank YOU for making it! Really appreciate the time and effort you've put into this project.
rjwil1086 said:
Ah sorry. First thing I see is that you need mod_rewrite installed in apache.
Code:
sudo a2enmod rewrite
sudo service apache2 restart
Click to expand...
Click to collapse
That did it, thanks :good:
I've also implemented your changes, but when I check for updates on my phone, I still get "No new updates found". I've copied my new build over to builds/full, and the build.prop to builds/buildprop/cm*
rjwil1086 thank you very much for your help and suggestions, I made my own server http://paksman.ddns.net/cyanogenmodota, edited build.prop for cm updater to look for server url, made all the changes as you but I always get "No new updates found". Not sure if there is a problem with my server or with this project in general. Have you made any success to make this work?
I have it working. I'll upload mine to github tonight
Think I solved my own problem. My builds were all tagged as 'UNOFFICIAL'. When I changed this to 'NIGHTLY' (for the build and build.prop folder respectively ) they finally started to be recognised by cm updater app. JulianXhokaxhiu and rjwil1086, thank you so much for your effort,your work is being much appreciated.
Packsman said:
Think I solved my own problem. My builds were all tagged as 'UNOFFICIAL'. When I changed this to 'NIGHTLY' (for the build and build.prop folder respectively ) they finally started to be recognised by cm updater app. JulianXhokaxhiu and rjwil1086, thank you so much for your effort,your work is being much appreciated.
Click to expand...
Click to collapse
Yup. Sorry. I knew that but forgot to mention it. That's an issue with the CMUpdater app more than it is with the REST implementation. It doesn't look for unofficial files
Packsman said:
Think I solved my own problem. My builds were all tagged as 'UNOFFICIAL'. When I changed this to 'NIGHTLY' (for the build and build.prop folder respectively ) they finally started to be recognised by cm updater app. JulianXhokaxhiu and rjwil1086, thank you so much for your effort,your work is being much appreciated.
Click to expand...
Click to collapse
Awesome! This fixed it for me as well. Thanks to everyone for the help
[CyanogenMod][OTA][PHP] Open Source REST Server for you
Hi, I have been tested server code with a free host (000webhost) then accessed the web, I received messages:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/a5885282/public_html/index.php on line 27
Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home/a5885282/public_html/index.php on line 27
The line 27 of index.php is "use \JX\CmOta\CmOta;". But I don't know about PHP. Please help me solve this issue.
@rjwil1086 , @klvnhng , @Packsman please help me to solve following error:
$ node index.js
<h1>500 Internal Server Error</h1><h3>Undefined offset: 0 (8)</h3><pre>#0 /var/www/CyanogenModOTA/src/Helpers/Build.php(214): flight\Engine->handleError(8, 'Undefined offse...', '/var/www/Cyanog...', 214, Array)
#1 /var/www/CyanogenModOTA/src/Helpers/Build.php(63): JX\CmOta\Helpers\Build->removeTrailingDashes(Array)
#2 /var/www/CyanogenModOTA/src/Helpers/Builds.php(115): JX\CmOta\Helpers\Build->__construct('cm-11-20140103-...', '/var/www/Cyanog...')
#3 /var/www/CyanogenModOTA/src/Helpers/Builds.php(49): JX\CmOta\Helpers\Builds->getBuilds()
#4 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/core/Loader.php(123): JX\CmOta\Helpers\Builds->__construct()
#5 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/core/Loader.php(80): flight\core\Loader->newInstance('\JX\CmOta\Helpe...', Array)
#6 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/Engine.php(69): flight\core\Loader->load('builds', true)
#7 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/core/Dispatcher.php(191): flight\Engine->__call('builds', Array)
#8 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/core/Dispatcher.php(191): flight\Engine->builds()
#9 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/Flight.php(43): flight\core\Dispatcher::invokeMethod(Array, Array)
#10 /var/www/CyanogenModOTA/src/CmOta.php(97): Flight::__callStatic('builds', Array)
#11 /var/www/CyanogenModOTA/src/CmOta.php(97): Flight::builds()
#12 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/core/Dispatcher.php(160): JX\CmOta\{closure}()
#13 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/core/Dispatcher.php(143): flight\core\Dispatcher::callFunction(Object(Closure), Array)
#14 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/Engine.php(310): flight\core\Dispatcher::execute(Object(Closure), Array)
#15 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/core/Dispatcher.php(191): flight\Engine->_start()
#16 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/core/Dispatcher.php(142): flight\core\Dispatcher::invokeMethod(Array, Array)
#17 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/core/Dispatcher.php(48): flight\core\Dispatcher::execute(Array, Array)
#18 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/Engine.php(64): flight\core\Dispatcher->run('start', Array)
#19 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/core/Dispatcher.php(191): flight\Engine->__call('start', Array)
#20 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/core/Dispatcher.php(191): flight\Engine->start()
#21 /var/www/CyanogenModOTA/vendor/mikecao/flight/flight/Flight.php(43): flight\core\Dispatcher::invokeMethod(Array, Array)
#22 /var/www/CyanogenModOTA/src/CmOta.php(80): Flight::__callStatic('start', Array)
#23 /var/www/CyanogenModOTA/src/CmOta.php(80): Flight::start()
#24 /var/www/CyanogenModOTA/index.php(35): JX\CmOta\CmOta->run()
#25 {main}</pre>
Thank you so much.
Thanks all, I fixed.
[CyanogenMod][OTA][PHP] Open Source REST Server for you
I have just creat susscess a server. Thanks.
But, now I want creat a update OTA app for other AOSP ( andoird L) and using that server which I have just creat.
Can I using CMupdater for it? Can you give me some suggest?
Hi, need help to understand!
First of all, i want to say Thank You! For this great job!
I installed server, activated mod rewrite in apache2, apt-get install memcached, made chown for all files to www-data in CyanogenModOTA directory
created directories builds/buildprop, builds/changelog
created file romname.txt in changelog
copied file rom archive to build/full directory
and when i open in browser my ota site: http ota.mydomain.com i see the dir listing as described above
when i try to open url http ota.mydomain.com/api - i see the 404 error.
what exactly i have to do as the next step?
is any json file missed in web root directory (in same place as index.php) ?
and I leave index.php almost unchanged (as in the repository) - just changed string: ->setConfig( 'basePath', '/' )
Thank You once again!
vvzar said:
First of all, i want to say Thank You! For this great job!
I installed server, activated mod rewrite in apache2, apt-get install memcached, made chown for all files to www-data in CyanogenModOTA directory
created directories builds/buildprop, builds/changelog
created file romname.txt in changelog
copied file rom archive to build/full directory
and when i open in browser my ota site: http ota.mydomain.com i see the dir listing as described above
when i try to open url http ota.mydomain.com/api - i see the 404 error.
what exactly i have to do as the next step?
is any json file missed in web root directory (in same place as index.php) ?
and I leave index.php almost unchanged (as in the repository) - just changed string: ->setConfig( 'basePath', '/' )
Thank You once again!
Click to expand...
Click to collapse
Are you sure that modrewrite is working? Can you share a working URL?
lingak said:
I have just creat susscess a server. Thanks.
But, now I want creat a update OTA app for other AOSP ( andoird L) and using that server which I have just creat.
Can I using CMupdater for it? Can you give me some suggest?
Click to expand...
Click to collapse
Honestly I don't know, we have to check if OTA app is the same in Lollipop and works of course the same. If so, we're already safe and yes it can work out of the box. If not, we have to fix it. If you already have a working example, feel free to do a pull request
JulianXhokaxhiu said:
Are you sure that modrewrite is working? Can you share a working URL?
[email protected]:/home/user# a2enmod rewrite
Module rewrite already enabled
[email protected]:/home/user#
.htaccess:
[email protected]:/home/user# cat /var/www/html/CyanogenModOTA/.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
[email protected]:/home/user#
Is any other rules i have to check?
What about statement <Directory /var/www/html/CyanogenModOTA> ?
Is enouph AllowOverride All and Allow from all ?
test url : http ota.smylink.org
Click to expand...
Click to collapse
vvzar said:
JulianXhokaxhiu said:
Are you sure that modrewrite is working? Can you share a working URL?
[email protected]:/home/user# a2enmod rewrite
Module rewrite already enabled
[email protected]:/home/user#
.htaccess:
[email protected]:/home/user# cat /var/www/html/CyanogenModOTA/.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
[email protected]:/home/user#
Is any other rules i have to check?
What about statement <Directory /var/www/html/CyanogenModOTA> ?
Is enouph AllowOverride All and Allow from all ?
test url : http ota.smylink.org
Click to expand...
Click to collapse
Technically it should be enough but the order of where you placed it is important too.
Anyway, going to your URL is just making me think that the PHP code is running well (the redirect to builds folder is triggered by CMOTA Rest Code). You're just missing the htaccess rules.
I'm quite sure you just have to figure out your own server setup to understand if mod_rewrite is properly working (allowing htaccess files to be read and parsed).
Click to expand...
Click to collapse

[Q][DONE] Error when compiling Android 7, mknod typecast problem

Hello,
I am currently trying to compile Android 7.0.0_r6 for the Sony Xperia Z Ultra C6833 (togari). I added the binaries from Sony's AOSP for Xperia project, applied the patches listed on the Sony site and began compiling when an error occured:
Code:
device/sony/common-init/init/init_main.cpp:126:21: error: implicit conversion from 'unsigned long long' to 'dev_t' (aka 'unsigned int') changes value from 17592185041919 to 4293964799 [-Werror,-Wconstant-conversion]
makedev(DEV_BLOCK_FOTA_MAJOR, (unsigned int)DEV_BLOCK_FOTA_MINOR));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bionic/libc/include/sys/sysmacros.h:35:41: note: expanded from macro 'makedev'
(((__minor) & 0xffffff00ULL) << 12) | (((__minor) & 0xffULL)) \
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
I dug around a little bit and found the corresponding piece of code causing this:
Code:
mknod(DEV_BLOCK_FOTA_PATH, S_IFBLK | 0600,
makedev(DEV_BLOCK_MAJOR, DEV_BLOCK_FOTA_NUM));
It seems that mknod requires a dev_t (unsigned int) as second argument, but the return from makedev is bigger, thus causing a typecast overflow. I ran a test, just the makedev function with the given constants compiles without any error, the error must be caused by the mknod function. But I cannot seem to figure out how to fix this.
Any help is greatly appreciated.
OS: Ubuntu 16.04 LTS
CPU: Intel i7 6700K
RAM: 8GB
EDIT: So I found out what went wrong. The code stated here is perfectly fine, the problem lies within the if block, checking if this step is necessary:
Code:
if (DEV_BLOCK_FOTA_MAJOR != -1 &&
keycheckStatus != KEYCHECK_RECOVERY_BOOT_ONLY)
The problem here is that it checks the wrong constant. It should check DEV_BLOCK_FOTA_MINOR, which is set as -1 in the init_board.h. The fixed version looks like this:
Code:
if (DEV_BLOCK_FOTA_MINOR != -1 &&
keycheckStatus != KEYCHECK_RECOVERY_BOOT_ONLY)
A fixed version is already in the SonyXperiaDev repo, it was submitted yesterday and my sources have been loaded several days before. So, outdated, bugged source files were the reason. Please close.

Categories

Resources